diff --git a/.gitignore b/.gitignore index 07387c408d4..2693d7c723e 100644 --- a/.gitignore +++ b/.gitignore @@ -360,3 +360,4 @@ apiserver.local.config node_modules _book /test/data +/test-scripts diff --git a/.go-version b/.go-version index e817184225c..6fee2fedb0a 100644 --- a/.go-version +++ b/.go-version @@ -1 +1 @@ -go1.22.2 +1.22.2 diff --git a/.todo.md b/.todo.md index 850dc268394..72046d8893d 100644 --- a/.todo.md +++ b/.todo.md @@ -12,8 +12,6 @@ [] 代码测试 [] 单元测试 [] 项目注释 -[✔] 项目文档补全 -[✔] 课程目录补全(精细版) [?] 生成errors.md? [?] 对接prometheus [?] 生成store? --- 只生成internal/usercenter/store下格式的代码 @@ -29,12 +27,13 @@ [?] https://github.com/samber/lo [?] loki: https://github.com/piupuer/gin-web -[?] 使用 clientBuilder,参考clusternet-agent源码 [?] 使用 gin + mysql 实现类似kube-apiserver [?] loft 调研 [?] onex-apiserver 后端对接 ES [?] 诊断平台 - +[?] GraphQL API +[?] 添加状态机 +[?] 场景:Webhook 展示修改镜像地址?? --- [?] 创建一个项目开发者社区网站 + 群??? @@ -129,3 +128,6 @@ [✔] 事务回滚 [✔] 添加 .go-version 特性 [✔] 缓存服务添加 +[✔] 项目文档补全 +[✔] 课程目录补全(精细版) +[✔] 使用 clientBuilder,参考clusternet-agent源码 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 453c7b53c52..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. - -# Dockerfile generated by scripts/gen-dockerfile.sh. DO NOT EDIT. - -# Build the onex-usercenter binary -# Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie - -FROM ${prod_image} -LABEL maintainer="" - -WORKDIR /opt/onex - -# Note: the is required to support -# setting timezone otherwise the build will fail -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ - echo "Asia/Shanghai" > /etc/timezone - -COPY onex-usercenter /opt/onex/bin/ - -ENTRYPOINT ["/opt/onex/bin/onex-usercenter"] diff --git a/Makefile b/Makefile index c5f298d3c38..a6459a5c40d 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,10 @@ endif .PHONY: gen-k8s gen-k8s: ## Generate all necessary kubernetes related files, such as deepcopy files - $(MAKE) -s generated.files + @$(ONEX_ROOT)/scripts/update-codegen.sh + # The following command is old generate way with makefile script. + # Comment here as a code history. + # $(MAKE) -s generated.files .PHONY: protoc protoc: ## Generate api proto files. @@ -103,8 +106,8 @@ push.multiarch: ## Build docker images for multiple platforms and push images to ##@ Deploy .PHONY: deploy -deploy: ## Build docker images for host arch, and deploy it in kind cluster. - $(MAKE) deploy.kind +deploy: ## Build and push docker images for host arch, and deploy it in kubernetes cluster. + $(MAKE) deploy.run .PHONY: docker-install docker-install: ## Deploy onex with docker. diff --git a/OWNERS b/OWNERS index 8d3ebb519cb..016c6d946f7 100644 --- a/OWNERS +++ b/OWNERS @@ -1,4 +1,4 @@ -# See the OWNERS docs at https://go.k8s.io/owners +KubeVersionedInformers# See the OWNERS docs at https://go.k8s.io/owners reviewers: - colin404 diff --git a/SECURITY_CONTACTS b/SECURITY_CONTACTS index 6df6a4d6a16..d70ffb0934d 100644 --- a/SECURITY_CONTACTS +++ b/SECURITY_CONTACTS @@ -10,8 +10,4 @@ # DO NOT REPORT SECURITY VULNERABILITIES DIRECTLY TO THESE NAMES, FOLLOW THE # INSTRUCTIONS AT https://kubernetes.io/security/ -cjcullen -joelsmith -liggitt -philips -tallclair +colin404 diff --git a/api/api-rules/README.md b/api/api-rules/README.md new file mode 100644 index 00000000000..5edeaa77a5d --- /dev/null +++ b/api/api-rules/README.md @@ -0,0 +1,42 @@ +# Existing API Rule Violations + +This folder contains the checked-in report file of known API rule violations. +The file violation\_exceptions.list is used by Make rule during OpenAPI spec generation to make +sure that no new API rule violation is introduced into our code base. + +## API Rule Violation Format + +The report file [violation\_exceptions.list](./violation_exceptions.list) is in format of: + + * ***API rule violation: \,\,\,\*** + +e.g. + + * ***API rule violation: names_match,k8s.io/api/core/v1,Event,ReportingController*** + +And the violation list is sorted alphabetically in each of the \, \, \, \ levels. + +## How to resolve API Rule Check Failure + +Make rule returns an error when the newly generated violation report differs from this +checked-in violation report. + +Our goal is that exceptions should never be added to this list, only fixed and removed. +For new APIs, this is a hard requirement. For APIs that are e.g. being moved between +versions or groups without other changes, it is OK for your API reviewer to make an +exception. + +If you're removing violations from the exception list, or if you have good +reasons to add new violations to this list, please update the file using: + + - `UPDATE_API_KNOWN_VIOLATIONS=true ./hack/update-codegen.sh` + +It is up to API reviewers to review the list and make sure new APIs follow our API conventions. + +**NOTE**: please don't hide changes to this file in a "generated changes" commit, treat it as +source code instead. + +## API Rules Being Enforced + +For more information about the API rules being checked, please refer to +https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators/rules diff --git a/api/api-rules/aggregator_violation_exceptions.list b/api/api-rules/aggregator_violation_exceptions.list new file mode 100644 index 00000000000..8f1c9408a63 --- /dev/null +++ b/api/api-rules/aggregator_violation_exceptions.list @@ -0,0 +1,9 @@ +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,APIResourceList,APIResources +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Duration,Duration +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Object +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,MicroTime,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,StatusCause,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType diff --git a/api/api-rules/apiextensions_violation_exceptions.list b/api/api-rules/apiextensions_violation_exceptions.list new file mode 100644 index 00000000000..9f9227be5ce --- /dev/null +++ b/api/api-rules/apiextensions_violation_exceptions.list @@ -0,0 +1,40 @@ +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,Ref +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XEmbeddedResource +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XIntOrString +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XListMapKeys +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XListType +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XMapType +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XPreserveUnknownFields +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaProps,XValidations +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaPropsOrArray,JSONSchemas +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaPropsOrArray,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaPropsOrBool,Allows +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaPropsOrBool,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaPropsOrStringArray,Property +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,JSONSchemaPropsOrStringArray,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,CustomResourceColumnDefinition,JSONPath +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,Ref +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XEmbeddedResource +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XIntOrString +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XListMapKeys +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XListType +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XMapType +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XPreserveUnknownFields +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaProps,XValidations +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaPropsOrArray,JSONSchemas +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaPropsOrArray,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaPropsOrBool,Allows +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaPropsOrBool,Schema +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaPropsOrStringArray,Property +API rule violation: names_match,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1,JSONSchemaPropsOrStringArray,Schema +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,APIResourceList,APIResources +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Duration,Duration +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Object +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,MicroTime,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,StatusCause,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType diff --git a/api/api-rules/codegen_violation_exceptions.list b/api/api-rules/codegen_violation_exceptions.list new file mode 100644 index 00000000000..d16e61db5c9 --- /dev/null +++ b/api/api-rules/codegen_violation_exceptions.list @@ -0,0 +1,12 @@ +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,APIResourceList,APIResources +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Duration,Duration +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Object +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,MicroTime,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,StatusCause,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType +API rule violation: names_match,k8s.io/code-generator/examples/apiserver/apis/example/v1,TestTypeStatus,Blah +API rule violation: names_match,k8s.io/code-generator/examples/apiserver/apis/example2/v1,TestTypeStatus,Blah +API rule violation: names_match,k8s.io/code-generator/examples/apiserver/apis/example3.io/v1,TestTypeStatus,Blah diff --git a/api/api-rules/sample_apiserver_violation_exceptions.list b/api/api-rules/sample_apiserver_violation_exceptions.list new file mode 100644 index 00000000000..8f1c9408a63 --- /dev/null +++ b/api/api-rules/sample_apiserver_violation_exceptions.list @@ -0,0 +1,9 @@ +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,APIResourceList,APIResources +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Duration,Duration +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Object +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,InternalEvent,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,MicroTime,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,StatusCause,Type +API rule violation: names_match,k8s.io/apimachinery/pkg/apis/meta/v1,Time,Time +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentEncoding +API rule violation: names_match,k8s.io/apimachinery/pkg/runtime,Unknown,ContentType diff --git a/api/swagger/.keep b/api/api-rules/violation_exceptions.list similarity index 100% rename from api/swagger/.keep rename to api/api-rules/violation_exceptions.list diff --git a/api/openapi/gateway/v1/gateway.swagger.json b/api/openapi/gateway/v1/gateway.swagger.json index 7d5139cecfb..b22c1d4c007 100644 --- a/api/openapi/gateway/v1/gateway.swagger.json +++ b/api/openapi/gateway/v1/gateway.swagger.json @@ -680,21 +680,21 @@ "items": { "$ref": "#/definitions/v1OwnerReference" }, - "title": "List of objects depended by this object. If ALL objects in the list have\nbeen deleted, this object will be garbage collected. If this object is managed by a controller,\nthen an entry in this list will point to this controller, with the controller field set to true.\nThere cannot be more than one managing controller.\n+optional\n+patchMergeKey=uid\n+patchStrategy=merge" + "title": "List of objects depended by this object. If ALL objects in the list have\nbeen deleted, this object will be garbage collected. If this object is managed by a controller,\nthen an entry in this list will point to this controller, with the controller field set to true.\nThere cannot be more than one managing controller.\n+optional\n+patchMergeKey=uid\n+patchStrategy=merge\n+listType=map\n+listMapKey=uid" }, "finalizers": { "type": "array", "items": { "type": "string" }, - "title": "Must be empty before the object is deleted from the registry. Each entry\nis an identifier for the responsible component that will remove the entry\nfrom the list. If the deletionTimestamp of the object is non-nil, entries\nin this list can only be removed.\nFinalizers may be processed and removed in any order. Order is NOT enforced\nbecause it introduces significant risk of stuck finalizers.\nfinalizers is a shared field, any actor with permission can reorder it.\nIf the finalizer list is processed in order, then this can lead to a situation\nin which the component responsible for the first finalizer in the list is\nwaiting for a signal (field value, external system, or other) produced by a\ncomponent responsible for a finalizer later in the list, resulting in a deadlock.\nWithout enforced ordering finalizers are free to order amongst themselves and\nare not vulnerable to ordering changes in the list.\n+optional\n+patchStrategy=merge" + "title": "Must be empty before the object is deleted from the registry. Each entry\nis an identifier for the responsible component that will remove the entry\nfrom the list. If the deletionTimestamp of the object is non-nil, entries\nin this list can only be removed.\nFinalizers may be processed and removed in any order. Order is NOT enforced\nbecause it introduces significant risk of stuck finalizers.\nfinalizers is a shared field, any actor with permission can reorder it.\nIf the finalizer list is processed in order, then this can lead to a situation\nin which the component responsible for the first finalizer in the list is\nwaiting for a signal (field value, external system, or other) produced by a\ncomponent responsible for a finalizer later in the list, resulting in a deadlock.\nWithout enforced ordering finalizers are free to order amongst themselves and\nare not vulnerable to ordering changes in the list.\n+optional\n+patchStrategy=merge\n+listType=set" }, "managedFields": { "type": "array", "items": { "$ref": "#/definitions/v1ManagedFieldsEntry" }, - "description": "ManagedFields maps workflow-id and version to the set of fields\nthat are managed by that workflow. This is mostly for internal\nhousekeeping, and users typically shouldn't need to set or\nunderstand this field. A workflow can be the user's name, a\ncontroller's name, or the name of a specific apply path like\n\"ci-cd\". The set of fields is always in the version that the\nworkflow used when modifying the object.\n\n+optional" + "description": "ManagedFields maps workflow-id and version to the set of fields\nthat are managed by that workflow. This is mostly for internal\nhousekeeping, and users typically shouldn't need to set or\nunderstand this field. A workflow can be the user's name, a\ncontroller's name, or the name of a specific apply path like\n\"ci-cd\". The set of fields is always in the version that the\nworkflow used when modifying the object.\n\n+optional\n+listType=atomic" } }, "description": "ObjectMeta is metadata that all persisted resources must have, which includes all objects\nusers must create." @@ -770,7 +770,7 @@ "items": { "$ref": "#/definitions/v1LabelSelectorRequirement" }, - "title": "matchExpressions is a list of label selector requirements. The requirements are ANDed.\n+optional" + "title": "matchExpressions is a list of label selector requirements. The requirements are ANDed.\n+optional\n+listType=atomic" } }, "title": "A label selector is a label query over a set of resources. The result of matchLabels and\nmatchExpressions are ANDed. An empty label selector matches all objects. A null\nlabel selector matches no objects.\n+structType=atomic" @@ -791,7 +791,7 @@ "items": { "type": "string" }, - "title": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.\n+optional" + "title": "values is an array of string values. If the operator is In or NotIn,\nthe values array must be non-empty. If the operator is Exists or DoesNotExist,\nthe values array must be empty. This array is replaced during a strategic\nmerge patch.\n+optional\n+listType=atomic" } }, "description": "A label selector requirement is a selector that contains values, a key, and an operator that\nrelates the key and values." diff --git a/api/openapi/openapi.yaml b/api/openapi/openapi.yaml index 069155f202e..55b9b5abf44 100644 --- a/api/openapi/openapi.yaml +++ b/api/openapi/openapi.yaml @@ -1,9 +1,3 @@ -# Copyright 2024 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. -# - # Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi @@ -1326,6 +1320,7 @@ components: description: |- matchExpressions is a list of label selector requirements. The requirements are ANDed. +optional + +listType=atomic 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 @@ -1352,6 +1347,7 @@ components: the values array must be empty. This array is replaced during a strategic merge patch. +optional + +listType=atomic description: |- A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. @@ -1560,6 +1556,8 @@ components: +optional +patchMergeKey=uid +patchStrategy=merge + +listType=map + +listMapKey=uid finalizers: type: array items: @@ -1580,6 +1578,7 @@ components: are not vulnerable to ordering changes in the list. +optional +patchStrategy=merge + +listType=set managedFields: type: array items: @@ -1594,6 +1593,7 @@ components: workflow used when modifying the object. +optional + +listType=atomic description: |- ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create. diff --git a/build/docker/gen-docs/Dockerfile b/build/docker/gen-docs/Dockerfile index 2be895544da..82dfa47de39 100644 --- a/build/docker/gen-docs/Dockerfile +++ b/build/docker/gen-docs/Dockerfile @@ -9,8 +9,8 @@ # Build the gen-docs binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/gen-docs/Dockerfile.multistage b/build/docker/gen-docs/Dockerfile.multistage index 67a6bdf3eb1..ac46b532381 100644 --- a/build/docker/gen-docs/Dockerfile.multistage +++ b/build/docker/gen-docs/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the gen-docs binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/gen-man/Dockerfile b/build/docker/gen-man/Dockerfile index b573c3ea826..6fe8df191fe 100644 --- a/build/docker/gen-man/Dockerfile +++ b/build/docker/gen-man/Dockerfile @@ -9,8 +9,8 @@ # Build the gen-man binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/gen-man/Dockerfile.multistage b/build/docker/gen-man/Dockerfile.multistage index 08d7fab6576..5c475e45069 100644 --- a/build/docker/gen-man/Dockerfile.multistage +++ b/build/docker/gen-man/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the gen-man binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/gen-onex-docs/Dockerfile b/build/docker/gen-onex-docs/Dockerfile index 51686e50add..f1c985504a4 100644 --- a/build/docker/gen-onex-docs/Dockerfile +++ b/build/docker/gen-onex-docs/Dockerfile @@ -9,8 +9,8 @@ # Build the gen-onex-docs binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/gen-onex-docs/Dockerfile.multistage b/build/docker/gen-onex-docs/Dockerfile.multistage index 22fb010682f..9ce394af533 100644 --- a/build/docker/gen-onex-docs/Dockerfile.multistage +++ b/build/docker/gen-onex-docs/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the gen-onex-docs binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/gen-onex-gorm-model/Dockerfile b/build/docker/gen-onex-gorm-model/Dockerfile index d1c1d12a8dd..b81e061dc13 100644 --- a/build/docker/gen-onex-gorm-model/Dockerfile +++ b/build/docker/gen-onex-gorm-model/Dockerfile @@ -9,8 +9,8 @@ # Build the gen-onex-gorm-model binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/gen-onex-gorm-model/Dockerfile.multistage b/build/docker/gen-onex-gorm-model/Dockerfile.multistage index 1e9321b868d..ede8732c540 100644 --- a/build/docker/gen-onex-gorm-model/Dockerfile.multistage +++ b/build/docker/gen-onex-gorm-model/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the gen-onex-gorm-model binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/gen-yaml/Dockerfile b/build/docker/gen-yaml/Dockerfile index 4497bbda376..c4d8ea9002f 100644 --- a/build/docker/gen-yaml/Dockerfile +++ b/build/docker/gen-yaml/Dockerfile @@ -9,8 +9,8 @@ # Build the gen-yaml binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/gen-yaml/Dockerfile.multistage b/build/docker/gen-yaml/Dockerfile.multistage index f8eda96e81f..c94970229c6 100644 --- a/build/docker/gen-yaml/Dockerfile.multistage +++ b/build/docker/gen-yaml/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the gen-yaml binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/onex-blc/Dockerfile b/build/docker/onex-blc/Dockerfile deleted file mode 100644 index 053b463fb24..00000000000 --- a/build/docker/onex-blc/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. - -# Dockerfile generated by scripts/gen-dockerfile.sh. DO NOT EDIT. - -# Build the onex-blc binary -# Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie - -FROM ${prod_image} -LABEL maintainer="" - -WORKDIR /opt/onex - -# Note: the is required to support -# setting timezone otherwise the build will fail -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ - echo "Asia/Shanghai" > /etc/timezone - -COPY onex-blc /opt/onex/bin/ - -ENTRYPOINT ["/opt/onex/bin/onex-blc"] diff --git a/build/docker/onex-blc/Dockerfile.multistage b/build/docker/onex-blc/Dockerfile.multistage deleted file mode 100644 index 10234c4d20a..00000000000 --- a/build/docker/onex-blc/Dockerfile.multistage +++ /dev/null @@ -1,68 +0,0 @@ -# syntax=docker/dockerfile:1.4 - -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. - -# Dockerfile generated by scripts/gen-dockerfile.sh. DO NOT EDIT. - -# Build the onex-blc binary - -# Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie - -# Ignore Hadolint rule "Always tag the version of an image explicitly." -# It's an invalid finding since the image is explicitly set in the Makefile. -# https://github.com/hadolint/hadolint/wiki/DL3006 -# hadolint ignore=DL3006 -FROM golang:1.20 as builder -WORKDIR /workspace - -# Run this with docker build --build-arg goproxy=$(go env GOPROXY) to override the goproxy -ARG goproxy=https://proxy.golang.org -ARG OS -ARG ARCH - -# Run this with docker build. -ENV GOPROXY=$goproxy - -# Copy the Go Modules manifests -COPY go.mod go.mod -COPY go.sum go.sum - -# Cache deps before building and copying source so that we don't need to re-download as much -# and so that source changes don't invalidate our downloaded layer -RUN --mount=type=cache,target=/go/pkg/mod \ - go mod download - -# Copy the sources -COPY api/ api/ -COPY cmd/onex-blc cmd/onex-blc -COPY pkg/ pkg/ -COPY internal/ internal/ -COPY third_party/ third_party/ - -# Build -# the GOARCH has not a default value to allow the binary be built according to the host where the command -# was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO -# the docker BUILDPLATFORM arg will be linux/arm64 when for Apple x86 it will be linux/amd64. Therefore, -# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform. -RUN CGO_ENABLED=0 GOOS=${OS:-linux} GOARCH=${ARCH} go build -a ./cmd/onex-blc - -# Production image -FROM ${prod_image} -LABEL maintainer="" - -WORKDIR /opt/onex - -# Note: the is required to support -# setting timezone otherwise the build will fail -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ - echo "Asia/Shanghai" > /etc/timezone - -COPY --from=builder /workspace/onex-blc /opt/onex/bin/ -# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies -USER 65532 -ENTRYPOINT ["/opt/onex/bin/onex-blc"] diff --git a/build/docker/onex-chatroom/Dockerfile b/build/docker/onex-chatroom/Dockerfile index 147977b3a42..5c0657a648c 100644 --- a/build/docker/onex-chatroom/Dockerfile +++ b/build/docker/onex-chatroom/Dockerfile @@ -9,8 +9,8 @@ # Build the onex-chatroom binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/onex-chatroom/Dockerfile.multistage b/build/docker/onex-chatroom/Dockerfile.multistage index 10f1f7d23da..56d92d4b919 100644 --- a/build/docker/onex-chatroom/Dockerfile.multistage +++ b/build/docker/onex-chatroom/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the onex-chatroom binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/onex-fake-miner/Dockerfile b/build/docker/onex-fake-miner/Dockerfile index 945bdaf0ae6..d4cb19a94b4 100644 --- a/build/docker/onex-fake-miner/Dockerfile +++ b/build/docker/onex-fake-miner/Dockerfile @@ -9,8 +9,8 @@ # Build the onex-fake-miner binary # Run this with docker build --build-arg prod_image= -# Default is alpine:3.17 -ARG prod_image=alpine:3.17 +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/onex-fake-miner/Dockerfile.multistage b/build/docker/onex-fake-miner/Dockerfile.multistage index bf72ffccd11..e5cdc68bab4 100644 --- a/build/docker/onex-fake-miner/Dockerfile.multistage +++ b/build/docker/onex-fake-miner/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the onex-fake-miner binary # Run this with docker build --build-arg prod_image= -# Default is alpine:3.17 -ARG prod_image=alpine:3.17 +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/onex-oss-center/Dockerfile b/build/docker/onex-oss-center/Dockerfile index d613e3630bc..1718329a60d 100644 --- a/build/docker/onex-oss-center/Dockerfile +++ b/build/docker/onex-oss-center/Dockerfile @@ -9,8 +9,8 @@ # Build the onex-oss-center binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/onex-oss-center/Dockerfile.multistage b/build/docker/onex-oss-center/Dockerfile.multistage index 0ba2c12cb7a..df1fdd7eb38 100644 --- a/build/docker/onex-oss-center/Dockerfile.multistage +++ b/build/docker/onex-oss-center/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the onex-oss-center binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/build/docker/onex/Dockerfile b/build/docker/onex/Dockerfile index 640d27fc232..e6fd9940be1 100644 --- a/build/docker/onex/Dockerfile +++ b/build/docker/onex/Dockerfile @@ -9,8 +9,8 @@ # Build the onex binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie FROM ${prod_image} LABEL maintainer="" diff --git a/build/docker/onex/Dockerfile.multistage b/build/docker/onex/Dockerfile.multistage index fdd6c0ed4d2..f877f5ae63f 100644 --- a/build/docker/onex/Dockerfile.multistage +++ b/build/docker/onex/Dockerfile.multistage @@ -10,8 +10,8 @@ # Build the onex binary # Run this with docker build --build-arg prod_image= -# Default is debian:jessie -ARG prod_image=debian:jessie +# Default is debian:trixie +ARG prod_image=debian:trixie # Ignore Hadolint rule "Always tag the version of an image explicitly." # It's an invalid finding since the image is explicitly set in the Makefile. diff --git a/cmd/gen-man/gen_onex_man.go b/cmd/gen-man/gen_onex_man.go index 88ccf06dc82..031ab3b46c7 100644 --- a/cmd/gen-man/gen_onex_man.go +++ b/cmd/gen-man/gen_onex_man.go @@ -57,14 +57,14 @@ func main() { switch module { case "onex-fakeserver": // generate manpage for onexfakeserver- - fakeserver := fakeserverapp.NewApp("onex-fakeserver").Command() + fakeserver := fakeserverapp.NewApp().Command() genMarkdown(fakeserver, "", outDir) for _, c := range fakeserver.Commands() { genMarkdown(c, "onex-fakeserver", outDir) } case "onex-usercenter": // generate manpage for onex-usercenter - usercenter := usercenterapp.NewApp("onex-usercenter").Command() + usercenter := usercenterapp.NewApp().Command() genMarkdown(usercenter, "", outDir) for _, c := range usercenter.Commands() { genMarkdown(c, "onex-usercenter", outDir) @@ -78,28 +78,28 @@ func main() { } case "onex-gateway": // generate manpage for onex-gateway - gwserver := gwapp.NewApp("onex-gateway").Command() + gwserver := gwapp.NewApp().Command() genMarkdown(gwserver, "", outDir) for _, c := range gwserver.Commands() { genMarkdown(c, "onex-gateway", outDir) } case "onex-nightwatch": // generate manpage for onex-nightwatch - nw := nwapp.NewApp("onex-nightwatch").Command() + nw := nwapp.NewApp().Command() genMarkdown(nw, "", outDir) for _, c := range nw.Commands() { genMarkdown(c, "onex-nightwatch", outDir) } case "onex-pump": // generate manpage for onex-pump - pump := pumpapp.NewApp("onex-pump").Command() + pump := pumpapp.NewApp().Command() genMarkdown(pump, "", outDir) for _, c := range pump.Commands() { genMarkdown(c, "onex-pump", outDir) } case "onex-toyblc": // generate manpage for onex-toyblc - toyblc := toyblcapp.NewApp("onex-toyblc").Command() + toyblc := toyblcapp.NewApp().Command() genMarkdown(toyblc, "", outDir) for _, c := range toyblc.Commands() { genMarkdown(c, "onex-toyblc", outDir) diff --git a/cmd/gen-onex-docs/gen_onex_docs.go b/cmd/gen-onex-docs/gen_onex_docs.go index 2611b3ff5aa..3ad746a68c1 100644 --- a/cmd/gen-onex-docs/gen_onex_docs.go +++ b/cmd/gen-onex-docs/gen_onex_docs.go @@ -46,11 +46,11 @@ func main() { switch module { case "onex-fakeserver": // generate docs for onexfakeserver- - fakeserver := fakeserverapp.NewApp("onex-fakeserver").Command() + fakeserver := fakeserverapp.NewApp().Command() _ = doc.GenMarkdownTree(fakeserver, outDir) case "onex-usercenter": // generate docs for onex-usercenter - usercenter := usercenterapp.NewApp("onex-usercenter").Command() + usercenter := usercenterapp.NewApp().Command() _ = doc.GenMarkdownTree(usercenter, outDir) case "onex-apiserver": // generate docs for onex-apiserver @@ -58,19 +58,19 @@ func main() { _ = doc.GenMarkdownTree(apiserver, outDir) case "onex-gateway": // generate docs for onex-gateway - gwserver := gwapp.NewApp("onex-gateway").Command() + gwserver := gwapp.NewApp().Command() _ = doc.GenMarkdownTree(gwserver, outDir) case "onex-nightwatch": // generate docs for onex-nightwatch - nw := watchapp.NewApp("onex-nightwatch").Command() + nw := watchapp.NewApp().Command() _ = doc.GenMarkdownTree(nw, outDir) case "onex-pump": // generate docs for onex-pump - pump := pumpapp.NewApp("onex-pump").Command() + pump := pumpapp.NewApp().Command() _ = doc.GenMarkdownTree(pump, outDir) case "onex-toyblc": // generate docs for onex-toyblc - toyblc := toyblcapp.NewApp("onex-toyblc").Command() + toyblc := toyblcapp.NewApp().Command() _ = doc.GenMarkdownTree(toyblc, outDir) case "onex-controller-manager": // generate docs for onex-controller-manager diff --git a/cmd/gen-swaggertype-docs/swagger_type_docs.go b/cmd/gen-swaggertype-docs/swagger_type_docs.go new file mode 100644 index 00000000000..699173c8614 --- /dev/null +++ b/cmd/gen-swaggertype-docs/swagger_type_docs.go @@ -0,0 +1,71 @@ +/* +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 + +import ( + "fmt" + "io" + "os" + + kruntime "k8s.io/apimachinery/pkg/runtime" + + flag "github.com/spf13/pflag" + "k8s.io/klog/v2" +) + +var ( + functionDest = flag.StringP("func-dest", "f", "-", "Output for swagger functions; '-' means stdout (default)") + typeSrc = flag.StringP("type-src", "s", "", "From where we are going to read the types") + verify = flag.BoolP("verify", "v", false, "Verifies if the given type-src file has documentation for every type") +) + +func main() { + flag.Parse() + + if *typeSrc == "" { + klog.Fatalf("Please define -s flag as it is the source file") + } + + var funcOut io.Writer + if *functionDest == "-" { + funcOut = os.Stdout + } else { + file, err := os.Create(*functionDest) + if err != nil { + klog.Fatalf("Couldn't open %v: %v", *functionDest, err) + } + defer file.Close() + funcOut = file + } + + docsForTypes := kruntime.ParseDocumentationFrom(*typeSrc) + + if *verify { + rc, err := kruntime.VerifySwaggerDocsExist(docsForTypes, funcOut) + if err != nil { + fmt.Fprintf(os.Stderr, "Error in verification process: %s\n", err) + } + os.Exit(rc) + } + + if len(docsForTypes) > 0 { + if err := kruntime.WriteSwaggerDocFunc(docsForTypes, funcOut); err != nil { + fmt.Fprintf(os.Stderr, "Error when writing swagger documentation functions: %s\n", err) + os.Exit(-1) + } + } +} diff --git a/cmd/onex-apiserver/apiserver.go b/cmd/onex-apiserver/apiserver.go index b426fe675ab..8ad842e366b 100644 --- a/cmd/onex-apiserver/apiserver.go +++ b/cmd/onex-apiserver/apiserver.go @@ -9,19 +9,76 @@ package main import ( + "context" "os" - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" + apierrors "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apiserver/pkg/admission" + genericapiserver "k8s.io/apiserver/pkg/server" "k8s.io/component-base/cli" _ "k8s.io/component-base/logs/json/register" // for JSON log format registration _ "k8s.io/component-base/metrics/prometheus/clientgo" // load all the prometheus client-go plugins _ "k8s.io/component-base/metrics/prometheus/version" // for version metric registration + "k8s.io/klog/v2" "github.com/superproj/onex/cmd/onex-apiserver/app" + "github.com/superproj/onex/internal/apiserver/admission/plugin/minerset" + "github.com/superproj/onex/internal/controlplane/admission/initializer" + "github.com/superproj/onex/internal/pkg/config/minerprofile" + //"github.com/superproj/onex/internal/pkg/options" + appsrest "github.com/superproj/onex/internal/apiserver/registry/apps/rest" + "github.com/superproj/onex/pkg/apis/apps/v1beta1" + "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/generated/informers" ) func main() { - command := app.NewAPIServerCommand() + // Please note that the following WithOptions are all required. + command := app.NewAPIServerCommand( + // Add custom etcd options. + app.WithEtcdOptions("/registry/onex.io", v1beta1.SchemeGroupVersion), + // Add custom resource storage. + app.WithRESTStorageProviders(appsrest.RESTStorageProvider{}), + // Add custom dns address. + app.WithAlternateDNS("onex.io"), + // Add custom admission plugins. + app.WithAdmissionPlugin(minerset.PluginName, minerset.Register), + // Add custom admission plugins initializer. + app.WithAdmissionInitializers(func(c *genericapiserver.RecommendedConfig) ([]admission.PluginInitializer, error) { + client, err := versioned.NewForConfig(c.LoopbackClientConfig) + if err != nil { + return nil, err + } + informerFactory := informers.NewSharedInformerFactory(client, c.LoopbackClientConfig.Timeout) + // NOTICE: As we create a shared informer, we need to start it later. + app.WithSharedInformerFactory(informerFactory) + return []admission.PluginInitializer{initializer.New(informerFactory, client)}, nil + }), + app.WithPostStartHook( + "initialize-instance-config-client", + func(ctx genericapiserver.PostStartHookContext) error { + client, err := versioned.NewForConfig(ctx.LoopbackClientConfig) + if err != nil { + return err + } + + if err := minerprofile.Init(context.Background(), client); err != nil { + // When returning 'NotFound' error, we should not report an error, otherwise we can not + // create 'MinerTypesConfigMapName' configmap via onex-apiserver + if apierrors.IsNotFound(err) { + return nil + } + + klog.ErrorS(err, "Failed to init miner type cache") + return err + } + + return nil + }, + ), + ) + code := cli.Run(command) os.Exit(code) } diff --git a/cmd/onex-apiserver/app/aggregator.go b/cmd/onex-apiserver/app/aggregator.go new file mode 100644 index 00000000000..7a92d6d1231 --- /dev/null +++ b/cmd/onex-apiserver/app/aggregator.go @@ -0,0 +1,343 @@ +/* +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 app does all of the work necessary to create a Kubernetes +// APIServer by binding together the API, master and APIServer infrastructure. +// It can be configured and called directly or via the hyperkube framework. +package app + +import ( + "fmt" + "net/http" + "strings" + "sync" + + "k8s.io/klog/v2" + + apiextensionsinformers "k8s.io/apiextensions-apiserver/pkg/client/informers/externalversions" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apiserver/pkg/admission" + genericfeatures "k8s.io/apiserver/pkg/features" + genericapiserver "k8s.io/apiserver/pkg/server" + "k8s.io/apiserver/pkg/server/healthz" + utilfeature "k8s.io/apiserver/pkg/util/feature" + utilpeerproxy "k8s.io/apiserver/pkg/util/peerproxy" + kubeinformers "k8s.io/client-go/informers" + "k8s.io/client-go/tools/cache" + v1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" + v1helper "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1/helper" + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" + aggregatorapiserver "k8s.io/kube-aggregator/pkg/apiserver" + aggregatorscheme "k8s.io/kube-aggregator/pkg/apiserver/scheme" + apiregistrationclient "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/typed/apiregistration/v1" + informers "k8s.io/kube-aggregator/pkg/client/informers/externalversions/apiregistration/v1" + "k8s.io/kube-aggregator/pkg/controllers/autoregister" + "k8s.io/kubernetes/pkg/controlplane/controller/crdregistration" + + controlplaneoptions "github.com/superproj/onex/internal/controlplane/apiserver/options" +) + +func createAggregatorConfig( + onexAPIServerConfig genericapiserver.Config, + commandOptions controlplaneoptions.CompletedOptions, + externalInformers kubeinformers.SharedInformerFactory, + serviceResolver aggregatorapiserver.ServiceResolver, + proxyTransport *http.Transport, + peerProxy utilpeerproxy.Interface, + pluginInitializers []admission.PluginInitializer, +) (*aggregatorapiserver.Config, error) { + // make a shallow copy to let us twiddle a few things + // most of the config actually remains the same. We only need to mess with a couple items related to the particulars of the aggregator + genericConfig := onexAPIServerConfig + genericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{} + genericConfig.RESTOptionsGetter = nil + // prevent generic API server from installing the OpenAPI handler. Aggregator server + // has its own customized OpenAPI handler. + genericConfig.SkipOpenAPIInstallation = true + + if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.StorageVersionAPI) && + utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerIdentity) { + // Add StorageVersionPrecondition handler to aggregator-apiserver. + // The handler will block write requests to built-in resources until the + // target resources' storage versions are up-to-date. + genericConfig.BuildHandlerChainFunc = genericapiserver.BuildHandlerChainWithStorageVersionPrecondition + } + + if peerProxy != nil { + originalHandlerChainBuilder := genericConfig.BuildHandlerChainFunc + genericConfig.BuildHandlerChainFunc = func(apiHandler http.Handler, c *genericapiserver.Config) http.Handler { + // Add peer proxy handler to aggregator-apiserver. + // wrap the peer proxy handler first. + apiHandler = peerProxy.WrapHandler(apiHandler) + return originalHandlerChainBuilder(apiHandler, c) + } + } + + // copy the etcd options so we don't mutate originals. + // we assume that the etcd options have been completed already. avoid messing with anything outside + // of changes to StorageConfig as that may lead to unexpected behavior when the options are applied. + etcdOptions := *commandOptions.RecommendedOptions.Etcd + etcdOptions.StorageConfig.Codec = aggregatorscheme.Codecs.LegacyCodec(v1.SchemeGroupVersion, v1beta1.SchemeGroupVersion) + etcdOptions.StorageConfig.EncodeVersioner = runtime.NewMultiGroupVersioner(v1.SchemeGroupVersion, schema.GroupKind{Group: v1beta1.GroupName}) + etcdOptions.SkipHealthEndpoints = true // avoid double wiring of health checks + if err := etcdOptions.ApplyTo(&genericConfig); err != nil { + return nil, err + } + + // override MergedResourceConfig with aggregator defaults and registry + if err := commandOptions.APIEnablement.ApplyTo( + &genericConfig, + aggregatorapiserver.DefaultAPIResourceConfigSource(), + aggregatorscheme.Scheme); err != nil { + return nil, err + } + + aggregatorConfig := &aggregatorapiserver.Config{ + GenericConfig: &genericapiserver.RecommendedConfig{ + Config: genericConfig, + SharedInformerFactory: externalInformers, + }, + ExtraConfig: aggregatorapiserver.ExtraConfig{ + ProxyClientCertFile: commandOptions.ProxyClientCertFile, + ProxyClientKeyFile: commandOptions.ProxyClientKeyFile, + PeerCAFile: commandOptions.PeerCAFile, + PeerAdvertiseAddress: commandOptions.PeerAdvertiseAddress, + //ServiceResolver: serviceResolver, + ProxyTransport: proxyTransport, + RejectForwardingRedirects: commandOptions.AggregatorRejectForwardingRedirects, + }, + } + + // we need to clear the poststarthooks so we don't add them multiple times to all the servers (that fails) + aggregatorConfig.GenericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{} + + return aggregatorConfig, nil +} + +func createAggregatorServer(aggregatorConfig aggregatorapiserver.CompletedConfig, delegateAPIServer genericapiserver.DelegationTarget, apiExtensionInformers apiextensionsinformers.SharedInformerFactory, crdAPIEnabled bool) (*aggregatorapiserver.APIAggregator, error) { + aggregatorServer, err := aggregatorConfig.NewWithDelegate(delegateAPIServer) + if err != nil { + return nil, err + } + + // create controllers for auto-registration + apiRegistrationClient, err := apiregistrationclient.NewForConfig(aggregatorConfig.GenericConfig.LoopbackClientConfig) + if err != nil { + return nil, err + } + autoRegistrationController := autoregister.NewAutoRegisterController(aggregatorServer.APIRegistrationInformers.Apiregistration().V1().APIServices(), apiRegistrationClient) + apiServices := apiServicesToRegister(delegateAPIServer, autoRegistrationController) + crdRegistrationController := crdregistration.NewCRDRegistrationController( + apiExtensionInformers.Apiextensions().V1().CustomResourceDefinitions(), + autoRegistrationController) + + // Imbue all builtin group-priorities onto the aggregated discovery + if aggregatorConfig.GenericConfig.AggregatedDiscoveryGroupManager != nil { + for gv, entry := range apiVersionPriorities { + aggregatorConfig.GenericConfig.AggregatedDiscoveryGroupManager.SetGroupVersionPriority(metav1.GroupVersion(gv), int(entry.group), int(entry.version)) + } + } + + err = aggregatorServer.GenericAPIServer.AddPostStartHook("onex-apiserver-autoregistration", func(context genericapiserver.PostStartHookContext) error { + go crdRegistrationController.Run(5, context.StopCh) + go func() { + // let the CRD controller process the initial set of CRDs before starting the autoregistration controller. + // this prevents the autoregistration controller's initial sync from deleting APIServices for CRDs that still exist. + // we only need to do this if CRDs are enabled on this server. We can't use discovery because we are the source for discovery. + if crdAPIEnabled { + klog.Infof("waiting for initial CRD sync...") + crdRegistrationController.WaitForInitialSync() + klog.Infof("initial CRD sync complete...") + } else { + klog.Infof("CRD API not enabled, starting APIService registration without waiting for initial CRD sync") + } + autoRegistrationController.Run(5, context.StopCh) + }() + return nil + }) + if err != nil { + return nil, err + } + + err = aggregatorServer.GenericAPIServer.AddBootSequenceHealthChecks( + makeAPIServiceAvailableHealthCheck( + "autoregister-completion", + apiServices, + aggregatorServer.APIRegistrationInformers.Apiregistration().V1().APIServices(), + ), + ) + if err != nil { + return nil, err + } + + return aggregatorServer, nil +} + +func makeAPIService(gv schema.GroupVersion) *v1.APIService { + apiServicePriority, ok := apiVersionPriorities[gv] + if !ok { + // if we aren't found, then we shouldn't register ourselves because it could result in a CRD group version + // being permanently stuck in the APIServices list. + klog.Infof("Skipping APIService creation for %v", gv) + return nil + } + return &v1.APIService{ + ObjectMeta: metav1.ObjectMeta{Name: gv.Version + "." + gv.Group}, + Spec: v1.APIServiceSpec{ + Group: gv.Group, + Version: gv.Version, + GroupPriorityMinimum: apiServicePriority.group, + VersionPriority: apiServicePriority.version, + }, + } +} + +// makeAPIServiceAvailableHealthCheck returns a healthz check that returns healthy +// once all of the specified services have been observed to be available at least once. +func makeAPIServiceAvailableHealthCheck(name string, apiServices []*v1.APIService, apiServiceInformer informers.APIServiceInformer) healthz.HealthChecker { + // Track the auto-registered API services that have not been observed to be available yet + pendingServiceNamesLock := &sync.RWMutex{} + pendingServiceNames := sets.NewString() + for _, service := range apiServices { + pendingServiceNames.Insert(service.Name) + } + + // When an APIService in the list is seen as available, remove it from the pending list + handleAPIServiceChange := func(service *v1.APIService) { + pendingServiceNamesLock.Lock() + defer pendingServiceNamesLock.Unlock() + if !pendingServiceNames.Has(service.Name) { + return + } + if v1helper.IsAPIServiceConditionTrue(service, v1.Available) { + pendingServiceNames.Delete(service.Name) + } + } + + // Watch add/update events for APIServices + apiServiceInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj interface{}) { handleAPIServiceChange(obj.(*v1.APIService)) }, + UpdateFunc: func(old, new interface{}) { handleAPIServiceChange(new.(*v1.APIService)) }, + }) + + // Don't return healthy until the pending list is empty + return healthz.NamedCheck(name, func(r *http.Request) error { + pendingServiceNamesLock.RLock() + defer pendingServiceNamesLock.RUnlock() + if pendingServiceNames.Len() > 0 { + return fmt.Errorf("missing APIService: %v", pendingServiceNames.List()) + } + return nil + }) +} + +// priority defines group priority that is used in discovery. This controls +// group position in the kubectl output. +type priority struct { + // group indicates the order of the group relative to other groups. + group int32 + // version indicates the relative order of the version inside of its group. + version int32 +} + +// The proper way to resolve this letting the aggregator know the desired group and version-within-group order of the underlying servers +// is to refactor the genericapiserver.DelegationTarget to include a list of priorities based on which APIs were installed. +// This requires the APIGroupInfo struct to evolve and include the concept of priorities and to avoid mistakes, the core storage map there needs to be updated. +// That ripples out every bit as far as you'd expect, so for 1.7 we'll include the list here instead of being built up during storage. +var apiVersionPriorities = map[schema.GroupVersion]priority{ + {Group: "", Version: "v1"}: {group: 18000, version: 1}, + // to my knowledge, nothing below here collides + {Group: "apps", Version: "v1"}: {group: 17800, version: 15}, + {Group: "events.k8s.io", Version: "v1"}: {group: 17750, version: 15}, + {Group: "events.k8s.io", Version: "v1beta1"}: {group: 17750, version: 5}, + {Group: "authentication.k8s.io", Version: "v1"}: {group: 17700, version: 15}, + {Group: "authentication.k8s.io", Version: "v1beta1"}: {group: 17700, version: 9}, + {Group: "authentication.k8s.io", Version: "v1alpha1"}: {group: 17700, version: 1}, + {Group: "authorization.k8s.io", Version: "v1"}: {group: 17600, version: 15}, + {Group: "autoscaling", Version: "v1"}: {group: 17500, version: 15}, + {Group: "autoscaling", Version: "v2"}: {group: 17500, version: 30}, + {Group: "autoscaling", Version: "v2beta1"}: {group: 17500, version: 9}, + {Group: "autoscaling", Version: "v2beta2"}: {group: 17500, version: 1}, + {Group: "batch", Version: "v1"}: {group: 17400, version: 15}, + {Group: "batch", Version: "v1beta1"}: {group: 17400, version: 9}, + {Group: "batch", Version: "v2alpha1"}: {group: 17400, version: 9}, + {Group: "certificates.k8s.io", Version: "v1"}: {group: 17300, version: 15}, + {Group: "certificates.k8s.io", Version: "v1alpha1"}: {group: 17300, version: 1}, + {Group: "networking.k8s.io", Version: "v1"}: {group: 17200, version: 15}, + {Group: "networking.k8s.io", Version: "v1alpha1"}: {group: 17200, version: 1}, + {Group: "policy", Version: "v1"}: {group: 17100, version: 15}, + {Group: "policy", Version: "v1beta1"}: {group: 17100, version: 9}, + {Group: "rbac.authorization.k8s.io", Version: "v1"}: {group: 17000, version: 15}, + {Group: "storage.k8s.io", Version: "v1"}: {group: 16800, version: 15}, + {Group: "storage.k8s.io", Version: "v1beta1"}: {group: 16800, version: 9}, + {Group: "storage.k8s.io", Version: "v1alpha1"}: {group: 16800, version: 1}, + {Group: "apiextensions.k8s.io", Version: "v1"}: {group: 16700, version: 15}, + {Group: "admissionregistration.k8s.io", Version: "v1"}: {group: 16700, version: 15}, + {Group: "admissionregistration.k8s.io", Version: "v1beta1"}: {group: 16700, version: 12}, + {Group: "admissionregistration.k8s.io", Version: "v1alpha1"}: {group: 16700, version: 9}, + {Group: "scheduling.k8s.io", Version: "v1"}: {group: 16600, version: 15}, + {Group: "coordination.k8s.io", Version: "v1"}: {group: 16500, version: 15}, + {Group: "node.k8s.io", Version: "v1"}: {group: 16300, version: 15}, + {Group: "node.k8s.io", Version: "v1alpha1"}: {group: 16300, version: 1}, + {Group: "node.k8s.io", Version: "v1beta1"}: {group: 16300, version: 9}, + {Group: "discovery.k8s.io", Version: "v1"}: {group: 16200, version: 15}, + {Group: "discovery.k8s.io", Version: "v1beta1"}: {group: 16200, version: 12}, + {Group: "flowcontrol.apiserver.k8s.io", Version: "v1"}: {group: 16100, version: 21}, + {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta3"}: {group: 16100, version: 18}, + {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta2"}: {group: 16100, version: 15}, + {Group: "flowcontrol.apiserver.k8s.io", Version: "v1beta1"}: {group: 16100, version: 12}, + {Group: "flowcontrol.apiserver.k8s.io", Version: "v1alpha1"}: {group: 16100, version: 9}, + {Group: "internal.apiserver.k8s.io", Version: "v1alpha1"}: {group: 16000, version: 9}, + {Group: "resource.k8s.io", Version: "v1alpha2"}: {group: 15900, version: 9}, + {Group: "storagemigration.k8s.io", Version: "v1alpha1"}: {group: 15800, version: 9}, + // Append a new group to the end of the list if unsure. + // You can use min(existing group)-100 as the initial value for a group. + // Version can be set to 9 (to have space around) for a new group. +} + +func apiServicesToRegister(delegateAPIServer genericapiserver.DelegationTarget, registration autoregister.AutoAPIServiceRegistration) []*v1.APIService { + apiServices := []*v1.APIService{} + + for _, curr := range delegateAPIServer.ListedPaths() { + if curr == "/api/v1" { + apiService := makeAPIService(schema.GroupVersion{Group: "", Version: "v1"}) + registration.AddAPIServiceToSyncOnStart(apiService) + apiServices = append(apiServices, apiService) + continue + } + + if !strings.HasPrefix(curr, "/apis/") { + continue + } + // this comes back in a list that looks like /apis/rbac.authorization.k8s.io/v1alpha1 + tokens := strings.Split(curr, "/") + if len(tokens) != 4 { + continue + } + + apiService := makeAPIService(schema.GroupVersion{Group: tokens[2], Version: tokens[3]}) + if apiService == nil { + continue + } + registration.AddAPIServiceToSyncOnStart(apiService) + apiServices = append(apiServices, apiService) + } + + return apiServices +} diff --git a/cmd/onex-apiserver/app/config.go b/cmd/onex-apiserver/app/config.go index ad860e32c05..05255e5d07d 100644 --- a/cmd/onex-apiserver/app/config.go +++ b/cmd/onex-apiserver/app/config.go @@ -7,14 +7,98 @@ package app import ( + apiextensionsapiserver "k8s.io/apiextensions-apiserver/pkg/apiserver" + "k8s.io/apiserver/pkg/util/webhook" + aggregatorapiserver "k8s.io/kube-aggregator/pkg/apiserver" + "github.com/superproj/onex/cmd/onex-apiserver/app/options" - "github.com/superproj/onex/internal/apiserver" + "github.com/superproj/onex/internal/controlplane" + "github.com/superproj/onex/internal/controlplane/apiserver" ) -// NewConfig creates all the resources for running onex-apiserver, but runs none of them. -// onex-apiserver has no extension and aggregator apiserver, so return *apiserver.Config directly. -// If you want to add extension and aggregator apiserver in the future, please refer to -// https://github.com/kubernetes/kubernetes/blob/v1.28.2/cmd/kube-apiserver/app/config.go#L28. -func NewConfig(opts options.CompletedOptions) (*apiserver.Config, error) { - return CreateOneXAPIServerConfig(opts) +type Config struct { + Options options.CompletedOptions + + Aggregator *aggregatorapiserver.Config + ControlPlane *controlplane.Config + ApiExtensions *apiextensionsapiserver.Config + + ExtraConfig +} + +type ExtraConfig struct{} + +type completedConfig struct { + Options options.CompletedOptions + + Aggregator aggregatorapiserver.CompletedConfig + ControlPlane controlplane.CompletedConfig + ApiExtensions apiextensionsapiserver.CompletedConfig + + ExtraConfig +} + +type CompletedConfig struct { + // Embed a private pointer that cannot be instantiated outside of this package. + *completedConfig +} + +func (c *Config) Complete() (CompletedConfig, error) { + return CompletedConfig{&completedConfig{ + Options: c.Options, + + Aggregator: c.Aggregator.Complete(), + ControlPlane: c.ControlPlane.Complete(), + ApiExtensions: c.ApiExtensions.Complete(), + + ExtraConfig: c.ExtraConfig, + }}, nil +} + +// NewConfig creates all the resources for running kube-apiserver, but runs none of them. +func NewConfig(opts options.CompletedOptions) (*Config, error) { + c := &Config{ + Options: opts, + } + + controlPlane, serviceResolver, err := CreateOneXAPIServerConfig(opts) + if err != nil { + return nil, err + } + c.ControlPlane = controlPlane + + apiExtensions, err := apiserver.CreateAPIExtensionsConfig( + controlPlane.GenericConfig.Config, + controlPlane.ExtraConfig.KubeVersionedInformers, + nil, + opts.CompletedOptions, + 3, + serviceResolver, + webhook.NewDefaultAuthenticationInfoResolverWrapper( + controlPlane.ExtraConfig.ProxyTransport, + controlPlane.GenericConfig.EgressSelector, + controlPlane.GenericConfig.LoopbackClientConfig, + controlPlane.GenericConfig.TracerProvider, + ), + ) + if err != nil { + return nil, err + } + c.ApiExtensions = apiExtensions + + aggregator, err := createAggregatorConfig( + controlPlane.GenericConfig.Config, + opts.CompletedOptions, + controlPlane.ExtraConfig.KubeVersionedInformers, + serviceResolver, + controlPlane.ExtraConfig.ProxyTransport, + controlPlane.ExtraConfig.PeerProxy, + nil, + ) + if err != nil { + return nil, err + } + c.Aggregator = aggregator + + return c, nil } diff --git a/internal/apiserver/import_known_versions.go b/cmd/onex-apiserver/app/import_known_versions.go similarity index 67% rename from internal/apiserver/import_known_versions.go rename to cmd/onex-apiserver/app/import_known_versions.go index fdfb20d9019..0ba0b4753ec 100644 --- a/internal/apiserver/import_known_versions.go +++ b/cmd/onex-apiserver/app/import_known_versions.go @@ -4,13 +4,10 @@ // this file is https://github.com/superproj/onex. // -package apiserver +package app +// UPDATEME: When add new api group. import ( // These imports are the API groups the API server will support. - _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" - _ "github.com/superproj/onex/pkg/apis/apps/install" - _ "github.com/superproj/onex/pkg/apis/coordination/install" - _ "github.com/superproj/onex/pkg/apis/core/install" ) diff --git a/cmd/onex-apiserver/app/options/completion.go b/cmd/onex-apiserver/app/options/completion.go index d044b330949..ae96c725a03 100644 --- a/cmd/onex-apiserver/app/options/completion.go +++ b/cmd/onex-apiserver/app/options/completion.go @@ -7,25 +7,17 @@ package options import ( - "fmt" - "net" - "os" + apiserveroptions "k8s.io/apiserver/pkg/server/options" - "k8s.io/apiserver/pkg/admission" - genericapiserver "k8s.io/apiserver/pkg/server" - serveroptions "k8s.io/apiserver/pkg/server/options" - "k8s.io/klog/v2" - netutils "k8s.io/utils/net" - - "github.com/superproj/onex/internal/admission/initializer" - "github.com/superproj/onex/internal/apiserver/storage" - "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + controlplaneoptions "github.com/superproj/onex/internal/controlplane/apiserver/options" + "github.com/superproj/onex/internal/controlplane/storage" ) // completedOptions is a private wrapper that enforces a call of Complete() before Run can be invoked. type completedOptions struct { - *ServerRunOptions + controlplaneoptions.CompletedOptions + + Extra } type CompletedOptions struct { @@ -40,61 +32,31 @@ func (o *ServerRunOptions) Complete() (CompletedOptions, error) { return CompletedOptions{completedOptions: &completedOptions{}}, nil } - // set defaults - if err := o.GenericServerRunOptions.DefaultAdvertiseAddress(o.RecommendedOptions.SecureServing.SecureServingOptions); err != nil { + controlplane, err := o.Options.Complete() + if err != nil { return CompletedOptions{}, err } - // TODO have a "real" external address - if err := o.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts( - o.GenericServerRunOptions.AdvertiseAddress.String(), - []string{"onex.io"}, - []net.IP{netutils.ParseIPSloppy("127.0.0.1")}); err != nil { - return CompletedOptions{}, fmt.Errorf("error creating self-signed certificates: %w", err) - } - - //nolint: nestif - if len(o.GenericServerRunOptions.ExternalHost) == 0 { - if len(o.GenericServerRunOptions.AdvertiseAddress) > 0 { - o.GenericServerRunOptions.ExternalHost = o.GenericServerRunOptions.AdvertiseAddress.String() - } else { - if hostname, err := os.Hostname(); err == nil { - o.GenericServerRunOptions.ExternalHost = hostname - } else { - return CompletedOptions{}, fmt.Errorf("error finding host name: %w", err) - } - } - klog.Infof("external host was not specified, using %v", o.GenericServerRunOptions.ExternalHost) + completed := completedOptions{ + CompletedOptions: controlplane, + Extra: o.Extra, } - if o.RecommendedOptions.Etcd != nil && o.RecommendedOptions.Etcd.EnableWatchCache { + if completed.RecommendedOptions.Etcd != nil && completed.RecommendedOptions.Etcd.EnableWatchCache { sizes := storage.DefaultWatchCacheSizes() // Ensure that overrides parse correctly. - userSpecified, err := serveroptions.ParseWatchCacheSizes(o.RecommendedOptions.Etcd.WatchCacheSizes) + userSpecified, err := apiserveroptions.ParseWatchCacheSizes(completed.RecommendedOptions.Etcd.WatchCacheSizes) if err != nil { return CompletedOptions{}, err } for resource, size := range userSpecified { sizes[resource] = size } - o.RecommendedOptions.Etcd.WatchCacheSizes, err = serveroptions.WriteWatchCacheSizes(sizes) + completed.RecommendedOptions.Etcd.WatchCacheSizes, err = apiserveroptions.WriteWatchCacheSizes(sizes) if err != nil { return CompletedOptions{}, err } } - o.RecommendedOptions.ExtraAdmissionInitializers = func(c *genericapiserver.RecommendedConfig) ([]admission.PluginInitializer, error) { - client, err := versioned.NewForConfig(c.LoopbackClientConfig) - if err != nil { - return nil, err - } - informerFactory := informers.NewSharedInformerFactory(client, c.LoopbackClientConfig.Timeout) - o.SharedInformerFactory = informerFactory - return []admission.PluginInitializer{initializer.New(informerFactory, client)}, nil - } - - completed := completedOptions{ - ServerRunOptions: o, - } return CompletedOptions{&completed}, nil } diff --git a/cmd/onex-apiserver/app/options/options.go b/cmd/onex-apiserver/app/options/options.go index 503eebc4442..d25848ab478 100644 --- a/cmd/onex-apiserver/app/options/options.go +++ b/cmd/onex-apiserver/app/options/options.go @@ -8,113 +8,61 @@ package options import ( - "time" + "net" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - utilerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apiserver/pkg/admission" - genericoptions "k8s.io/apiserver/pkg/server/options" + genericapiserver "k8s.io/apiserver/pkg/server" cliflag "k8s.io/component-base/cli/flag" - "k8s.io/component-base/logs" - logsapi "k8s.io/component-base/logs/api/v1" - "k8s.io/component-base/metrics" - "k8s.io/kubernetes/pkg/api/legacyscheme" - "github.com/superproj/onex/internal/pkg/options" - "github.com/superproj/onex/pkg/apis/apps/v1beta1" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/internal/controlplane" + controlplaneoptions "github.com/superproj/onex/internal/controlplane/apiserver/options" + "github.com/superproj/onex/internal/controlplane/storage" ) const defaultEtcdPathPrefix = "/registry/onex.io" // ServerRunOptions contains state for master/api server. type ServerRunOptions struct { - // RecommendedOptions *genericoptions.RecommendedOptions - GenericServerRunOptions *genericoptions.ServerRunOptions - RecommendedOptions *options.RecommendedOptions - Features *genericoptions.FeatureOptions - Metrics *metrics.Options - Logs *logs.Options - Traces *genericoptions.TracingOptions - // CloudOptions *cloud.CloudOptions + *controlplaneoptions.Options - EnableLogsHandler bool - EventTTL time.Duration + Extra +} - SharedInformerFactory informers.SharedInformerFactory +type Extra struct { + MasterCount int + // In the future, perhaps an "onexlet" will be added, similar to the "kubelet". + // OnexletConfig onexletclient.OnexletClientConfig + APIServerServiceIP net.IP + EndpointReconcilerType string + + // For external resources + ExternalRESTStorageProviders []storage.RESTStorageProvider + ExternalVersionedInformers controlplane.ExternalSharedInformerFactory + ExternalPostStartHooks map[string]genericapiserver.PostStartHookFunc } // NewServerRunOptions returns a new ServerRunOptions. func NewServerRunOptions() *ServerRunOptions { o := &ServerRunOptions{ - GenericServerRunOptions: genericoptions.NewServerRunOptions(), - RecommendedOptions: options.NewRecommendedOptions( - defaultEtcdPathPrefix, - legacyscheme.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion), - ), - Features: genericoptions.NewFeatureOptions(), - Metrics: metrics.NewOptions(), - Logs: logs.NewOptions(), - Traces: genericoptions.NewTracingOptions(), - - EnableLogsHandler: true, - EventTTL: 1 * time.Hour, - // CloudOptions: cloud.NewCloudOptions(), + Options: controlplaneoptions.NewOptions(), + Extra: Extra{ + MasterCount: 1, + ExternalPostStartHooks: make(map[string]genericapiserver.PostStartHookFunc), + }, } - o.RecommendedOptions.Etcd.StorageConfig.EncodeVersioner = runtime.NewMultiGroupVersioner( - v1beta1.SchemeGroupVersion, - schema.GroupKind{Group: v1beta1.GroupName}, - ) - - // Redirect the certificates output directory to avoid creating the "apiserver.local.config" directory in the root directory - // and keep the root directory clean. - o.RecommendedOptions.SecureServing.ServerCert.CertDirectory = "_output/certificates" - - // the following three lines remove dependence with kube-apiserver - o.RecommendedOptions.Authorization = nil - o.RecommendedOptions.CoreAPI = nil - // We only register the plugin of onex-apiserver, - // so we need to clear the plugin registered by apiserver by default. - o.RecommendedOptions.Admission.Plugins = admission.NewPlugins() - - // register all custom dmission plugins - RegisterAllAdmissionPlugins(o.RecommendedOptions.Admission.Plugins) - o.RecommendedOptions.Admission.RecommendedPluginOrder = AllOrderedPlugins - o.RecommendedOptions.Admission.DefaultOffPlugins = DefaultOffAdmissionPlugins() - - // Overwrite the default for storage data format. - o.RecommendedOptions.Etcd.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf" return o } func (o ServerRunOptions) Flags() (fss cliflag.NamedFlagSets) { - o.GenericServerRunOptions.AddUniversalFlags(fss.FlagSet("generic")) - o.RecommendedOptions.AddFlags(fss.FlagSet("recommended")) - o.Features.AddFlags(fss.FlagSet("features")) - o.Metrics.AddFlags(fss.FlagSet("metrics")) - logsapi.AddFlags(o.Logs, fss.FlagSet("logs")) - o.Traces.AddFlags(fss.FlagSet("traces")) - // o.CloudOptions.AddFlags(fss.FlagSet("cloud")) + o.Options.AddFlags(&fss) // Note: the weird ""+ in below lines seems to be the only way to get gofmt to // arrange these text blocks sensibly. Grrr. fs := fss.FlagSet("misc") - fs.DurationVar(&o.EventTTL, "event-ttl", o.EventTTL, - "Amount of time to retain events.") - fs.BoolVar(&o.EnableLogsHandler, "enable-logs-handler", o.EnableLogsHandler, - "If true, install a /logs handler for the apiserver logs.") - _ = fs.MarkDeprecated("enable-logs-handler", "This flag will be removed in v1.19") + fs.IntVar(&o.MasterCount, "apiserver-count", o.MasterCount, + "The number of apiservers running in the cluster, must be a positive number. (In use when --endpoint-reconciler-type=master-count is enabled.)") + fs.MarkDeprecated("apiserver-count", "apiserver-count is deprecated and will be removed in a future version.") return fss } - -// Validate validates ServerRunOptions. -func (o ServerRunOptions) Validate(args []string) error { - errors := []error{} - errors = append(errors, o.RecommendedOptions.Validate()...) - // errors = append(errors, o.CloudOptions.Validate()...) - return utilerrors.NewAggregate(errors) -} diff --git a/cmd/onex-apiserver/app/options/validation.go b/cmd/onex-apiserver/app/options/validation.go index 0b183762edc..d59eae770ce 100644 --- a/cmd/onex-apiserver/app/options/validation.go +++ b/cmd/onex-apiserver/app/options/validation.go @@ -6,13 +6,17 @@ package options +import "fmt" + // Validate checks ServerRunOptions and return a slice of found errs. func (o CompletedOptions) Validate() []error { errs := []error{} - errs = append(errs, o.RecommendedOptions.Validate()...) - errs = append(errs, o.GenericServerRunOptions.Validate()...) - errs = append(errs, o.Metrics.Validate()...) - // errs = append(errs, o.CloudOptions.Validate()...) + errs = append(errs, o.CompletedOptions.Validate()...) + //errs = append(errs, s.CloudProvider.Validate()...) + + if o.MasterCount <= 0 { + errs = append(errs, fmt.Errorf("--apiserver-count should be a positive number, but value '%d' provided", o.MasterCount)) + } return errs } diff --git a/cmd/onex-apiserver/app/server.go b/cmd/onex-apiserver/app/server.go index 5ed43367030..7414e80e0bb 100644 --- a/cmd/onex-apiserver/app/server.go +++ b/cmd/onex-apiserver/app/server.go @@ -11,23 +11,29 @@ package app import ( + "crypto/tls" "fmt" + "net/http" + "net/url" "os" - "time" "github.com/spf13/cobra" - oteltrace "go.opentelemetry.io/otel/trace" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + extensionsapiserver "k8s.io/apiextensions-apiserver/pkg/apiserver" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" utilerrors "k8s.io/apimachinery/pkg/util/errors" + utilnet "k8s.io/apimachinery/pkg/util/net" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/sets" - "k8s.io/apiserver/pkg/endpoints/discovery/aggregated" - openapinamer "k8s.io/apiserver/pkg/endpoints/openapi" - genericfeatures "k8s.io/apiserver/pkg/features" + "k8s.io/apiserver/pkg/admission" + genericapifilters "k8s.io/apiserver/pkg/endpoints/filters" genericapiserver "k8s.io/apiserver/pkg/server" - "k8s.io/apiserver/pkg/server/filters" - serverstorage "k8s.io/apiserver/pkg/server/storage" + genericoptions "k8s.io/apiserver/pkg/server/options" + "k8s.io/apiserver/pkg/storage/storagebackend" utilfeature "k8s.io/apiserver/pkg/util/feature" - "k8s.io/apiserver/pkg/util/openapi" + "k8s.io/apiserver/pkg/util/notfoundhandler" + "k8s.io/apiserver/pkg/util/webhook" + kubeinformers "k8s.io/client-go/informers" "k8s.io/client-go/rest" cliflag "k8s.io/component-base/cli/flag" "k8s.io/component-base/cli/globalflag" @@ -35,13 +41,15 @@ import ( logsapi "k8s.io/component-base/logs/api/v1" "k8s.io/component-base/term" "k8s.io/klog/v2" + aggregatorapiserver "k8s.io/kube-aggregator/pkg/apiserver" + aggregatorscheme "k8s.io/kube-aggregator/pkg/apiserver/scheme" "k8s.io/kubernetes/pkg/api/legacyscheme" + "k8s.io/kubernetes/pkg/features" "github.com/superproj/onex/cmd/onex-apiserver/app/options" - "github.com/superproj/onex/internal/apiserver" - "github.com/superproj/onex/internal/apiserver/storage" - "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/internal/controlplane" + controlplaneapiserver "github.com/superproj/onex/internal/controlplane/apiserver" + "github.com/superproj/onex/internal/controlplane/storage" generatedopenapi "github.com/superproj/onex/pkg/generated/openapi" "github.com/superproj/onex/pkg/version" ) @@ -52,9 +60,80 @@ func init() { utilruntime.Must(logsapi.AddFeatureGates(utilfeature.DefaultMutableFeatureGate)) } +type Option func(*options.ServerRunOptions) +type RegisterFunc func(plugins *admission.Plugins) + +// WithLegacyCode returns an Option that sets the external group versions in the ServerRunOptions. +func WithEtcdOptions(prefix string, versions ...schema.GroupVersion) Option { + return func(s *options.ServerRunOptions) { + codec := legacyscheme.Codecs.LegacyCodec(versions...) + s.RecommendedOptions.Etcd = genericoptions.NewEtcdOptions(storagebackend.NewDefaultConfig(prefix, codec)) + // Note: DefaultStorageMediaType needs to be reset here. + s.RecommendedOptions.Etcd.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf" + /* + s.RecommendedOptions.Etcd.StorageConfig.EncodeVersioner = runtime.NewMultiGroupVersioner( + v1beta1.SchemeGroupVersion, + schema.GroupKind{Group: v1beta1.GroupName}, + ) + */ + for _, version := range versions { + controlplane.AddStableAPIGroupVersionsEnabledByDefault(version) + } + } +} + +// WithAdmissionPlugin returns an Option function that adds an admission plugin to the recommended plugin order list +// and registers the plugin using the provided RegisterFunc in the ServerRunOptions. +func WithAdmissionPlugin(name string, registerFunc RegisterFunc) Option { + return func(s *options.ServerRunOptions) { + // Note: Need to add this to the RecommendedPluginOrder list. + s.RecommendedOptions.Admission.RecommendedPluginOrder = append(s.RecommendedOptions.Admission.RecommendedPluginOrder, name) + registerFunc(s.RecommendedOptions.Admission.Plugins) + } +} + +// WithAdmissionInitializers returns an Option function that sets the external admission initializers in the ServerRunOptions. +func WithAdmissionInitializers(initializer func(c *genericapiserver.RecommendedConfig) ([]admission.PluginInitializer, error)) Option { + return func(s *options.ServerRunOptions) { + s.RecommendedOptions.ExternalAdmissionInitializers = initializer + } +} + +// WithPostStartHook returns an Option function that sets the external post-start hook with the given name in the ServerRunOptions. +func WithPostStartHook(name string, hook genericapiserver.PostStartHookFunc) Option { + return func(s *options.ServerRunOptions) { + s.ExternalPostStartHooks[name] = hook + } +} + +// WithSharedInformerFactory returns an Option function that sets the external SharedInformerFactory in the ServerRunOptions. +func WithSharedInformerFactory(informers controlplane.ExternalSharedInformerFactory) Option { + return func(s *options.ServerRunOptions) { + s.ExternalVersionedInformers = informers + } +} + +// WithRESTStorageProviders returns an Option function that sets the external REST storage providers in the ServerRunOptions. +func WithRESTStorageProviders(providers ...storage.RESTStorageProvider) Option { + return func(s *options.ServerRunOptions) { + s.ExternalRESTStorageProviders = providers + } +} + +// WithAlternateDNS returns an Option function that sets the alternate DNS configurations in the ServerRunOptions. +func WithAlternateDNS(dns ...string) Option { + return func(s *options.ServerRunOptions) { + s.AlternateDNS = dns + } +} + // NewAPIServerCommand creates a *cobra.Command object with default parameters. -func NewAPIServerCommand() *cobra.Command { +func NewAPIServerCommand(serverRunOptions ...Option) *cobra.Command { s := options.NewServerRunOptions() + for _, opt := range serverRunOptions { + opt(s) + } + cmd := &cobra.Command{ Use: appName, Short: "Launch a onex API server", @@ -152,149 +231,151 @@ func Run(opts options.CompletedOptions, stopCh <-chan struct{}) error { } // CreateServerChain creates the apiservers connected via delegation. -func CreateServerChain(config apiserver.CompletedConfig) (*apiserver.APIServer, error) { - onexAPIServer, err := config.New() +func CreateServerChain(config CompletedConfig) (*aggregatorapiserver.APIAggregator, error) { + notFoundHandler := notfoundhandler.New(config.ControlPlane.GenericConfig.Serializer, genericapifilters.NoMuxAndDiscoveryIncompleteKey) + apiExtensionsServer, err := config.ApiExtensions.New(genericapiserver.NewEmptyDelegateWithCustomHandler(notFoundHandler)) + if err != nil { + return nil, err + } + crdAPIEnabled := config.ApiExtensions.GenericConfig.MergedResourceConfig.ResourceEnabled(apiextensionsv1.SchemeGroupVersion.WithResource("customresourcedefinitions")) + + onexAPIServer, err := config.ControlPlane.New(apiExtensionsServer.GenericAPIServer) + if err != nil { + return nil, err + } + + // aggregator comes last in the chain + aggregatorServer, err := createAggregatorServer(config.Aggregator, onexAPIServer.GenericAPIServer, apiExtensionsServer.Informers, crdAPIEnabled) if err != nil { + // we don't need special handling for innerStopCh because the aggregator server doesn't create any go routines return nil, err } - return onexAPIServer, nil + return aggregatorServer, nil +} + +// CreateProxyTransport creates the dialer infrastructure to connect to the nodes. +func CreateProxyTransport() *http.Transport { + var proxyDialerFn utilnet.DialFunc + // Proxying to pods and services is IP-based... don't expect to be able to verify the hostname + proxyTLSClientConfig := &tls.Config{InsecureSkipVerify: true} + proxyTransport := utilnet.SetTransportDefaults(&http.Transport{ + DialContext: proxyDialerFn, + TLSClientConfig: proxyTLSClientConfig, + }) + return proxyTransport } // CreateOneXAPIServerConfig creates all the resources for running kube-apiserver, but runs none of them. -func CreateOneXAPIServerConfig(opts options.CompletedOptions) (*apiserver.Config, error) { - genericConfig, versionedInformers, storageFactory, err := BuildGenericConfig(opts) +func CreateOneXAPIServerConfig(opts options.CompletedOptions) ( + *controlplane.Config, + aggregatorapiserver.ServiceResolver, + error, +) { + proxyTransport := CreateProxyTransport() + + genericConfig, _, kubeSharedInformers, storageFactory, err := controlplaneapiserver.BuildGenericConfig( + opts.CompletedOptions, + []*runtime.Scheme{legacyscheme.Scheme, extensionsapiserver.Scheme, aggregatorscheme.Scheme}, + generatedopenapi.GetOpenAPIDefinitions, + ) if err != nil { - return nil, err + return nil, nil, err } opts.Metrics.Apply() - config := &apiserver.Config{ + config := &controlplane.Config{ GenericConfig: genericConfig, - ExtraConfig: apiserver.ExtraConfig{ + ExtraConfig: controlplane.ExtraConfig{ APIResourceConfigSource: storageFactory.APIResourceConfigSource, StorageFactory: storageFactory, EventTTL: opts.EventTTL, EnableLogsSupport: opts.EnableLogsHandler, - SharedInformerFactory: opts.SharedInformerFactory, - VersionedInformers: versionedInformers, + ProxyTransport: proxyTransport, + //ExternalGroupResources: opts.ExternalGroupResources, + ExternalRESTStorageProviders: opts.ExternalRESTStorageProviders, + MasterCount: opts.MasterCount, + //VersionedInformers: opts.SharedInformerFactory, + // Here we will use the config file of "onex" to create a client-go informers. + KubeVersionedInformers: kubeSharedInformers, + InternalVersionedInformers: opts.InternalVersionedInformers, + ExternalVersionedInformers: opts.ExternalVersionedInformers, + ExternalPostStartHooks: opts.ExternalPostStartHooks, }, } - return config, nil -} - -// BuildGenericConfig takes the master server options and produces the genericapiserver.Config associated with it. -func BuildGenericConfig(s options.CompletedOptions) ( - genericConfig *genericapiserver.RecommendedConfig, - versionedInformers informers.SharedInformerFactory, - storageFactory *serverstorage.DefaultStorageFactory, - lastErr error, -) { - genericConfig = genericapiserver.NewRecommendedConfig(legacyscheme.Codecs) - genericConfig.MergedResourceConfig = apiserver.DefaultAPIResourceConfigSource() - - if lastErr = s.GenericServerRunOptions.ApplyTo(&genericConfig.Config); lastErr != nil { - return - } - - if lastErr = s.RecommendedOptions.ApplyTo(genericConfig); lastErr != nil { - return + if utilfeature.DefaultFeatureGate.Enabled(features.UnknownVersionInteroperabilityProxy) { + config.ExtraConfig.PeerEndpointLeaseReconciler, err = controlplaneapiserver.CreatePeerEndpointLeaseReconciler(genericConfig.Config, storageFactory) + if err != nil { + return nil, nil, err + } + // build peer proxy config only if peer ca file exists + if opts.PeerCAFile != "" { + config.ExtraConfig.PeerProxy, err = controlplaneapiserver.BuildPeerProxy( + kubeSharedInformers, + genericConfig.StorageVersionManager, + opts.ProxyClientCertFile, + opts.ProxyClientKeyFile, + opts.PeerCAFile, + opts.PeerAdvertiseAddress, + genericConfig.APIServerID, + config.ExtraConfig.PeerEndpointLeaseReconciler, + config.GenericConfig.Serializer, + ) + if err != nil { + return nil, nil, err + } + } } - // Use protobufs for self-communication. - // Since not every generic apiserver has to support protobufs, we - // cannot default to it in generic apiserver and need to explicitly - // set it in onex-apiserver. - genericConfig.LoopbackClientConfig.ContentConfig.ContentType = "application/vnd.kubernetes.protobuf" - // Disable compression for self-communication, since we are going to be - // on a fast local network - genericConfig.LoopbackClientConfig.DisableCompression = true - - onexClientConfig := genericConfig.LoopbackClientConfig - clientgoExternalClient, err := versioned.NewForConfig(onexClientConfig) + /* UPDATEME: when add authentication features. + clientCAProvider, err := opts.Authentication.ClientCert.GetClientCAContentProvider() if err != nil { - lastErr = fmt.Errorf("failed to create real external clientset: %w", err) - return + return nil, nil, nil, err } - versionedInformers = informers.NewSharedInformerFactory(clientgoExternalClient, 10*time.Minute) + config.ExtraConfig.ClusterAuthenticationInfo.ClientCA = clientCAProvider - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) { - if lastErr = s.Traces.ApplyTo(genericConfig.EgressSelector, &genericConfig.Config); lastErr != nil { - return - } - } - - // wrap the definitions to revert any changes from disabled features - getOpenAPIDefinitions := openapi.GetOpenAPIDefinitionsWithoutDisabledFeatures(generatedopenapi.GetOpenAPIDefinitions) - namer := openapinamer.NewDefinitionNamer(legacyscheme.Scheme) - genericConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(getOpenAPIDefinitions, namer) - genericConfig.OpenAPIConfig.Info.Title = "OneX" - genericConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(getOpenAPIDefinitions, namer) - genericConfig.OpenAPIV3Config.Info.Title = "OneX" - // Placeholder - genericConfig.LongRunningFunc = filters.BasicLongRunningRequestCheck( - sets.NewString("watch", "proxy"), - sets.NewString("attach", "exec", "proxy", "log", "portforward"), - ) - genericConfig.Version = convertVersion(version.Get()) - - if genericConfig.EgressSelector != nil { - s.RecommendedOptions.Etcd.StorageConfig.Transport.EgressLookup = genericConfig.EgressSelector.Lookup + requestHeaderConfig, err := opts.Authentication.RequestHeader.ToAuthenticationRequestHeaderConfig() + if err != nil { + return nil, nil, nil, err } - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) { - s.RecommendedOptions.Etcd.StorageConfig.Transport.TracerProvider = genericConfig.TracerProvider - } else { - s.RecommendedOptions.Etcd.StorageConfig.Transport.TracerProvider = oteltrace.NewNoopTracerProvider() + if requestHeaderConfig != nil { + config.ExtraConfig.ClusterAuthenticationInfo.RequestHeaderCA = requestHeaderConfig.CAContentProvider + config.ExtraConfig.ClusterAuthenticationInfo.RequestHeaderAllowedNames = requestHeaderConfig.AllowedClientNames + config.ExtraConfig.ClusterAuthenticationInfo.RequestHeaderExtraHeaderPrefixes = requestHeaderConfig.ExtraHeaderPrefixes + config.ExtraConfig.ClusterAuthenticationInfo.RequestHeaderGroupHeaders = requestHeaderConfig.GroupHeaders + config.ExtraConfig.ClusterAuthenticationInfo.RequestHeaderUsernameHeaders = requestHeaderConfig.UsernameHeaders } - - // TODO: Delete the following comments - /* - if lastErr = s.RecommendedOptions.Etcd.Complete(genericConfig.StorageObjectCountTracker, genericConfig.DrainedNotify(), genericConfig.AddPostStartHook); lastErr != nil { - return - } */ - storageFactoryConfig := storage.NewStorageFactoryConfig() - storageFactoryConfig.APIResourceConfig = genericConfig.MergedResourceConfig - storageFactory, lastErr = storageFactoryConfig.Complete(s.RecommendedOptions.Etcd).New() - if lastErr != nil { - return - } - if lastErr = s.RecommendedOptions.Etcd.ApplyWithStorageFactoryTo(storageFactory, &genericConfig.Config); lastErr != nil { - return - } + serviceResolver := buildServiceResolver(opts.EnableAggregatorRouting, genericConfig.LoopbackClientConfig.Host, kubeSharedInformers) - // TODO: Currently authentication and authorization rely on kubernetes cluster. Support in the future. - /* - // Authentication.ApplyTo requires already applied OpenAPIConfig and EgressSelector if present - if lastErr = s.RecommendedOptions.Authentication.ApplyTo( - &genericConfig.Authentication, - genericConfig.SecureServing, - genericConfig.OpenAPIConfig, - ); lastErr != nil { - return - } + return config, serviceResolver, nil +} - genericConfig.Authorization.Authorizer, genericConfig.RuleResolver, err = BuildAuthorizer(s, genericConfig.EgressSelector, versionedInformers) - if err != nil { - lastErr = fmt.Errorf("invalid authorization config: %v", err) - return - } - if !sets.NewString(s.Authorization.Modes...).Has(modes.ModeRBAC) { - genericConfig.DisabledPostStartHooks.Insert(rbacrest.PostStartHookName) - } - */ +var testServiceResolver webhook.ServiceResolver - lastErr = s.RecommendedOptions.Audit.ApplyTo(&genericConfig.Config) - if lastErr != nil { - return +func buildServiceResolver(enabledAggregatorRouting bool, hostname string, informer kubeinformers.SharedInformerFactory) webhook.ServiceResolver { + if testServiceResolver != nil { + return testServiceResolver } - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) { - genericConfig.AggregatedDiscoveryGroupManager = aggregated.NewResourceManager("apis") + var serviceResolver webhook.ServiceResolver + if enabledAggregatorRouting { + serviceResolver = aggregatorapiserver.NewEndpointServiceResolver( + informer.Core().V1().Services().Lister(), + informer.Core().V1().Endpoints().Lister(), + ) + } else { + serviceResolver = aggregatorapiserver.NewClusterIPServiceResolver( + informer.Core().V1().Services().Lister(), + ) } - return + // resolve kubernetes.default.svc locally + if localHost, err := url.Parse(hostname); err == nil { + serviceResolver = aggregatorapiserver.NewLoopbackServiceResolver(serviceResolver, localHost) + } + return serviceResolver } diff --git a/cmd/onex-cacheserver/app/server.go b/cmd/onex-cacheserver/app/server.go index bbafcfaaa10..0a843de88c3 100644 --- a/cmd/onex-cacheserver/app/server.go +++ b/cmd/onex-cacheserver/app/server.go @@ -21,9 +21,9 @@ Find more onex-cacheserver information at: https://github.com/superproj/onex/blob/master/docs/guide/en-US/cmd/onex-cacheserver.md` // NewApp creates an App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex cache server", + application := app.NewApp("onex-cacheserver", "Launch a onex cache server", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-cacheserver/main.go b/cmd/onex-cacheserver/main.go index 2db56638a14..b6299cce59c 100644 --- a/cmd/onex-cacheserver/main.go +++ b/cmd/onex-cacheserver/main.go @@ -9,11 +9,11 @@ package main import ( - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "github.com/superproj/onex/cmd/onex-cacheserver/app" ) func main() { - app.NewApp("onex-cacheserver").Run() + app.NewApp().Run() } diff --git a/cmd/onex-controller-manager/app/config/config.go b/cmd/onex-controller-manager/app/config/config.go index b36c28dcaf4..1286db8b96f 100644 --- a/cmd/onex-controller-manager/app/config/config.go +++ b/cmd/onex-controller-manager/app/config/config.go @@ -17,10 +17,11 @@ import ( type Config struct { ComponentConfig *ctrlmgrconfig.OneXControllerManagerConfiguration + // the general onex client + Client clientset.Interface + // the rest config for the master Kubeconfig *restclient.Config - - Client clientset.Interface } // CompletedConfig same as Config, just to swap private object. diff --git a/cmd/onex-controller-manager/app/controllermanager.go b/cmd/onex-controller-manager/app/controllermanager.go index df6592fb9f2..b88c31c3a4f 100644 --- a/cmd/onex-controller-manager/app/controllermanager.go +++ b/cmd/onex-controller-manager/app/controllermanager.go @@ -12,25 +12,43 @@ import ( "context" "fmt" "os" + "sort" + "time" "github.com/jinzhu/copier" "github.com/spf13/cobra" + apiv1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/selection" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" + genericapiserver "k8s.io/apiserver/pkg/server" utilfeature "k8s.io/apiserver/pkg/util/feature" + cacheddiscovery "k8s.io/client-go/discovery/cached" + "k8s.io/client-go/informers" "k8s.io/client-go/metadata" + "k8s.io/client-go/metadata/metadatainformer" restclient "k8s.io/client-go/rest" + "k8s.io/client-go/restmapper" cliflag "k8s.io/component-base/cli/flag" "k8s.io/component-base/cli/globalflag" + "k8s.io/component-base/configz" + "k8s.io/component-base/featuregate" "k8s.io/component-base/logs" logsapi "k8s.io/component-base/logs/api/v1" "k8s.io/component-base/metrics/features" + controllersmetrics "k8s.io/component-base/metrics/prometheus/controllers" "k8s.io/component-base/term" + genericcontrollermanager "k8s.io/controller-manager/app" + "k8s.io/controller-manager/pkg/clientbuilder" + "k8s.io/controller-manager/pkg/informerfactory" "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/controller/garbagecollector" "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" @@ -40,17 +58,15 @@ import ( ctrlmetrics "sigs.k8s.io/controller-runtime/pkg/metrics" "sigs.k8s.io/controller-runtime/pkg/webhook" - "github.com/superproj/onex/cmd/onex-controller-manager/app/cleaner" "github.com/superproj/onex/cmd/onex-controller-manager/app/config" "github.com/superproj/onex/cmd/onex-controller-manager/app/options" - onexcontroller "github.com/superproj/onex/internal/controller" + "github.com/superproj/onex/cmd/onex-controller-manager/names" configv1beta1 "github.com/superproj/onex/internal/controller/apis/config/v1beta1" "github.com/superproj/onex/internal/gateway/store" "github.com/superproj/onex/internal/pkg/metrics" "github.com/superproj/onex/internal/pkg/util/ratelimiter" "github.com/superproj/onex/internal/webhooks" v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - apiv1 "github.com/superproj/onex/pkg/apis/core/v1" "github.com/superproj/onex/pkg/db" "github.com/superproj/onex/pkg/record" "github.com/superproj/onex/pkg/version" @@ -71,6 +87,13 @@ func init() { // _ = corev1.AddToScheme(scheme) } +const ( + // ControllerStartJitter is the Jitter used when starting controller managers + ControllerStartJitter = 1.0 + // ConfigzName is the name used for register onex-controller manager /configz, same with GroupName. + ConfigzName = "onexcontrollermanager.config.onex.io" +) + // NewControllerManagerCommand creates a *cobra.Command object with default parameters. func NewControllerManagerCommand() *cobra.Command { o, err := options.NewOptions() @@ -112,11 +135,12 @@ current state towards the desired state.`, return err } - if err := o.Validate(); err != nil { + allControllers, disabledControllers, controllerAliases := KnownControllers(), DisabledControllers(), ControllerAliases() + if err := o.Validate(allControllers, disabledControllers, controllerAliases); err != nil { return err } - c, err := o.Config() + c, err := o.Config(allControllers, disabledControllers, controllerAliases) if err != nil { return err } @@ -128,7 +152,7 @@ current state towards the desired state.`, // add feature enablement metrics utilfeature.DefaultMutableFeatureGate.AddMetrics() - return Run(context.Background(), cc, wait.NeverStop) + return Run(genericapiserver.SetupSignalContext(), cc) }, Args: func(cmd *cobra.Command, args []string) error { for _, arg := range args { @@ -141,7 +165,7 @@ current state towards the desired state.`, } fs := cmd.Flags() - namedFlagSets := o.Flags() + namedFlagSets := o.Flags(KnownControllers(), DisabledControllers(), ControllerAliases()) version.AddFlags(namedFlagSets.FlagSet("global")) globalflag.AddGlobalFlags(namedFlagSets.FlagSet("global"), cmd.Name(), logs.SkipLoggingConfigurationFlags()) for _, f := range namedFlagSets.FlagSets { @@ -151,16 +175,28 @@ current state towards the desired state.`, cols, _, _ := term.TerminalSize(cmd.OutOrStdout()) cliflag.SetUsageAndHelpFunc(cmd, namedFlagSets, cols) + if err := cmd.MarkFlagFilename("config", "yaml", "yml", "json"); err != nil { + klog.Background().Error(err, "Failed to mark flag filename") + } + return cmd } // Run runs the controller manager options. This should never exit. -func Run(ctx context.Context, c *config.CompletedConfig, stopCh <-chan struct{}) error { +func Run(ctx context.Context, c *config.CompletedConfig) error { // To help debugging, immediately log version klog.InfoS("Starting controller manager", "version", version.Get().String()) klog.InfoS("Golang settings", "GOGC", os.Getenv("GOGC"), "GOMAXPROCS", os.Getenv("GOMAXPROCS"), "GOTRACEBACK", os.Getenv("GOTRACEBACK")) + // Store controller configs + cfgz, err := configz.New(ConfigzName) + if err != nil { + klog.ErrorS(err, "Unable to register configz") + return err + } + cfgz.Set(c.ComponentConfig) + // Do some initialization here var mysqlOptions db.MySQLOptions _ = copier.Copy(&mysqlOptions, c.ComponentConfig.Generic.MySQL) @@ -233,27 +269,89 @@ func Run(ctx context.Context, c *config.CompletedConfig, stopCh <-chan struct{}) // Initialize event recorder. record.InitFromRecorder(mgr.GetEventRecorderFor("onex-controller-manager")) - // setup resource cleaner controller - clean := newCleaner(mgr.GetClient(), storeClient, &cleaner.Miner{}, &cleaner.MinerSet{}, &cleaner.Chain{}) - if err := mgr.Add(clean); err != nil { - klog.ErrorS(err, "Unable to create resource cleaner", "controller", "ResourceCleaner") + // Start to register controllers. + clientBuilder, rootClientBuilder := createClientBuilders(c) + + cctx, err := CreateControllerContext(ctx, c, rootClientBuilder, clientBuilder, storeClient) + if err != nil { + klog.ErrorS(err, "Error building controller context") + return err + } + + if err := setupChecks(mgr); err != nil { return err } - setupChecks(mgr) + if err := addControllers(ctx, cctx, mgr, NewControllerDescriptors()); err != nil { + return err + } - setupReconcilers(ctx, c, storeClient, mgr) + cctx.InformerFactory.Start(ctx.Done()) + cctx.ObjectOrMetadataInformerFactory.Start(ctx.Done()) + close(cctx.InformersStarted) return mgr.Start(ctx) } -func setupChecks(mgr ctrl.Manager) { +func addControllers(ctx context.Context, cctx ControllerContext, mgr ctrl.Manager, controllerDescriptors map[string]*ControllerDescriptor) error { + // Each controller is passed a context where the logger has the name of + // the controller set through WithName. That name then becomes the prefix of + // of all log messages emitted by that controller. + for _, controllerDesc := range controllerDescriptors { + if controllerDesc.RequiresSpecialHandling() { + continue + } + + if err := addController(ctx, cctx, mgr, controllerDesc); err != nil { + return err + } + } + + return nil +} + +func addController(ctx context.Context, cctx ControllerContext, mgr ctrl.Manager, controllerDescriptor *ControllerDescriptor) error { + controllerName := controllerDescriptor.Name() + + for _, featureGate := range controllerDescriptor.GetRequiredFeatureGates() { + if !utilfeature.DefaultFeatureGate.Enabled(featureGate) { + klog.InfoS("Controller is disabled by a feature gate", "controller", controllerName, "requiredFeatureGates", controllerDescriptor.GetRequiredFeatureGates()) + return nil + } + } + + if !cctx.IsControllerEnabled(controllerDescriptor) { + klog.InfoS("Warning: controller is disabled", "controller", controllerName) + return nil + } + + klog.V(1).InfoS("Starting controller", "controller", controllerName) + + addFunc := controllerDescriptor.GetAddFunc() + enabled, err := addFunc(klog.NewContext(ctx, klog.LoggerWithName(klog.Background(), controllerName)), mgr, cctx) + if err != nil { + klog.ErrorS(err, "Error starting controller", "controller", controllerName) + return err + } + if !enabled { + klog.InfoS("Warning: skipping controller", "controller", controllerName) + return nil + } + + klog.InfoS("Register controller", "controller", controllerName) + + return nil +} + +func setupChecks(mgr ctrl.Manager) error { // add handlers if err := mgr.AddHealthzCheck("healthz", healthz.Ping); err != nil { - klog.Exitf("Unable to create health check: %v", err) + klog.ErrorS(err, "Unable to create health check") + return err } if err := mgr.AddReadyzCheck("readyz", healthz.Ping); err != nil { - klog.Exitf("Unable to create ready check: %v", err) + klog.ErrorS(err, "Unable to create ready check") + return err } /* @@ -265,52 +363,303 @@ func setupChecks(mgr ctrl.Manager) { klog.Exitf("Unable to create ready check: %v", err) } */ + return nil } -func setupReconcilers(ctx context.Context, c *config.CompletedConfig, storeClient store.IStore, mgr ctrl.Manager) { - // setup garbage collector controller - gc := &garbageCollector{completedConfig: c} - if err := mgr.Add(gc); err != nil { - klog.Exitf("Unable to create GarbageCollector controller: %v", err) +//nolint:unused +func setupWebhooks(mgr ctrl.Manager) { + if err := (&webhooks.Chain{}).SetupWebhookWithManager(mgr); err != nil { + klog.Exitf("Unable to create Chain webhook: %v", err) } +} - defaultOptions := controller.Options{ - MaxConcurrentReconciles: int(c.ComponentConfig.Generic.Parallelism), - RecoverPanic: ptr.To(true), - RateLimiter: ratelimiter.DefaultControllerRateLimiter(), +// ControllerContext defines the context object for controller +type ControllerContext struct { + // ClientBuilder will provide a client for this controller to use + ClientBuilder clientbuilder.ControllerClientBuilder + + // InformerFactory gives access to informers for the controller. + InformerFactory informers.SharedInformerFactory + + // ObjectOrMetadataInformerFactory gives access to informers for typed resources + // and dynamic resources by their metadata. All generic controllers currently use + // object metadata - if a future controller needs access to the full object this + // would become GenericInformerFactory and take a dynamic client. + ObjectOrMetadataInformerFactory informerfactory.InformerFactory + + // Config provides access to init options for a given controller + Config *config.CompletedConfig + + // DeferredDiscoveryRESTMapper is a RESTMapper that will defer + // initialization of the RESTMapper until the first mapping is + // requested. + RESTMapper *restmapper.DeferredDiscoveryRESTMapper + + // InformersStarted is closed after all of the controllers have been initialized and are running. After this point it is safe, + // for an individual controller to start the shared informers. Before it is closed, they should not. + InformersStarted chan struct{} + + // ResyncPeriod generates a duration each time it is invoked; this is so that + // multiple controllers don't get into lock-step and all hammer the apiserver + // with list requests simultaneously. + ResyncPeriod func() time.Duration + + // ControllerManagerMetrics provides a proxy to set controller manager specific metrics. + ControllerManagerMetrics *controllersmetrics.ControllerManagerMetrics + + // GraphBuilder gives an access to dependencyGraphBuilder which keeps tracks of resources in the cluster + GraphBuilder *garbagecollector.GraphBuilder + + // New by OneX + MetadataClient metadata.Interface + ControllerManagerOptions controller.Options + Store store.IStore +} + +// IsControllerEnabled checks if the context's controllers enabled or not +func (c ControllerContext) IsControllerEnabled(controllerDescriptor *ControllerDescriptor) bool { + controllersDisabledByDefault := sets.NewString() + if controllerDescriptor.IsDisabledByDefault() { + controllersDisabledByDefault.Insert(controllerDescriptor.Name()) } + return genericcontrollermanager.IsControllerEnabled(controllerDescriptor.Name(), controllersDisabledByDefault, c.Config.ComponentConfig.Generic.Controllers) +} - // setup chain controller - if err := (&onexcontroller.ChainReconciler{ - ComponentConfig: &c.ComponentConfig.ChainController, - WatchFilterValue: c.ComponentConfig.Generic.WatchFilterValue, - }).SetupWithManager(ctx, mgr, defaultOptions); err != nil { - klog.Exitf("Unable to create Chain controller: %v", err) +// AddFunc is used to launch a particular controller. It returns a controller +// that can optionally implement other interfaces so that the controller manager +// can support the requested features. +// The returned controller may be nil, which will be considered an anonymous controller +// that requests no additional features from the controller manager. +// Any error returned will cause the controller process to `Fatal` +// The bool indicates whether the controller was enabled. +type AddFunc func(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (enabled bool, err error) + +type ControllerDescriptor struct { + name string + addFunc AddFunc + requiredFeatureGates []featuregate.Feature + aliases []string + isDisabledByDefault bool + isCloudProviderController bool + requiresSpecialHandling bool +} + +func (r *ControllerDescriptor) Name() string { + return r.name +} + +func (r *ControllerDescriptor) GetAddFunc() AddFunc { + return r.addFunc +} + +func (r *ControllerDescriptor) GetRequiredFeatureGates() []featuregate.Feature { + return append([]featuregate.Feature(nil), r.requiredFeatureGates...) +} + +// GetAliases returns aliases to ensure backwards compatibility and should never be removed! +// Only addition of new aliases is allowed, and only when a canonical name is changed (please see CHANGE POLICY of controller names) +func (r *ControllerDescriptor) GetAliases() []string { + return append([]string(nil), r.aliases...) +} + +func (r *ControllerDescriptor) IsDisabledByDefault() bool { + return r.isDisabledByDefault +} + +func (r *ControllerDescriptor) IsCloudProviderController() bool { + return r.isCloudProviderController +} + +// RequiresSpecialHandling should return true only in a special non-generic controllers like ServiceAccountTokenController +func (r *ControllerDescriptor) RequiresSpecialHandling() bool { + return r.requiresSpecialHandling +} + +// KnownControllers returns all known controllers's name +func KnownControllers() []string { + return sets.StringKeySet(NewControllerDescriptors()).List() +} + +// ControllerAliases returns a mapping of aliases to canonical controller names +func ControllerAliases() map[string]string { + aliases := map[string]string{} + for name, c := range NewControllerDescriptors() { + for _, alias := range c.GetAliases() { + aliases[alias] = name + } } + return aliases +} + +func DisabledControllers() []string { + var controllersDisabledByDefault []string - // setup sync controller - if err := (&onexcontroller.SyncReconciler{ - Store: storeClient, - }).SetupWithManager(ctx, mgr, defaultOptions); err != nil { - klog.Exitf("Unable to create Sync controller: %v", err) + for name, c := range NewControllerDescriptors() { + if c.IsDisabledByDefault() { + controllersDisabledByDefault = append(controllersDisabledByDefault, name) + } } - metadataClient, err := metadata.NewForConfig(c.Kubeconfig) - if err != nil { - klog.Exitf("Failed to create metadata client: %v", err) + sort.Strings(controllersDisabledByDefault) + + return controllersDisabledByDefault +} + +// NewControllerDescriptors is a public map of named controller groups (you can start more than one in an init func) +// paired to their ControllerDescriptor wrapper object that includes InitFunc. +// This allows for structured downstream composition and subdivision. +func NewControllerDescriptors() map[string]*ControllerDescriptor { + controllers := map[string]*ControllerDescriptor{} + aliases := sets.NewString() + + // All the controllers must fulfil common constraints, or else we will explode. + register := func(controllerDesc *ControllerDescriptor) { + if controllerDesc == nil { + panic("received nil controller for a registration") + } + name := controllerDesc.Name() + if len(name) == 0 { + panic("received controller without a name for a registration") + } + if _, found := controllers[name]; found { + panic(fmt.Sprintf("controller name %q was registered twice", name)) + } + if controllerDesc.GetAddFunc() == nil { + panic(fmt.Sprintf("controller %q does not have an init function", name)) + } + + for _, alias := range controllerDesc.GetAliases() { + if aliases.Has(alias) { + panic(fmt.Sprintf("controller %q has a duplicate alias %q", name, alias)) + } + aliases.Insert(alias) + } + + controllers[name] = controllerDesc } - if err := (&onexcontroller.NamespacedResourcesDeleterReconciler{ - Client: c.Client, - MetadataClient: metadataClient, - }).SetupWithManager(ctx, mgr, defaultOptions); err != nil { - klog.Exitf("Unable to create Namespace controller: %v", err) + // First add "special" controllers that aren't initialized normally. These controllers cannot be initialized + // in the main controller loop initialization, so we add them here only for the metadata and duplication detection. + // app.ControllerDescriptor#RequiresSpecialHandling should return true for such controllers + // The only known special case is the ServiceAccountTokenController which *must* be started + // first to ensure that the SA tokens for future controllers will exist. Think very carefully before adding new + // special controllers. + register(newGarbageCollectorControllerDescriptor()) + register(newNamespacedResourcesDeleterControllerDescriptor()) + register(newChainControllerDescriptor()) + register(newChainSyncControllerDescriptor()) + register(newMinerSetSyncControllerDescriptor()) + register(newMinerSyncControllerDescriptor()) + + for _, alias := range aliases.UnsortedList() { + if _, ok := controllers[alias]; ok { + panic(fmt.Sprintf("alias %q conflicts with a controller name", alias)) + } } + + return controllers } -//nolint:unused -func setupWebhooks(mgr ctrl.Manager) { - if err := (&webhooks.Chain{}).SetupWebhookWithManager(mgr); err != nil { - klog.Exitf("Unable to create Chain webhook: %v", err) +// CreateControllerContext creates a context struct containing references to resources needed by the +// controllers such as clientBuilder. rootClientBuilder is only used for +// the shared-informers client. +func CreateControllerContext( + ctx context.Context, + s *config.CompletedConfig, + rootClientBuilder clientbuilder.ControllerClientBuilder, + clientBuilder clientbuilder.ControllerClientBuilder, + storeClient store.IStore, +) (ControllerContext, error) { + // Informer transform to trim ManagedFields for memory efficiency. + trim := func(obj interface{}) (interface{}, error) { + if accessor, err := meta.Accessor(obj); err == nil { + if accessor.GetManagedFields() != nil { + accessor.SetManagedFields(nil) + } + } + return obj, nil + } + + // In this case, we are using Kubernetes informers because the HTTP request paths and parameters + // are ultimately the same, and the onex-apiserver can still handle the requests correctly. + versionedClient := rootClientBuilder.ClientOrDie("shared-informers") + sharedInformers := informers.NewSharedInformerFactoryWithOptions(versionedClient, ResyncPeriod(s)(), informers.WithTransform(trim)) + + metadataClient := metadata.NewForConfigOrDie(rootClientBuilder.ConfigOrDie("metadata-informers")) + metadataInformers := metadatainformer.NewSharedInformerFactoryWithOptions(metadataClient, ResyncPeriod(s)(), metadatainformer.WithTransform(trim)) + + // If apiserver is not running we should wait for some time and fail only then. This is particularly + // important when we start apiserver and controller manager at the same time. + if err := genericcontrollermanager.WaitForAPIServer(versionedClient, 10*time.Second); err != nil { + return ControllerContext{}, fmt.Errorf("failed to wait for apiserver being healthy: %w", err) + } + + // Use a discovery client capable of being refreshed. + discoveryClient := rootClientBuilder.DiscoveryClientOrDie("controller-discovery") + cachedClient := cacheddiscovery.NewMemCacheClient(discoveryClient) + restMapper := restmapper.NewDeferredDiscoveryRESTMapper(cachedClient) + go wait.Until(func() { + restMapper.Reset() + }, 30*time.Second, ctx.Done()) + + cctx := ControllerContext{ + ClientBuilder: clientBuilder, + InformerFactory: sharedInformers, + ObjectOrMetadataInformerFactory: informerfactory.NewInformerFactory(sharedInformers, metadataInformers), + Config: s, + RESTMapper: restMapper, + InformersStarted: make(chan struct{}), + ResyncPeriod: ResyncPeriod(s), + ControllerManagerMetrics: controllersmetrics.NewControllerManagerMetrics("onex-controller-manager"), + MetadataClient: metadataClient, + Store: storeClient, + } + + if cctx.Config.ComponentConfig.GarbageCollectorController.EnableGarbageCollector && + cctx.IsControllerEnabled(NewControllerDescriptors()[names.GarbageCollectorController]) { + ignoredResources := make(map[schema.GroupResource]struct{}) + for _, r := range cctx.Config.ComponentConfig.GarbageCollectorController.GCIgnoredResources { + ignoredResources[schema.GroupResource{Group: r.Group, Resource: r.Resource}] = struct{}{} + } + + cctx.GraphBuilder = garbagecollector.NewDependencyGraphBuilder( + ctx, + metadataClient, + cctx.RESTMapper, + ignoredResources, + cctx.ObjectOrMetadataInformerFactory, + cctx.InformersStarted, + ) + } + + // Added by OneX + cctx.ControllerManagerOptions = controller.Options{ + MaxConcurrentReconciles: int(s.ComponentConfig.Generic.Parallelism), + RecoverPanic: ptr.To(true), + RateLimiter: ratelimiter.DefaultControllerRateLimiter(), + } + + controllersmetrics.Register() + return cctx, nil +} + +// createClientBuilders creates clientBuilder and rootClientBuilder from the given configuration. +func createClientBuilders(c *config.CompletedConfig) (clientBuilder clientbuilder.ControllerClientBuilder, rootClientBuilder clientbuilder.ControllerClientBuilder) { + rootClientBuilder = clientbuilder.SimpleControllerClientBuilder{ + ClientConfig: c.Kubeconfig, + } + + clientBuilder = rootClientBuilder + return +} + +// ResyncPeriod returns a function which generates a duration each time it is +// invoked; this is so that multiple controllers don't get into lock-step and all +// hammer the apiserver with list requests simultaneously. +func ResyncPeriod(c *config.CompletedConfig) func() time.Duration { + return func() time.Duration { + // factor := rand.Float64() + 1 + // return time.Duration(float64(c.MinResyncPeriod.Nanoseconds()) * factor) // TODO? + return 1 * time.Second } } diff --git a/cmd/onex-controller-manager/app/core.go b/cmd/onex-controller-manager/app/core.go new file mode 100644 index 00000000000..146b79a6235 --- /dev/null +++ b/cmd/onex-controller-manager/app/core.go @@ -0,0 +1,173 @@ +package app + +import ( + "context" + "fmt" + "time" + + "k8s.io/client-go/metadata" + "k8s.io/kubernetes/pkg/controller/garbagecollector" + ctrl "sigs.k8s.io/controller-runtime" + + "github.com/superproj/onex/cmd/onex-controller-manager/names" + chaincontroller "github.com/superproj/onex/internal/controller/chain" + namespacecontroller "github.com/superproj/onex/internal/controller/namespace" + resourcecleancontroller "github.com/superproj/onex/internal/controller/resourceclean" + synccontroller "github.com/superproj/onex/internal/controller/sync" +) + +func newGarbageCollectorControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.GarbageCollectorController, + aliases: []string{"garbagecollector"}, + addFunc: addGarbageCollectorController, + } +} + +func newNamespacedResourcesDeleterControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.NamespacedResourcesDeleterController, + aliases: []string{"namespaced-resource-deleter"}, + addFunc: addNamespacedResourcesDeleterController, + } +} + +func newChainControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.ChainController, + aliases: []string{"chain"}, + addFunc: addChainController, + } +} + +func newChainSyncControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.ChainController, + aliases: []string{"chain-sync"}, + addFunc: addChainSyncController, + } +} + +func newMinerSetSyncControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.ChainController, + aliases: []string{"minerset-sync"}, + addFunc: addMinerSetSyncController, + } +} + +func newMinerSyncControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.ChainController, + aliases: []string{"minerset-sync"}, + addFunc: addMinerSyncController, + } +} + +func newResourceCleanControllerDescriptor() *ControllerDescriptor { + return &ControllerDescriptor{ + name: names.ResourceCleanController, + aliases: []string{"resource-clean"}, + addFunc: addResourceCleanController, + } +} + +// add functions +func addNamespacedResourcesDeleterController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + return true, namespacecontroller.NewNamespacedResourcesDeleter(mgr, cctx.Config.Client, cctx.MetadataClient). + SetupWithManager(mgr, cctx.ControllerManagerOptions) +} + +func addChainController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + return true, (&chaincontroller.Reconciler{ + ComponentConfig: &cctx.Config.ComponentConfig.ChainController, + WatchFilterValue: cctx.Config.ComponentConfig.Generic.WatchFilterValue, + }).SetupWithManager(ctx, mgr, cctx.ControllerManagerOptions) +} + +func addChainSyncController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + return true, (&synccontroller.ChainSyncReconciler{ + Store: cctx.Store, + }).SetupWithManager(ctx, mgr, cctx.ControllerManagerOptions) +} + +func addMinerSetSyncController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + return true, (&synccontroller.MinerSetSyncReconciler{ + Store: cctx.Store, + }).SetupWithManager(ctx, mgr, cctx.ControllerManagerOptions) +} + +func addMinerSyncController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + return true, (&synccontroller.MinerSyncReconciler{ + Store: cctx.Store, + }).SetupWithManager(ctx, mgr, cctx.ControllerManagerOptions) +} + +func addResourceCleanController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + mgr.Add(resourcecleancontroller.NewCleanReconciler( + mgr.GetClient(), + cctx.Store, + &resourcecleancontroller.Miner{}, + &resourcecleancontroller.MinerSet{}, + &resourcecleancontroller.Chain{}, + )) + + return true, nil +} + +// garbageCollector used to defines a garbage collector controller. +type garbageCollector struct { + cctx ControllerContext +} + +// Start implement manager.Runnable interface. +func (gc *garbageCollector) Start(ctx context.Context) error { + if _, err := startGarbageCollectorController(ctx, gc.cctx); err != nil { + return err + } + + return nil +} + +func addGarbageCollectorController(ctx context.Context, mgr ctrl.Manager, cctx ControllerContext) (bool, error) { + return true, mgr.Add(&garbageCollector{cctx}) +} + +func startGarbageCollectorController(ctx context.Context, cctx ControllerContext) (bool, error) { + if !cctx.Config.ComponentConfig.GarbageCollectorController.EnableGarbageCollector { + return false, nil + } + + gcClientset := cctx.ClientBuilder.ClientOrDie("generic-garbage-collector") + discoveryClient := cctx.ClientBuilder.DiscoveryClientOrDie("generic-garbage-collector") + + config := cctx.ClientBuilder.ConfigOrDie("generic-garbage-collector") + // Increase garbage collector controller's throughput: each object deletion takes two API calls, + // so to get |config.QPS| deletion rate we need to allow 2x more requests for this controller. + config.QPS *= 2 + metadataClient, err := metadata.NewForConfig(config) + if err != nil { + return true, err + } + + garbageCollector, err := garbagecollector.NewComposedGarbageCollector( + ctx, + gcClientset, + metadataClient, + cctx.RESTMapper, + cctx.GraphBuilder, + ) + if err != nil { + return true, fmt.Errorf("failed to start the generic garbage collector: %w", err) + } + + // Start the garbage collector. + workers := int(cctx.Config.ComponentConfig.GarbageCollectorController.ConcurrentGCSyncs) + go garbageCollector.Run(ctx, workers) + + // Periodically refresh the RESTMapper with new discovery information and sync + // the garbage collector. + go garbageCollector.Sync(ctx, discoveryClient, 30*time.Second) + + return true, nil +} diff --git a/cmd/onex-controller-manager/app/garbagecollector.go b/cmd/onex-controller-manager/app/garbagecollector.go deleted file mode 100644 index 1d6344e3c89..00000000000 --- a/cmd/onex-controller-manager/app/garbagecollector.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package app - -import ( - "context" - "fmt" - "time" - - "k8s.io/apimachinery/pkg/runtime/schema" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" - cacheddiscovery "k8s.io/client-go/discovery/cached" - "k8s.io/client-go/informers" - "k8s.io/client-go/metadata" - "k8s.io/client-go/metadata/metadatainformer" - "k8s.io/client-go/restmapper" - genericcontrollermanager "k8s.io/controller-manager/app" - "k8s.io/controller-manager/pkg/clientbuilder" - "k8s.io/controller-manager/pkg/informerfactory" - "k8s.io/klog/v2" - "k8s.io/kubernetes/pkg/controller/garbagecollector" - - // "github.com/superproj/onex/internal/admission/plugin/cluster". - - "github.com/superproj/onex/cmd/onex-controller-manager/app/config" - ctrlmgrconfig "github.com/superproj/onex/internal/controller/apis/config" -) - -type garbageCollector struct { - completedConfig *config.CompletedConfig -} - -// ControllerContext defines the context object for controller. -type ControllerContext struct { - // ClientBuilder will provide a client for this controller to use - ClientBuilder clientbuilder.ControllerClientBuilder - - // InformerFactory gives access to informers for the controller. - InformerFactory informers.SharedInformerFactory - - // ObjectOrMetadataInformerFactory gives access to informers for typed resources - // and dynamic resources by their metadata. All generic controllers currently use - // object metadata - if a future controller needs access to the full object this - // would become GenericInformerFactory and take a dynamic client. - ObjectOrMetadataInformerFactory informerfactory.InformerFactory - - // DeferredDiscoveryRESTMapper is a RESTMapper that will defer - // initialization of the RESTMapper until the first mapping is - // requested. - RESTMapper *restmapper.DeferredDiscoveryRESTMapper - - // AvailableResources is a map listing currently available resources - AvailableResources map[schema.GroupVersionResource]bool - - // InformersStarted is closed after all of the controllers have been initialized and are running. After this point it is safe, - // for an individual controller to start the shared informers. Before it is closed, they should not. - InformersStarted chan struct{} - - // ResyncPeriod generates a duration each time it is invoked; this is so that - // multiple controllers don't get into lock-step and all hammer the apiserver - // with list requests simultaneously. - ResyncPeriod func() time.Duration - - // ComponentConfig provides access to init options for a given controller - ComponentConfig *ctrlmgrconfig.OneXControllerManagerConfiguration -} - -func (gc *garbageCollector) Start(ctx context.Context) error { - clientBuilder, rootClientBuilder := createClientBuilders(gc.completedConfig) - context, err := CreateControllerContext(gc.completedConfig, rootClientBuilder, clientBuilder, ctx.Done()) - if err != nil { - klog.Fatalf("error building controller context: %v", err) - } - if _, err := startGarbageCollectorController(ctx, context); err != nil { - return err - } - context.InformerFactory.Start(ctx.Done()) - context.ObjectOrMetadataInformerFactory.Start(ctx.Done()) - close(context.InformersStarted) - <-ctx.Done() - return nil -} - -// CreateControllerContext creates a context struct containing references to resources needed by the -// controllers such as clientBuilder. rootClientBuilder is only used for -// the shared-informers client. -func CreateControllerContext(s *config.CompletedConfig, rootClientBuilder, clientBuilder clientbuilder.ControllerClientBuilder, stop <-chan struct{}) (ControllerContext, error) { - versionedClient := rootClientBuilder.ClientOrDie("shared-informers") - sharedInformers := informers.NewSharedInformerFactory(versionedClient, ResyncPeriod(s)()) - - metadataClient := metadata.NewForConfigOrDie(rootClientBuilder.ConfigOrDie("metadata-informers")) - metadataInformers := metadatainformer.NewSharedInformerFactory(metadataClient, ResyncPeriod(s)()) - - // If apiserver is not running we should wait for some time and fail only then. This is particularly - // important when we start apiserver and controller manager at the same time. - if err := genericcontrollermanager.WaitForAPIServer(versionedClient, 10*time.Second); err != nil { - return ControllerContext{}, fmt.Errorf("failed to wait for apiserver being healthy: %w", err) - } - - // Use a discovery client capable of being refreshed. - discoveryClient := rootClientBuilder.DiscoveryClientOrDie("controller-discovery") - cachedClient := cacheddiscovery.NewMemCacheClient(discoveryClient) - restMapper := restmapper.NewDeferredDiscoveryRESTMapper(cachedClient) - go wait.Until(func() { - restMapper.Reset() - }, 30*time.Second, stop) - - availableResources, err := GetAvailableResources(rootClientBuilder) - if err != nil { - return ControllerContext{}, err - } - - ctx := ControllerContext{ - ClientBuilder: clientBuilder, - InformerFactory: sharedInformers, - ObjectOrMetadataInformerFactory: informerfactory.NewInformerFactory(sharedInformers, metadataInformers), - ComponentConfig: s.ComponentConfig, - RESTMapper: restMapper, - AvailableResources: availableResources, - InformersStarted: make(chan struct{}), - ResyncPeriod: ResyncPeriod(s), - } - return ctx, nil -} - -func startGarbageCollectorController(ctx context.Context, controllerContext ControllerContext) (bool, error) { - if !controllerContext.ComponentConfig.GarbageCollectorController.EnableGarbageCollector { - return false, nil - } - - gcClientset := controllerContext.ClientBuilder.ClientOrDie("generic-garbage-collector") - discoveryClient := controllerContext.ClientBuilder.DiscoveryClientOrDie("generic-garbage-collector") - - config := controllerContext.ClientBuilder.ConfigOrDie("generic-garbage-collector") - // Increase garbage collector controller's throughput: each object deletion takes two API calls, - // so to get |config.QPS| deletion rate we need to allow 2x more requests for this controller. - config.QPS *= 2 - metadataClient, err := metadata.NewForConfig(config) - if err != nil { - return true, err - } - - ignoredResources := make(map[schema.GroupResource]struct{}) - for _, r := range controllerContext.ComponentConfig.GarbageCollectorController.GCIgnoredResources { - ignoredResources[schema.GroupResource{Group: r.Group, Resource: r.Resource}] = struct{}{} - } - garbageCollector, err := garbagecollector.NewGarbageCollector( - gcClientset, - metadataClient, - controllerContext.RESTMapper, - ignoredResources, - controllerContext.ObjectOrMetadataInformerFactory, - controllerContext.InformersStarted, - ) - if err != nil { - return true, fmt.Errorf("failed to start the generic garbage collector: %w", err) - } - - // Start the garbage collector. - workers := int(controllerContext.ComponentConfig.GarbageCollectorController.ConcurrentGCSyncs) - go garbageCollector.Run(ctx, workers) - - // Periodically refresh the RESTMapper with new discovery information and sync - // the garbage collector. - go garbageCollector.Sync(ctx, discoveryClient, 30*time.Second) - - return true, nil -} - -// createClientBuilders creates clientBuilder and rootClientBuilder from the given configuration. -func createClientBuilders(c *config.CompletedConfig) (clientBuilder clientbuilder.ControllerClientBuilder, rootClientBuilder clientbuilder.ControllerClientBuilder) { - rootClientBuilder = clientbuilder.SimpleControllerClientBuilder{ - ClientConfig: c.Kubeconfig, - } - - clientBuilder = rootClientBuilder - return -} - -// ResyncPeriod returns a function which generates a duration each time it is -// invoked; this is so that multiple controllers don't get into lock-step and all -// hammer the apiserver with list requests simultaneously. -func ResyncPeriod(c *config.CompletedConfig) func() time.Duration { - return func() time.Duration { - // factor := rand.Float64() + 1 - // return time.Duration(float64(c.MinResyncPeriod.Nanoseconds()) * factor) // TODO? - return 1 * time.Second - } -} - -// GetAvailableResources gets the map which contains all available resources of the apiserver -// TODO: In general, any controller checking this needs to be dynamic so -// users don't have to restart their controller manager if they change the apiserver. -// Until we get there, the structure here needs to be exposed for the construction of a proper ControllerContext. -func GetAvailableResources(clientBuilder clientbuilder.ControllerClientBuilder) (map[schema.GroupVersionResource]bool, error) { - client := clientBuilder.ClientOrDie("controller-discovery") - discoveryClient := client.Discovery() - _, resourceMap, err := discoveryClient.ServerGroupsAndResources() - if err != nil { - utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %w", err)) - } - if len(resourceMap) == 0 { - return nil, fmt.Errorf("unable to get any supported resources from server") - } - - allResources := map[schema.GroupVersionResource]bool{} - for _, apiResourceList := range resourceMap { - version, err := schema.ParseGroupVersion(apiResourceList.GroupVersion) - if err != nil { - return nil, err - } - for _, apiResource := range apiResourceList.APIResources { - allResources[version.WithResource(apiResource.Name)] = true - } - } - - return allResources, nil -} diff --git a/cmd/onex-controller-manager/app/options/chaincontroller.go b/cmd/onex-controller-manager/app/options/chaincontroller.go index dd4fb6fa8f9..848d59e02ea 100644 --- a/cmd/onex-controller-manager/app/options/chaincontroller.go +++ b/cmd/onex-controller-manager/app/options/chaincontroller.go @@ -17,6 +17,12 @@ type ChainControllerOptions struct { *chainconfig.ChainControllerConfiguration } +func NewChainControllerOptions(cfg *chainconfig.ChainControllerConfiguration) *ChainControllerOptions { + return &ChainControllerOptions{ + ChainControllerConfiguration: cfg, + } +} + // AddFlags adds flags related to ChainController for controller manager to the specified FlagSet. func (o *ChainControllerOptions) AddFlags(fs *pflag.FlagSet) { if o == nil { @@ -27,3 +33,24 @@ func (o *ChainControllerOptions) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&o.Image, "node-image", o.Image, "The blockchain node image used by default."+ "This parameter is ignored if a config file is specified by --config.") } + +// ApplyTo fills up ChainControllerOptions config with options. +func (o *ChainControllerOptions) ApplyTo(cfg *chainconfig.ChainControllerConfiguration) error { + if o == nil { + return nil + } + + cfg.Image = o.Image + + return nil +} + +// Validate checks validation of GarbageCollectorController. +func (o *ChainControllerOptions) Validate() []error { + if o == nil { + return nil + } + + errs := []error{} + return errs +} diff --git a/cmd/onex-controller-manager/app/options/garbagecollectorcontroller.go b/cmd/onex-controller-manager/app/options/garbagecollectorcontroller.go index 52b61025df7..42523ed5432 100644 --- a/cmd/onex-controller-manager/app/options/garbagecollectorcontroller.go +++ b/cmd/onex-controller-manager/app/options/garbagecollectorcontroller.go @@ -17,6 +17,12 @@ type GarbageCollectorControllerOptions struct { *garbagecollectorconfig.GarbageCollectorControllerConfiguration } +func NewGarbageCollectorControllerOptions(cfg *garbagecollectorconfig.GarbageCollectorControllerConfiguration) *GarbageCollectorControllerOptions { + return &GarbageCollectorControllerOptions{ + GarbageCollectorControllerConfiguration: cfg, + } +} + // AddFlags adds flags related to GarbageCollectorController for controller manager to the specified FlagSet. func (o *GarbageCollectorControllerOptions) AddFlags(fs *pflag.FlagSet) { if o == nil { @@ -28,3 +34,26 @@ func (o *GarbageCollectorControllerOptions) AddFlags(fs *pflag.FlagSet) { fs.BoolVar(&o.EnableGarbageCollector, "enable-garbage-collector", o.EnableGarbageCollector, "Enables the generic garbage collector. MUST be synced with "+ "the corresponding flag of the kube-apiserver. This parameter is ignored if a config file is specified by --config.") } + +// ApplyTo fills up GarbageCollectorController config with options. +func (o *GarbageCollectorControllerOptions) ApplyTo(cfg *garbagecollectorconfig.GarbageCollectorControllerConfiguration) error { + if o == nil { + return nil + } + + cfg.EnableGarbageCollector = o.EnableGarbageCollector + cfg.ConcurrentGCSyncs = o.ConcurrentGCSyncs + cfg.GCIgnoredResources = o.GCIgnoredResources + + return nil +} + +// Validate checks validation of GarbageCollectorController. +func (o *GarbageCollectorControllerOptions) Validate() []error { + if o == nil { + return nil + } + + errs := []error{} + return errs +} diff --git a/cmd/onex-controller-manager/app/options/generic.go b/cmd/onex-controller-manager/app/options/generic.go index d73fa980bf4..a55794c1a24 100644 --- a/cmd/onex-controller-manager/app/options/generic.go +++ b/cmd/onex-controller-manager/app/options/generic.go @@ -7,9 +7,12 @@ package options import ( + "fmt" + "k8s.io/apimachinery/pkg/util/sets" cliflag "k8s.io/component-base/cli/flag" "k8s.io/component-base/config/options" utilflag "k8s.io/kubernetes/pkg/util/flag" + "strings" cmconfig "github.com/superproj/onex/internal/controller/apis/config" cmoptions "github.com/superproj/onex/pkg/config/options" @@ -20,8 +23,19 @@ type GenericControllerManagerConfigurationOptions struct { *cmconfig.GenericControllerManagerConfiguration } +func NewGenericControllerManagerConfigurationOptions(cfg *cmconfig.GenericControllerManagerConfiguration) *GenericControllerManagerConfigurationOptions { + return &GenericControllerManagerConfigurationOptions{ + GenericControllerManagerConfiguration: cfg, + } +} + // AddFlags adds flags related to ChainController for controller manager to the specified FlagSet. -func (o *GenericControllerManagerConfigurationOptions) AddFlags(fss *cliflag.NamedFlagSets) { +func (o *GenericControllerManagerConfigurationOptions) AddFlags( + fss *cliflag.NamedFlagSets, + allControllers []string, + disabledControllers []string, + controllerAliasesmap map[string]string, +) { if o == nil { return } @@ -51,4 +65,59 @@ func (o *GenericControllerManagerConfigurationOptions) AddFlags(fss *cliflag.Nam "This parameter is ignored if a config file is specified by --config.") genericfs.StringVar(&o.WatchFilterValue, "watch-filter-value", o.WatchFilterValue, "The label value used to filter events prior to reconciliation."+ "This parameter is ignored if a config file is specified by --config.") + genericfs.StringSliceVar(&o.Controllers, "controllers", o.Controllers, fmt.Sprintf(""+ + "A list of controllers to enable. '*' enables all on-by-default controllers, 'foo' enables the controller "+ + "named 'foo', '-foo' disables the controller named 'foo'.\nAll controllers: %s\nDisabled-by-default controllers: %s", + strings.Join(allControllers, ", "), strings.Join(disabledControllers, ", "))) +} + +func (o *GenericControllerManagerConfigurationOptions) ApplyTo( + cfg *cmconfig.GenericControllerManagerConfiguration, + allControllers []string, + disabledControllers []string, + controllerAliases map[string]string, +) error { + *cfg = *o.GenericControllerManagerConfiguration + + // copy controller names and replace aliases with canonical names + cfg.Controllers = make([]string, len(o.Controllers)) + for i, initialName := range o.Controllers { + initialNameWithoutPrefix := strings.TrimPrefix(initialName, "-") + controllerName := initialNameWithoutPrefix + if canonicalName, ok := controllerAliases[controllerName]; ok { + controllerName = canonicalName + } + if strings.HasPrefix(initialName, "-") { + controllerName = fmt.Sprintf("-%s", controllerName) + } + cfg.Controllers[i] = controllerName + } + + return nil +} + +// Validate checks validation of GenericControllerManagerConfigurationOptions. +func (o *GenericControllerManagerConfigurationOptions) Validate(allControllers []string, disabledControllers []string, controllerAliases map[string]string) []error { + if o == nil { + return nil + } + + errs := []error{} + + allControllersSet := sets.NewString(allControllers...) + for _, initialName := range o.Controllers { + if initialName == "*" { + continue + } + initialNameWithoutPrefix := strings.TrimPrefix(initialName, "-") + controllerName := initialNameWithoutPrefix + if canonicalName, ok := controllerAliases[controllerName]; ok { + controllerName = canonicalName + } + if !allControllersSet.Has(controllerName) { + errs = append(errs, fmt.Errorf("%q is not in the list of known controllers", initialNameWithoutPrefix)) + } + } + + return errs } diff --git a/cmd/onex-controller-manager/app/options/options.go b/cmd/onex-controller-manager/app/options/options.go index 839179e19f8..cf41018d550 100644 --- a/cmd/onex-controller-manager/app/options/options.go +++ b/cmd/onex-controller-manager/app/options/options.go @@ -14,12 +14,13 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/component-base/logs" logsapi "k8s.io/component-base/logs/api/v1" + "k8s.io/component-base/metrics" "k8s.io/kubernetes/pkg/controller/garbagecollector" controllermanagerconfig "github.com/superproj/onex/cmd/onex-controller-manager/app/config" + "github.com/superproj/onex/cmd/onex-controller-manager/names" ctrlmgrconfig "github.com/superproj/onex/internal/controller/apis/config" "github.com/superproj/onex/internal/controller/apis/config/latest" - "github.com/superproj/onex/internal/controller/apis/config/validation" clientcmdutil "github.com/superproj/onex/internal/pkg/util/clientcmd" kubeutil "github.com/superproj/onex/internal/pkg/util/kube" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" @@ -32,181 +33,120 @@ const ( // Options is the main context object for the onex-controller manager. type Options struct { + Generic *GenericControllerManagerConfigurationOptions + GarbageCollectorController *GarbageCollectorControllerOptions + ChainController *ChainControllerOptions + //NamespaceController *NamespaceControllerOptions + // ConfigFile is the location of the miner controller server's configuration file. ConfigFile string // WriteConfigTo is the path where the default configuration will be written. WriteConfigTo string - // Generic *GenericControllerManagerConfigurationOptions - // GarbageCollectorController *GarbageCollectorControllerOptions - // ChainController *ChainControllerOptions - // NamespaceController *NamespaceControllerOptions - // The address of the Kubernetes API server (overrides any value in kubeconfig). Master string // Path to kubeconfig file with authorization and master location information. Kubeconfig string + Metrics *metrics.Options Logs *logs.Options // config is the onex controller manager server's configuration object. // The default values. - config *ctrlmgrconfig.OneXControllerManagerConfiguration + //config *ctrlmgrconfig.OneXControllerManagerConfiguration } // NewOptions creates a new Options with a default config. func NewOptions() (*Options, error) { - defaultComponentConfig, err := latest.Default() + componentConfig, err := latest.Default() if err != nil { return nil, err } o := Options{ - Kubeconfig: clientcmdutil.DefaultKubeconfig(), - Logs: logs.NewOptions(), - config: defaultComponentConfig, - /* - Cloud: cloud.NewCloudOptions(), - Concurrency: 1, - Logs: logs.NewOptions(), - Metrics: metrics.NewOptions(), - MetricsBindAddress: metrics.DefaultMetricsAddress, - HealthAddr: ":9441", - LeaderElection: componentbaseconfig.LeaderElectionConfiguration{ - LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, - RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, - RetryPeriod: metav1.Duration{Duration: 2 * time.Second}, - LeaderElect: true, - ResourceName: "onex-controller-manager", - ResourceNamespace: "kube-system", - }, - */ + Generic: NewGenericControllerManagerConfigurationOptions(&componentConfig.Generic), + GarbageCollectorController: NewGarbageCollectorControllerOptions(&componentConfig.GarbageCollectorController), + ChainController: NewChainControllerOptions(&componentConfig.ChainController), + Kubeconfig: clientcmdutil.DefaultKubeconfig(), + Metrics: metrics.NewOptions(), + Logs: logs.NewOptions(), + //config: componentConfig, } gcIgnoredResources := make([]ctrlmgrconfig.GroupResource, 0, len(garbagecollector.DefaultIgnoredResources())) for r := range garbagecollector.DefaultIgnoredResources() { gcIgnoredResources = append(gcIgnoredResources, ctrlmgrconfig.GroupResource{Group: r.Group, Resource: r.Resource}) } - o.config.GarbageCollectorController.GCIgnoredResources = gcIgnoredResources - o.config.Generic.LeaderElection.ResourceName = "onex-controller-manager" - o.config.Generic.LeaderElection.ResourceNamespace = "kube-system" + o.GarbageCollectorController.GCIgnoredResources = gcIgnoredResources + o.Generic.LeaderElection.ResourceName = "onex-controller-manager" + o.Generic.LeaderElection.ResourceNamespace = "kube-system" return &o, nil } -// Complete completes all the required options. -func (o *Options) Complete() error { - if len(o.ConfigFile) == 0 { - // If the --config arg is not specified, honor the deprecated as well as leader election CLI args. - o.ApplyDeprecated() - o.ApplyLeaderElectionTo(o.config) - } else { - cfg, err := LoadConfigFromFile(o.ConfigFile) - if err != nil { - return err - } - // If the --config arg is specified, honor the leader election CLI args only. - o.ApplyLeaderElectionTo(cfg) - o.config = cfg - } - - return utilfeature.DefaultMutableFeatureGate.SetFromMap(o.config.FeatureGates) -} - // Flags returns flags for a specific APIServer by section name. -func (o *Options) Flags() (fss cliflag.NamedFlagSets) { - (&GenericControllerManagerConfigurationOptions{&o.config.Generic}).AddFlags(&fss) - (&GarbageCollectorControllerOptions{&o.config.GarbageCollectorController}).AddFlags(fss.FlagSet("garbage collector controller")) - (&ChainControllerOptions{&o.config.ChainController}).AddFlags(fss.FlagSet("chain controller")) +func (o *Options) Flags(allControllers []string, disabledControllers []string, controllerAliases map[string]string) cliflag.NamedFlagSets { + fss := cliflag.NamedFlagSets{} + o.Generic.AddFlags(&fss, allControllers, disabledControllers, controllerAliases) + o.ChainController.AddFlags(fss.FlagSet(names.ChainController)) + o.GarbageCollectorController.AddFlags(fss.FlagSet(names.GarbageCollectorController)) + + o.Metrics.AddFlags(fss.FlagSet("metrics")) + logsapi.AddFlags(o.Logs, fss.FlagSet("logs")) fs := fss.FlagSet("misc") fs.StringVar(&o.ConfigFile, "config", o.ConfigFile, "The path to the configuration file.") fs.StringVar(&o.WriteConfigTo, "write-config-to", o.WriteConfigTo, "If set, write the default configuration values to this file and exit.") fs.StringVar(&o.Master, "master", o.Master, "The address of the Kubernetes API server (overrides any value in kubeconfig).") fs.StringVar(&o.Kubeconfig, "kubeconfig", o.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") - logsapi.AddFlags(o.Logs, fss.FlagSet("logs")) + utilfeature.DefaultMutableFeatureGate.AddFlag(fss.FlagSet("generic")) return fss } -// Validate is used to validate the options and config before launching the controller. -func (o *Options) Validate() error { - var errs []error +func (o *Options) Complete() error { + return nil +} - if err := validation.Validate(o.config).ToAggregate(); err != nil { - errs = append(errs, err.Errors()...) +// ApplyTo fills up onex controller manager config with options. +func (o *Options) ApplyTo(c *controllermanagerconfig.Config, allControllers []string, disabledControllers []string, controllerAliases map[string]string) error { + if err := o.Generic.ApplyTo(&c.ComponentConfig.Generic, allControllers, disabledControllers, controllerAliases); err != nil { + return err + } + if err := o.GarbageCollectorController.ApplyTo(&c.ComponentConfig.GarbageCollectorController); err != nil { + return err } - return utilerrors.NewAggregate(errs) -} + if err := o.ChainController.ApplyTo(&c.ComponentConfig.ChainController); err != nil { + return err + } -// ApplyTo fills up onex controller manager config with options. -func (o *Options) ApplyTo(c *controllermanagerconfig.Config) error { - c.ComponentConfig = o.config + o.Metrics.Apply() return nil } -// ApplyDeprecated obtains the deprecated CLI args and set them to `o.ComponentConfig` if specified. -func (o *Options) ApplyDeprecated() { - if o == nil { - return - } +// Validate is used to validate the options and config before launching the controller. +func (o *Options) Validate(allControllers []string, disabledControllers []string, controllerAliases map[string]string) error { + var errs []error - /* - // Obtain deprecated CLI args. Set them to cfg if specified in command line. - deprecated := o.Flags.FlagSet("deprecated") - if deprecated.Changed("profiling") { - o.ComponentConfig.EnableProfiling = o.Deprecated.EnableProfiling - } - if deprecated.Changed("contention-profiling") { - o.ComponentConfig.EnableContentionProfiling = o.Deprecated.EnableContentionProfiling - } - */ -} + errs = append(errs, o.Generic.Validate(allControllers, disabledControllers, controllerAliases)...) + errs = append(errs, o.GarbageCollectorController.Validate()...) + errs = append(errs, o.ChainController.Validate()...) -// ApplyLeaderElectionTo obtains the CLI args related with leaderelection, and override the values in `cfg`. -// Then the `cfg` object is injected into the `options` object. -func (o *Options) ApplyLeaderElectionTo(cfg *ctrlmgrconfig.OneXControllerManagerConfiguration) { - if o == nil { - return - } - // Obtain CLI args related with leaderelection. Set them to `cfg` if specified in command line. - /* - leaderelection := o.Flags.FlagSet("leader election") - if leaderelection.Changed("leader-elect") { - cfg.LeaderElection.LeaderElect = o.LeaderElection.LeaderElect - } - if leaderelection.Changed("leader-elect-lease-duration") { - cfg.LeaderElection.LeaseDuration = o.LeaderElection.LeaseDuration - } - if leaderelection.Changed("leader-elect-renew-deadline") { - cfg.LeaderElection.RenewDeadline = o.LeaderElection.RenewDeadline - } - if leaderelection.Changed("leader-elect-retry-period") { - cfg.LeaderElection.RetryPeriod = o.LeaderElection.RetryPeriod - } - if leaderelection.Changed("leader-elect-resource-lock") { - cfg.LeaderElection.ResourceLock = o.LeaderElection.ResourceLock - } - if leaderelection.Changed("leader-elect-resource-name") { - cfg.LeaderElection.ResourceName = o.LeaderElection.ResourceName - } - if leaderelection.Changed("leader-elect-resource-namespace") { - cfg.LeaderElection.ResourceNamespace = o.LeaderElection.ResourceNamespace - } - */ - - o.config = cfg + // TODO: validate component config, master and kubeconfig + + return utilerrors.NewAggregate(errs) } // Config return a controller manager config objective. -func (o Options) Config() (*controllermanagerconfig.Config, error) { +func (o Options) Config(allControllers []string, disabledControllers []string, controllerAliases map[string]string) (*controllermanagerconfig.Config, error) { kubeconfig, err := clientcmd.BuildConfigFromFlags(o.Master, o.Kubeconfig) if err != nil { return nil, err } + kubeconfig.DisableCompression = true restConfig := kubeutil.AddUserAgent(kubeconfig, ControllerManagerUserAgent) client, err := clientset.NewForConfig(restConfig) @@ -219,7 +159,7 @@ func (o Options) Config() (*controllermanagerconfig.Config, error) { Client: client, } - if err := o.ApplyTo(c); err != nil { + if err := o.ApplyTo(c, allControllers, disabledControllers, controllerAliases); err != nil { return nil, err } diff --git a/cmd/onex-controller-manager/controller-manager.go b/cmd/onex-controller-manager/controller-manager.go index 666d7282bed..ff5a6bb61c5 100644 --- a/cmd/onex-controller-manager/controller-manager.go +++ b/cmd/onex-controller-manager/controller-manager.go @@ -11,7 +11,7 @@ package main import ( "os" - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "k8s.io/component-base/cli" _ "k8s.io/component-base/logs/json/register" // for JSON log format registration _ "k8s.io/component-base/metrics/prometheus/clientgo" // load all the prometheus client-go plugin diff --git a/cmd/onex-controller-manager/names/controller_names.go b/cmd/onex-controller-manager/names/controller_names.go new file mode 100644 index 00000000000..351d9f9e91a --- /dev/null +++ b/cmd/onex-controller-manager/names/controller_names.go @@ -0,0 +1,52 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 names + +// Canonical controller names +// +// NAMING CONVENTIONS +// 1. naming should be consistent across the controllers +// 2. use of shortcuts should be avoided, unless they are well-known non-Kubernetes shortcuts +// 3. Kubernetes' resources should be written together without a hyphen ("-") +// +// CHANGE POLICY +// The controller names should be treated as IDs. +// They can only be changed if absolutely necessary. For example if an inappropriate name was chosen in the past, or if the scope of the controller changes. +// When a name is changed, the old name should be aliased in app.ControllerDescriptor#GetAliases, while preserving all old aliases. +// This is done to achieve backwards compatibility +// +// USE CASES +// The following places should use the controller name constants, when: +// 1. defining a new app.ControllerDescriptor so it can be used in app.NewControllerDescriptors or app.KnownControllers: +// 2. used anywhere inside the controller itself: +// 2.1. [TODO] logging should use a canonical controller name when referencing a controller (Eg. Starting X, Shutting down X) +// 2.2. [TODO] emitted events should have an EventSource.Component set to the controller name (usually when initializing an EventRecorder) +// 2.3. [TODO] registering ControllerManagerMetrics with ControllerStarted and ControllerStopped +// 2.4. [TODO] calling WaitForNamedCacheSync +// 3. defining controller options for "--help" command or generated documentation +// 3.1. controller name should be used to create a pflag.FlagSet when registering controller options (the name is rendered in a controller flag group header) in options.KubeControllerManagerOptions +// 3.2. when defined flag's help mentions a controller name +// 4. defining a new service account for a new controller (old controllers may have inconsistent service accounts to stay backwards compatible) +const ( + GarbageCollectorController = "garbage-collector-controller" + NamespacedResourcesDeleterController = "namespaced-resource-deleter" + ChainController = "chain-controller" + ChainSyncController = "chain-sync-controller" + MinerSetSyncController = "minerset-sync-controller" + MinerSyncController = "miner-sync-controller" + ResourceCleanController = "resource-clean-controller" +) diff --git a/cmd/onex-fakeserver/app/server.go b/cmd/onex-fakeserver/app/server.go index 7bd4943e30a..54b3eacde99 100644 --- a/cmd/onex-fakeserver/app/server.go +++ b/cmd/onex-fakeserver/app/server.go @@ -21,9 +21,9 @@ Find more onex-fakeserver information at: https://github.com/superproj/onex/blob/master/docs/guide/en-US/cmd/onex-fakeserver.md` // NewApp creates an App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex fake server", + application := app.NewApp(fakeserver.Name, "Launch a onex fake server", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-fakeserver/main.go b/cmd/onex-fakeserver/main.go index 4cf3043a3c5..0f5ac554af5 100644 --- a/cmd/onex-fakeserver/main.go +++ b/cmd/onex-fakeserver/main.go @@ -9,11 +9,11 @@ package main import ( - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "github.com/superproj/onex/cmd/onex-fakeserver/app" ) func main() { - app.NewApp("onex-fakeserver").Run() + app.NewApp().Run() } diff --git a/cmd/onex-gateway/app/options/options.go b/cmd/onex-gateway/app/options/options.go index c91a1fc436a..108493a9762 100644 --- a/cmd/onex-gateway/app/options/options.go +++ b/cmd/onex-gateway/app/options/options.go @@ -122,7 +122,7 @@ func (o *Options) Validate() error { return utilerrors.NewAggregate(errs) } -// ApplyTo fills up onex-nightwatch config with options. +// ApplyTo fills up onex-gateway config with options. func (o *Options) ApplyTo(c *gateway.Config) error { c.GRPCOptions = o.GRPCOptions c.HTTPOptions = o.HTTPOptions @@ -136,7 +136,7 @@ func (o *Options) ApplyTo(c *gateway.Config) error { return nil } -// Config return a onex-nightwatch config object. +// Config return an onex-gateway config object. func (o *Options) Config() (*gateway.Config, error) { kubeconfig, err := clientcmd.BuildConfigFromFlags("", o.Kubeconfig) if err != nil { diff --git a/cmd/onex-gateway/app/server.go b/cmd/onex-gateway/app/server.go index af41e39931e..59a80ab3fa5 100644 --- a/cmd/onex-gateway/app/server.go +++ b/cmd/onex-gateway/app/server.go @@ -19,9 +19,9 @@ requests from the front-end will arrive at the gateway, requests will be uniform and distributed by the gateway.` // NewApp creates an App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex gateway server", + application := app.NewApp(gateway.Name, "Launch a onex gateway server", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-gateway/main.go b/cmd/onex-gateway/main.go index 503bd1d1f57..b5402c69bb0 100644 --- a/cmd/onex-gateway/main.go +++ b/cmd/onex-gateway/main.go @@ -8,11 +8,11 @@ package main import ( - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "github.com/superproj/onex/cmd/onex-gateway/app" ) func main() { - app.NewApp("onex-gateway").Run() + app.NewApp().Run() } diff --git a/cmd/onex-miner-controller/app/controller.go b/cmd/onex-miner-controller/app/controller.go index 3a294f893fa..6e008a79b2f 100644 --- a/cmd/onex-miner-controller/app/controller.go +++ b/cmd/onex-miner-controller/app/controller.go @@ -8,6 +8,7 @@ package app import ( + "context" "fmt" "os" @@ -15,7 +16,7 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" + genericapiserver "k8s.io/apiserver/pkg/server" utilfeature "k8s.io/apiserver/pkg/util/feature" restclient "k8s.io/client-go/rest" cliflag "k8s.io/component-base/cli/flag" @@ -34,7 +35,7 @@ import ( "github.com/superproj/onex/cmd/onex-miner-controller/app/config" "github.com/superproj/onex/cmd/onex-miner-controller/app/options" - onexcontroller "github.com/superproj/onex/internal/controller" + minercontroller "github.com/superproj/onex/internal/controller/miner" "github.com/superproj/onex/internal/pkg/util/ratelimiter" "github.com/superproj/onex/pkg/apis/apps/v1beta1" "github.com/superproj/onex/pkg/apis/apps/v1beta1/index" @@ -54,7 +55,8 @@ func init() { func NewControllerCommand() *cobra.Command { o, err := options.NewOptions() if err != nil { - klog.Fatalf("Unable to initialize command options: %v", err) + klog.Background().Error(err, "Unable to initialize command options") + klog.FlushAndExit(klog.ExitFlushTimeout, 1) } cmd := &cobra.Command{ @@ -80,12 +82,12 @@ current state towards the desired state.`, if err := logsapi.ValidateAndApply(o.Logs, utilfeature.DefaultFeatureGate); err != nil { return err } - // klog.Background will automatically use the right logger. Here use the - // global klog.logging initialized by `logsapi.ValidateAndApply`. ctrl.SetLogger(klog.Background()) cliflag.PrintFlags(cmd.Flags()) + // klog.Background will automatically use the right logger. Here use the + // global klog.logging initialized by `logsapi.ValidateAndApply`. if err := o.Complete(); err != nil { return err } @@ -106,7 +108,7 @@ current state towards the desired state.`, // add feature enablement metrics utilfeature.DefaultMutableFeatureGate.AddMetrics() - return Run(cc, wait.NeverStop) + return Run(genericapiserver.SetupSignalContext(), cc) }, Args: func(cmd *cobra.Command, args []string) error { for _, arg := range args { @@ -129,11 +131,15 @@ current state towards the desired state.`, cols, _, _ := term.TerminalSize(cmd.OutOrStdout()) cliflag.SetUsageAndHelpFunc(cmd, namedFlagSets, cols) + if err := cmd.MarkFlagFilename("config", "yaml", "yml", "json"); err != nil { + klog.Background().Error(err, "Failed to mark flag filename") + } + return cmd } // Run runs the controller options. This should never exit. -func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error { +func Run(ctx context.Context, c *config.CompletedConfig) error { // To help debugging, immediately log version klog.InfoS("Starting miner controller", "version", version.Get().String()) @@ -185,7 +191,6 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error { // Initialize event recorder. record.InitFromRecorder(mgr.GetEventRecorderFor("onex-miner-controller")) - ctx := wait.ContextForChannel(stopCh) if err := index.AddDefaultIndexes(ctx, mgr); err != nil { klog.ErrorS(err, "Unable to setup indexes") return err @@ -199,7 +204,7 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error { } } - if err = (&onexcontroller.MinerReconciler{ + if err = (&minercontroller.Reconciler{ DryRun: c.ComponentConfig.DryRun, ProviderClient: c.ProviderClient, ProviderCluster: c.ProviderCluster, diff --git a/cmd/onex-miner-controller/controller.go b/cmd/onex-miner-controller/controller.go index ee05eb90e4b..5a5032445f3 100644 --- a/cmd/onex-miner-controller/controller.go +++ b/cmd/onex-miner-controller/controller.go @@ -11,7 +11,7 @@ package main import ( "os" - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "k8s.io/component-base/cli" _ "k8s.io/component-base/logs/json/register" // for JSON log format registration _ "k8s.io/component-base/metrics/prometheus/clientgo" // load all the prometheus client-go plugin diff --git a/cmd/onex-minerset-controller/app/controller.go b/cmd/onex-minerset-controller/app/controller.go index 324b1dc9c6f..a9619dbe90b 100644 --- a/cmd/onex-minerset-controller/app/controller.go +++ b/cmd/onex-minerset-controller/app/controller.go @@ -8,12 +8,13 @@ package app import ( + "context" "fmt" "os" "github.com/spf13/cobra" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/apimachinery/pkg/util/wait" + genericapiserver "k8s.io/apiserver/pkg/server" utilfeature "k8s.io/apiserver/pkg/util/feature" restclient "k8s.io/client-go/rest" cliflag "k8s.io/component-base/cli/flag" @@ -32,7 +33,7 @@ import ( "github.com/superproj/onex/cmd/onex-minerset-controller/app/config" "github.com/superproj/onex/cmd/onex-minerset-controller/app/options" - onexcontroller "github.com/superproj/onex/internal/controller" + minersetcontroller "github.com/superproj/onex/internal/controller/minerset" "github.com/superproj/onex/internal/pkg/util/ratelimiter" "github.com/superproj/onex/pkg/apis/apps/v1beta1" "github.com/superproj/onex/pkg/record" @@ -50,7 +51,8 @@ func init() { func NewControllerCommand() *cobra.Command { o, err := options.NewOptions() if err != nil { - klog.Fatalf("Unable to initialize command options: %v", err) + klog.Background().Error(err, "Unable to initialize command options") + klog.FlushAndExit(klog.ExitFlushTimeout, 1) } cmd := &cobra.Command{ @@ -102,7 +104,7 @@ current state towards the desired state.`, // add feature enablement metrics utilfeature.DefaultMutableFeatureGate.AddMetrics() - return Run(cc, wait.NeverStop) + return Run(genericapiserver.SetupSignalContext(), cc) }, Args: func(cmd *cobra.Command, args []string) error { for _, arg := range args { @@ -125,11 +127,15 @@ current state towards the desired state.`, cols, _, _ := term.TerminalSize(cmd.OutOrStdout()) cliflag.SetUsageAndHelpFunc(cmd, namedFlagSets, cols) + if err := cmd.MarkFlagFilename("config", "yaml", "yml", "json"); err != nil { + klog.Background().Error(err, "Failed to mark flag filename") + } + return cmd } // Run runs the minerset controller Options. This should never exit. -func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error { +func Run(ctx context.Context, c *config.CompletedConfig) error { // To help debugging, immediately log version klog.InfoS("Starting minerset controller", "version", version.Get().String()) @@ -173,9 +179,7 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error { // Initialize event recorder. record.InitFromRecorder(mgr.GetEventRecorderFor("onex-minerset-controller")) - ctx := wait.ContextForChannel(stopCh) - - if err = (&onexcontroller.MinerSetReconciler{ + if err = (&minersetcontroller.Reconciler{ WatchFilterValue: c.ComponentConfig.WatchFilterValue, }).SetupWithManager(ctx, mgr, controller.Options{ MaxConcurrentReconciles: int(c.ComponentConfig.Parallelism), diff --git a/cmd/onex-minerset-controller/controller.go b/cmd/onex-minerset-controller/controller.go index 85f7fddcc9d..94bba81f070 100644 --- a/cmd/onex-minerset-controller/controller.go +++ b/cmd/onex-minerset-controller/controller.go @@ -10,7 +10,7 @@ package main import ( "os" - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "k8s.io/component-base/cli" _ "k8s.io/component-base/logs/json/register" // for JSON log format registration _ "k8s.io/component-base/metrics/prometheus/clientgo" // load all the prometheus client-go plugin diff --git a/cmd/onex-nightwatch/app/options/options.go b/cmd/onex-nightwatch/app/options/options.go index c986c0574b7..04a35c51d37 100644 --- a/cmd/onex-nightwatch/app/options/options.go +++ b/cmd/onex-nightwatch/app/options/options.go @@ -8,6 +8,8 @@ package options import ( + "math" + "github.com/spf13/viper" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/clientcmd" @@ -20,6 +22,7 @@ import ( clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" "github.com/superproj/onex/pkg/log" genericoptions "github.com/superproj/onex/pkg/options" + "github.com/superproj/onex/pkg/watch" ) const ( @@ -31,10 +34,12 @@ var _ app.CliOptions = (*Options)(nil) // Options contains everything necessary to create and run a nightwatch server. type Options struct { - HealthOptions *genericoptions.HealthOptions `json:"health" mapstructure:"health"` - MySQLOptions *genericoptions.MySQLOptions `json:"mysql" mapstructure:"mysql"` - RedisOptions *genericoptions.RedisOptions `json:"redis" mapstructure:"redis"` - Metrics *genericoptions.MetricsOptions `json:"metrics" mapstructure:"metrics"` + HealthOptions *genericoptions.HealthOptions `json:"health" mapstructure:"health"` + MySQLOptions *genericoptions.MySQLOptions `json:"mysql" mapstructure:"mysql"` + RedisOptions *genericoptions.RedisOptions `json:"redis" mapstructure:"redis"` + WatchOptions *watch.Options `json:"nightwatch" mapstructure:"nightwatch"` + UserWatcherMaxWorkers int64 `json:"user-watcher-max-workers" mapstructure:"user-watcher-max-workers"` + Metrics *genericoptions.MetricsOptions `json:"metrics" mapstructure:"metrics"` // Path to kubeconfig file with authorization and master location information. Kubeconfig string `json:"kubeconfig" mapstructure:"kubeconfig"` FeatureGates map[string]bool `json:"feature-gates"` @@ -44,11 +49,13 @@ type Options struct { // NewOptions returns initialized Options. func NewOptions() *Options { o := &Options{ - HealthOptions: genericoptions.NewHealthOptions(), - MySQLOptions: genericoptions.NewMySQLOptions(), - RedisOptions: genericoptions.NewRedisOptions(), - Metrics: genericoptions.NewMetricsOptions(), - Log: log.NewOptions(), + HealthOptions: genericoptions.NewHealthOptions(), + MySQLOptions: genericoptions.NewMySQLOptions(), + RedisOptions: genericoptions.NewRedisOptions(), + UserWatcherMaxWorkers: math.MaxInt64, + WatchOptions: watch.NewOptions(), + Metrics: genericoptions.NewMetricsOptions(), + Log: log.NewOptions(), } return o @@ -59,6 +66,7 @@ func (o *Options) Flags() (fss cliflag.NamedFlagSets) { o.HealthOptions.AddFlags(fss.FlagSet("health")) o.MySQLOptions.AddFlags(fss.FlagSet("mysql")) o.RedisOptions.AddFlags(fss.FlagSet("redis")) + o.WatchOptions.AddFlags(fss.FlagSet("watch")) o.Metrics.AddFlags(fss.FlagSet("metrics")) o.Log.AddFlags(fss.FlagSet("log")) @@ -66,6 +74,7 @@ func (o *Options) Flags() (fss cliflag.NamedFlagSets) { // arrange these text blocks sensibly. Grrr. fs := fss.FlagSet("misc") fs.StringVar(&o.Kubeconfig, "kubeconfig", o.Kubeconfig, "Path to kubeconfig file with authorization and master location information.") + fs.Int64Var(&o.UserWatcherMaxWorkers, "user-watcher-max-workers", o.UserWatcherMaxWorkers, "Specify the maximum concurrency event of user watcher.") feature.DefaultMutableFeatureGate.AddFlag(fs) return fss @@ -77,6 +86,10 @@ func (o *Options) Complete() error { return err } + if o.UserWatcherMaxWorkers < 1 { + o.UserWatcherMaxWorkers = math.MaxInt64 + } + _ = feature.DefaultMutableFeatureGate.SetFromMap(o.FeatureGates) return nil } @@ -88,6 +101,7 @@ func (o *Options) Validate() error { errs = append(errs, o.HealthOptions.Validate()...) errs = append(errs, o.MySQLOptions.Validate()...) errs = append(errs, o.RedisOptions.Validate()...) + errs = append(errs, o.WatchOptions.Validate()...) errs = append(errs, o.Metrics.Validate()...) errs = append(errs, o.Log.Validate()...) @@ -98,10 +112,12 @@ func (o *Options) Validate() error { func (o *Options) ApplyTo(c *nightwatch.Config) error { c.MySQLOptions = o.MySQLOptions c.RedisOptions = o.RedisOptions + c.WatchOptions = o.WatchOptions + c.UserWatcherMaxWorkers = o.UserWatcherMaxWorkers return nil } -// Config return a onex-nightwatch config object. +// Config return an onex-nightwatch config object. func (o *Options) Config() (*nightwatch.Config, error) { kubeconfig, err := clientcmd.BuildConfigFromFlags("", o.Kubeconfig) if err != nil { diff --git a/cmd/onex-nightwatch/app/server.go b/cmd/onex-nightwatch/app/server.go index 655624db6f0..7505ea3d58e 100644 --- a/cmd/onex-nightwatch/app/server.go +++ b/cmd/onex-nightwatch/app/server.go @@ -19,9 +19,9 @@ like linux cronjob. You can add Cron(github.com/robfig/cron) jobs on the given s use the Cron spec format.` // NewApp creates an App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex asynchronous task processing server", + application := app.NewApp("onex-nightwatch", "Launch a onex asynchronous task processing server", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-nightwatch/main.go b/cmd/onex-nightwatch/main.go index 4361aa7c4be..bebb591bf06 100644 --- a/cmd/onex-nightwatch/main.go +++ b/cmd/onex-nightwatch/main.go @@ -8,11 +8,11 @@ package main import ( - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "github.com/superproj/onex/cmd/onex-nightwatch/app" ) func main() { - app.NewApp("onex-nightwatch").Run() + app.NewApp().Run() } diff --git a/cmd/onex-pump/app/options/options.go b/cmd/onex-pump/app/options/options.go index 9d8419f6728..613a68f71f8 100644 --- a/cmd/onex-pump/app/options/options.go +++ b/cmd/onex-pump/app/options/options.go @@ -89,7 +89,7 @@ func (o *Options) ApplyTo(c *pump.Config) error { return nil } -// Config return a onex-nightwatch config object. +// Config return an onex-pump config object. func (o *Options) Config() (*pump.Config, error) { c := &pump.Config{} diff --git a/cmd/onex-pump/app/server.go b/cmd/onex-pump/app/server.go index 83dc95b40d9..2d934b62cb4 100644 --- a/cmd/onex-pump/app/server.go +++ b/cmd/onex-pump/app/server.go @@ -27,9 +27,9 @@ Find more onex-pump information at: https://github.com/superproj/onex/blob/master/docs/guide/en-US/cmd/onex-pump.md` // NewApp creates an App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex pump server", + application := app.NewApp("onex-pump", "Launch a onex pump server", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-pump/main.go b/cmd/onex-pump/main.go index 242f2d3ad8d..6711625fbff 100644 --- a/cmd/onex-pump/main.go +++ b/cmd/onex-pump/main.go @@ -15,5 +15,5 @@ import ( ) func main() { - app.NewApp("onex-pump").Run() + app.NewApp().Run() } diff --git a/cmd/onex-scheduler-controller/README.md b/cmd/onex-scheduler-controller/README.md new file mode 100644 index 00000000000..12b71ba22b0 --- /dev/null +++ b/cmd/onex-scheduler-controller/README.md @@ -0,0 +1,3 @@ +# onex-scheduler-controllr + +源自:sigs.k8s.io/scheduler-plugins/cmd/controller diff --git a/cmd/onex-scheduler/.keep b/cmd/onex-scheduler-plugins/.keep similarity index 100% rename from cmd/onex-scheduler/.keep rename to cmd/onex-scheduler-plugins/.keep diff --git a/cmd/onex-scheduler/README.md b/cmd/onex-scheduler-plugins/README.md similarity index 100% rename from cmd/onex-scheduler/README.md rename to cmd/onex-scheduler-plugins/README.md diff --git a/cmd/onex-toyblc/app/options/options.go b/cmd/onex-toyblc/app/options/options.go index cd4eb13be7d..bb78edeeb47 100644 --- a/cmd/onex-toyblc/app/options/options.go +++ b/cmd/onex-toyblc/app/options/options.go @@ -114,7 +114,7 @@ func (o *Options) Validate() error { return utilerrors.NewAggregate(errs) } -// ApplyTo fills up onex-nightwatch config with options. +// ApplyTo fills up onex-toyblc config with options. func (o *Options) ApplyTo(c *toyblc.Config) error { c.Miner = o.Miner c.MinMineInterval = o.MinMineInterval @@ -128,7 +128,7 @@ func (o *Options) ApplyTo(c *toyblc.Config) error { return nil } -// Config return a onex-nightwatch config object. +// Config return an onex-toyblc config object. func (o *Options) Config() (*toyblc.Config, error) { c := &toyblc.Config{} diff --git a/cmd/onex-toyblc/app/server.go b/cmd/onex-toyblc/app/server.go index 2fbc5821be1..66d0088e6fc 100644 --- a/cmd/onex-toyblc/app/server.go +++ b/cmd/onex-toyblc/app/server.go @@ -18,9 +18,9 @@ import ( const commandDesc = `The toy blc is used to start a naive and simple blockchain node.` // NewApp creates and returns a new App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex toy blockchain node", + application := app.NewApp("onex-toyblc", "Launch a onex toy blockchain node", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-toyblc/main.go b/cmd/onex-toyblc/main.go index 6ad1ca2e341..adfe88ffea8 100644 --- a/cmd/onex-toyblc/main.go +++ b/cmd/onex-toyblc/main.go @@ -8,11 +8,11 @@ package main import ( - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "github.com/superproj/onex/cmd/onex-toyblc/app" ) func main() { - app.NewApp("onex-toyblc").Run() + app.NewApp().Run() } diff --git a/cmd/onex-usercenter/app/options/options.go b/cmd/onex-usercenter/app/options/options.go index 53844a80f5a..78615b1bd19 100644 --- a/cmd/onex-usercenter/app/options/options.go +++ b/cmd/onex-usercenter/app/options/options.go @@ -134,7 +134,7 @@ func (o *Options) Validate() error { return utilerrors.NewAggregate(errs) } -// ApplyTo fills up onex-nightwatch config with options. +// ApplyTo fills up onex-usercenter config with options. func (o *Options) ApplyTo(c *usercenter.Config) error { c.GRPCOptions = o.GRPCOptions c.HTTPOptions = o.HTTPOptions @@ -149,7 +149,7 @@ func (o *Options) ApplyTo(c *usercenter.Config) error { return nil } -// Config return a onex-nightwatch config object. +// Config return an onex-usercenter config object. func (o *Options) Config() (*usercenter.Config, error) { c := &usercenter.Config{} diff --git a/cmd/onex-usercenter/app/server.go b/cmd/onex-usercenter/app/server.go index 0f4ce1b5104..d0f26d438c6 100644 --- a/cmd/onex-usercenter/app/server.go +++ b/cmd/onex-usercenter/app/server.go @@ -18,9 +18,9 @@ import ( const commandDesc = `The usercenter server is used to manage users, keys, fees, etc.` // NewApp creates and returns a new App object with default parameters. -func NewApp(name string) *app.App { +func NewApp() *app.App { opts := options.NewOptions() - application := app.NewApp(name, "Launch a onex usercenter server", + application := app.NewApp(usercenter.Name, "Launch a onex usercenter server", app.WithDescription(commandDesc), app.WithOptions(opts), app.WithDefaultValidArgs(), diff --git a/cmd/onex-usercenter/main.go b/cmd/onex-usercenter/main.go index e45a932a496..1fe8c29f9a0 100644 --- a/cmd/onex-usercenter/main.go +++ b/cmd/onex-usercenter/main.go @@ -9,12 +9,12 @@ package main import ( // Importing the package to automatically set GOMAXPROCS. - _ "go.uber.org/automaxprocs" + _ "go.uber.org/automaxprocs/maxprocs" "github.com/superproj/onex/cmd/onex-usercenter/app" ) func main() { // Creating a new instance of the usercenter application and running it - app.NewApp("onex-usercenter").Run() + app.NewApp().Run() } diff --git a/configs/appconfig/onex-miner-controller.config.tmpl.yaml b/configs/appconfig/onex-miner-controller.config.tmpl.yaml index 01a1a9b7f60..c0f22dc3d39 100644 --- a/configs/appconfig/onex-miner-controller.config.tmpl.yaml +++ b/configs/appconfig/onex-miner-controller.config.tmpl.yaml @@ -11,6 +11,7 @@ leaderElection: leaderElect: false metricsBindAddress: 0.0.0.0:${ONEX_MINER_CONTROLLER_METRICS_PORT} healthzBindAddress: 0.0.0.0:${ONEX_MINER_CONTROLLER_HEALTHZ_PORT} +providerKubeconfig: /opt/onex/etc/config.kind dryRun: true redis: addr: ${ONEX_REDIS_ADDR} diff --git a/configs/appconfig/onex-minerset-controller.config.tmpl.yaml b/configs/appconfig/onex-minerset-controller.config.tmpl.yaml index 27486adeb32..9fb3d4477c0 100644 --- a/configs/appconfig/onex-minerset-controller.config.tmpl.yaml +++ b/configs/appconfig/onex-minerset-controller.config.tmpl.yaml @@ -4,7 +4,6 @@ # this file is https://github.com/superproj/onex. # - apiVersion: minersetcontroller.config.onex.io/v1beta1 kind: MinerSetControllerConfiguration leaderElection: diff --git a/configs/onex-create.sql b/configs/onex-create.sql index a79dfa6389f..5369e9d98dd 100644 --- a/configs/onex-create.sql +++ b/configs/onex-create.sql @@ -10,7 +10,7 @@ CREATE TABLE `uc_user` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键 ID', `user_id` varchar(253) NOT NULL DEFAULT '' COMMENT '用户 ID', `username` varchar(253) NOT NULL DEFAULT '' COMMENT '用户名称', - `status` tinyint unsigned NOT NULL DEFAULT 1 COMMENT '用户状态,0-禁用;1-启用', + `status` varchar(64) NOT NULL DEFAULT '' COMMENT '用户状态:registered,active,disabled,blacklisted,locked,deleted', `nickname` varchar(253) NOT NULL DEFAULT '' COMMENT '用户昵称', `password` varchar(64) NOT NULL DEFAULT '' COMMENT '用户加密后的密码', `email` varchar(253) NOT NULL DEFAULT '' COMMENT '用户电子邮箱', diff --git a/configs/onex.sql b/configs/onex.sql index 072caeae3e2..2762ad549ce 100644 --- a/configs/onex.sql +++ b/configs/onex.sql @@ -234,7 +234,7 @@ CREATE TABLE `uc_user` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键 ID', `user_id` varchar(253) NOT NULL DEFAULT '' COMMENT '用户 ID', `username` varchar(253) NOT NULL DEFAULT '' COMMENT '用户名称', - `status` tinyint(3) unsigned NOT NULL DEFAULT 1 COMMENT '用户状态,0-禁用;1-启用', + `status` varchar(64) NOT NULL DEFAULT '' COMMENT '用户状态:registered,active,disabled,blacklisted,locked,deleted', `nickname` varchar(253) NOT NULL DEFAULT '' COMMENT '用户昵称', `password` varchar(64) NOT NULL DEFAULT '' COMMENT '用户加密后的密码', `email` varchar(253) NOT NULL DEFAULT '' COMMENT '用户电子邮箱', diff --git a/docs/guide/zh-CN/installation/onex/onex-toyblc/installation.md b/docs/guide/zh-CN/installation/onex/onex-toyblc/installation.md index 4974f8eec3f..bb43c726d0e 100644 --- a/docs/guide/zh-CN/installation/onex/onex-toyblc/installation.md +++ b/docs/guide/zh-CN/installation/onex/onex-toyblc/installation.md @@ -35,7 +35,7 @@ $ curl -H "Host: onex.toyblc.superproj.com" http://127.0.0.1:18080/v1/peers $ curl -H "Host: onex.toyblc.superproj.com" http://127.0.0.1:18080/v1/blocks ``` -> curl http://genesis.kube-system.svc.onex.io:8080/v1/blocks +> curl http://genesis.kube-system.svc.superproj.com:8080/v1/blocks ### 3. 挖矿 diff --git a/examples/client-go/crd/main.go b/examples/client-go/crd/main.go new file mode 100644 index 00000000000..1aaa2bebcfe --- /dev/null +++ b/examples/client-go/crd/main.go @@ -0,0 +1,71 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + + "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/tools/clientcmd" +) + +func main() { + configLoader := clientcmd.NewNonInteractiveDeferredLoadingClientConfig( + clientcmd.NewDefaultClientConfigLoadingRules(), + &clientcmd.ConfigOverrides{}, + ) + + namespace, _, err := configLoader.Namespace() + if err != nil { + panic(err) + } + + cfg, err := configLoader.ClientConfig() + if err != nil { + panic(err) + } + + dc, err := dynamic.NewForConfig(cfg) + if err != nil { + panic(err) + } + + // identify out custom resource + gvr := schema.GroupVersionResource{ + Group: "webapp.my.domain", + Version: "v1", + Resource: "guestbooks", + } + // retrieve the resource of kind Pizza named 'margherita' + res, err := dc.Resource(gvr). + Namespace(namespace). + Get(context.TODO(), "guestbook-sample", metav1.GetOptions{}) + if err != nil { + if errors.IsNotFound(err) { + return + } + panic(err) + } + data, _ := json.Marshal(res) + fmt.Println(string(data)) + + // grab the status if exists + status, ok := res.Object["status"] + if !ok { + // otherwise create it + status = make(map[string]interface{}) + } + + // change the 'margherita' price + status.(map[string]interface{})["cost"] = 6.50 + res.Object["status"] = status + + // update the 'margherita' custom resource with the new price + _, err = dc.Resource(gvr).Namespace(namespace).Update(context.TODO(), res, metav1.UpdateOptions{}) + if err != nil { + panic(err) + } +} diff --git a/go.mod b/go.mod index 2cdd83a5fca..602f46516cd 100644 --- a/go.mod +++ b/go.mod @@ -20,22 +20,23 @@ require ( github.com/distribution/reference v0.5.0 github.com/envoyproxy/protoc-gen-validate v1.0.2 github.com/fatih/color v1.15.0 + github.com/gammazero/workerpool v1.1.3 github.com/ghodss/yaml v1.0.0 github.com/gin-contrib/pprof v1.4.0 github.com/gin-gonic/gin v1.8.1 github.com/go-kratos/kratos/contrib/metrics/prometheus/v2 v2.0.0-20230830131453-6c026bce56a9 github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230830131453-6c026bce56a9 github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230830131453-6c026bce56a9 - github.com/go-kratos/kratos/v2 v2.7.2 + github.com/go-kratos/kratos/v2 v2.7.3 github.com/go-kratos/swagger-api v1.0.1 - github.com/go-logr/logr v1.3.0 + github.com/go-logr/logr v1.4.1 github.com/go-redsync/redsync/v4 v4.11.0 github.com/go-resty/resty/v2 v2.7.0 github.com/golang-jwt/jwt/v4 v4.5.0 github.com/golang/mock v1.6.0 github.com/google/wire v0.5.0 github.com/gorilla/handlers v1.5.1 - github.com/gorilla/mux v1.8.0 + github.com/gorilla/mux v1.8.1 github.com/gorilla/websocket v1.5.0 github.com/gosuri/uitable v0.0.4 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 @@ -45,11 +46,13 @@ require ( github.com/jinzhu/copier v0.3.5 github.com/kisielk/errcheck v1.5.0 github.com/likexian/host-stat-go v0.0.0-20190516151207-c9cf36dd6ce9 + github.com/looplab/fsm v1.0.2 github.com/mitchellh/go-wordwrap v1.0.1 github.com/nicksnyder/go-i18n/v2 v2.2.1 github.com/olekukonko/tablewriter v0.0.5 - github.com/onsi/ginkgo/v2 v2.13.0 - github.com/onsi/gomega v1.29.0 + github.com/onsi/ginkgo/v2 v2.17.1 + github.com/onsi/gomega v1.32.0 + github.com/panjf2000/ants/v2 v2.9.1 github.com/parnurzeal/gorequest v0.2.16 github.com/prometheus/client_golang v1.17.0 github.com/redis/go-redis/extra/rediscensus/v9 v9.0.5 @@ -71,23 +74,24 @@ require ( go.opentelemetry.io/otel/trace v1.19.0 google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 google.golang.org/grpc v1.58.3 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.34.2 gorm.io/driver/mysql v1.5.1-0.20230509030346-3715c134c25b gorm.io/gen v0.3.23 gorm.io/gorm v1.25.1-0.20230505075827-e61b98d69677 - k8s.io/api v0.29.3 - k8s.io/apimachinery v0.29.3 - k8s.io/apiserver v0.29.3 - k8s.io/cli-runtime v0.29.3 - k8s.io/client-go v0.29.3 - k8s.io/code-generator v0.29.3 - k8s.io/component-base v0.29.3 - k8s.io/klog/v2 v2.110.1 - k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 + k8s.io/api v0.30.2 + k8s.io/apimachinery v0.30.2 + k8s.io/apiserver v0.30.2 + k8s.io/cli-runtime v0.30.2 + k8s.io/client-go v0.30.2 + k8s.io/code-generator v0.30.2 + k8s.io/component-base v0.30.2 + k8s.io/klog/v2 v2.120.1 + k8s.io/kube-aggregator v0.0.0 + k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 k8s.io/kubernetes v0.0.0-00010101000000-000000000000 k8s.io/utils v0.0.0-20230726121419-3b25d923346b sigs.k8s.io/cluster-api v1.5.2 - sigs.k8s.io/controller-runtime v0.16.3 + sigs.k8s.io/controller-runtime v0.18.4 sigs.k8s.io/structured-merge-diff/v4 v4.4.1 ) @@ -112,7 +116,8 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/elazarl/goproxy v0.0.0-20210110162100-a92cc753f88e // indirect github.com/emicklei/go-restful/v3 v3.11.0 // indirect - github.com/evanphx/json-patch/v5 v5.6.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/gammazero/deque v0.2.0 // indirect github.com/gin-contrib/sse v0.1.0 // indirect github.com/glebarez/go-sqlite v1.19.1 // indirect github.com/glebarez/sqlite v1.5.0 // indirect @@ -121,7 +126,7 @@ require ( github.com/go-kratos/grpc-gateway/v2 v2.5.1-0.20210811062259-c92d36e434b1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-playground/form/v4 v4.2.0 // indirect + github.com/go-playground/form/v4 v4.2.1 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/go-playground/validator/v10 v10.10.0 // indirect @@ -133,7 +138,7 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/google/btree v1.0.1 // indirect - github.com/google/cel-go v0.17.7 // indirect + github.com/google/cel-go v0.17.8 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect @@ -162,8 +167,10 @@ require ( github.com/mattn/go-runewidth v0.0.14 // indirect github.com/microsoft/go-mssqldb v0.17.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect + github.com/moby/spdystream v0.2.0 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/montanaflynn/stats v0.6.6 // indirect + github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/peterbourgon/diskv v2.0.1+incompatible // indirect github.com/pierrec/lz4/v4 v4.1.17 // indirect @@ -196,9 +203,10 @@ require ( gorm.io/driver/sqlserver v1.4.1 // indirect gorm.io/hints v1.1.0 // indirect gorm.io/plugin/dbresolver v1.3.0 // indirect - k8s.io/cloud-provider v0.29.3 // indirect - k8s.io/kms v0.29.3 // indirect - k8s.io/kube-controller-manager v0.29.3 // indirect + k8s.io/cloud-provider v0.30.2 // indirect + k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 // indirect + k8s.io/kms v0.30.2 // indirect + k8s.io/kube-controller-manager v0.30.2 // indirect modernc.org/libc v1.19.0 // indirect modernc.org/mathutil v1.5.0 // indirect modernc.org/memory v1.4.0 // indirect @@ -221,7 +229,7 @@ require ( github.com/evanphx/json-patch v5.6.0+incompatible github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.7.0 - github.com/go-logr/zapr v1.2.4 // indirect + github.com/go-logr/zapr v1.3.0 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/swag v0.22.3 // indirect @@ -234,7 +242,7 @@ require ( github.com/golang/protobuf v1.5.4 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 - github.com/google/uuid v1.3.0 + github.com/google/uuid v1.6.0 github.com/hashicorp/golang-lru v1.0.2 github.com/hashicorp/hcl v1.0.0 // indirect github.com/imdario/mergo v0.3.16 // indirect @@ -263,16 +271,16 @@ require ( go.uber.org/automaxprocs v1.5.1 go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 - golang.org/x/crypto v0.16.0 - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 - golang.org/x/oauth2 v0.10.0 // indirect - golang.org/x/sync v0.5.0 - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/crypto v0.21.0 + golang.org/x/mod v0.15.0 // indirect + golang.org/x/net v0.23.0 + golang.org/x/oauth2 v0.12.0 // indirect + golang.org/x/sync v0.7.0 + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 golang.org/x/time v0.3.0 - golang.org/x/tools v0.16.1 + golang.org/x/tools v0.18.0 gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect @@ -281,12 +289,12 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 - k8s.io/apiextensions-apiserver v0.29.3 - k8s.io/component-helpers v0.29.3 // indirect - k8s.io/controller-manager v0.29.3 + k8s.io/apiextensions-apiserver v0.30.2 + k8s.io/component-helpers v0.30.2 // indirect + k8s.io/controller-manager v0.30.2 k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 - k8s.io/kubelet v0.26.9 // indirect - sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 // indirect + k8s.io/kubelet v0.30.2 // indirect + sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 // indirect sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect sigs.k8s.io/yaml v1.3.0 ) @@ -305,17 +313,34 @@ replace ( go.opentelemetry.io/otel/sdk => go.opentelemetry.io/otel/sdk v1.19.0 go.opentelemetry.io/otel/trace => go.opentelemetry.io/otel/trace v1.19.0 go.opentelemetry.io/proto/otlp => go.opentelemetry.io/proto/otlp v1.0.0 - k8s.io/cri-api => k8s.io/cri-api v0.29.3 - k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.29.3 - k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.29.3 - k8s.io/endpointslice => k8s.io/endpointslice v0.29.3 - k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.29.3 - k8s.io/kube-proxy => k8s.io/kube-proxy v0.29.3 - k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.29.3 + k8s.io/api => /home/colin/workspace/golang/src/k8s.io/api + k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.30.2 + k8s.io/apimachinery => /home/colin/workspace/golang/src/k8s.io/apimachinery + k8s.io/apiserver => k8s.io/apiserver v0.30.2 + k8s.io/cli-runtime => k8s.io/cli-runtime v0.30.2 + k8s.io/client-go => /home/colin/workspace/golang/src/k8s.io/client-go + k8s.io/cloud-provider => k8s.io/cloud-provider v0.30.2 + k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.30.2 + k8s.io/code-generator => k8s.io/code-generator v0.30.2 + k8s.io/component-base => k8s.io/component-base v0.30.2 + k8s.io/component-helpers => k8s.io/component-helpers v0.30.2 + k8s.io/controller-manager => k8s.io/controller-manager v0.30.2 + k8s.io/cri-api => k8s.io/cri-api v0.30.2 + k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.30.2 + k8s.io/dynamic-resource-allocation => k8s.io/dynamic-resource-allocation v0.30.2 + k8s.io/endpointslice => k8s.io/endpointslice v0.30.2 + k8s.io/kms => k8s.io/kms v0.30.2 + k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.30.2 + k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.30.2 + k8s.io/kube-proxy => k8s.io/kube-proxy v0.30.2 + k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.30.2 + k8s.io/kubectl => k8s.io/kubectl v0.30.2 + k8s.io/kubelet => k8s.io/kubelet v0.30.2 // k8s.io/kubernetes 经常会被自动变更为v1.15.0-alpha.0,这里使用replace解决掉 - k8s.io/kubernetes => k8s.io/kubernetes v1.29.3 - k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.29.3 - k8s.io/mount-utils => k8s.io/mount-utils v0.29.3 - k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.29.3 - k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.29.3 + k8s.io/kubernetes => k8s.io/kubernetes v1.30.2 + k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.30.2 + k8s.io/metrics => k8s.io/metrics v0.30.2 + k8s.io/mount-utils => k8s.io/mount-utils v0.30.2 + k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.30.2 + k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.30.2 ) diff --git a/go.sum b/go.sum index 74e3f6a4502..357d9829303 100644 --- a/go.sum +++ b/go.sum @@ -648,7 +648,6 @@ github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPd github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ= github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= 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/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -771,8 +770,8 @@ github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBF github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.6.0 h1:b91NhWfaz02IuVxO9faSllyAtNXHMPkC5J8sJCLunww= -github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= +github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= @@ -789,6 +788,10 @@ github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMo github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= +github.com/gammazero/deque v0.2.0 h1:SkieyNB4bg2/uZZLxvya0Pq6diUlwx7m2TeT7GAIWaA= +github.com/gammazero/deque v0.2.0/go.mod h1:LFroj8x4cMYCukHJDbxFCkT+r9AndaJnFMuZDV34tuU= +github.com/gammazero/workerpool v1.1.3 h1:WixN4xzukFoN0XSeXF6puqEqFTl2mECI9S6W44HWy9Q= +github.com/gammazero/workerpool v1.1.3/go.mod h1:wPjyBLDbyKnUn2XwwyD3EEwo9dHutia9/fwNmSHWACc= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/pprof v1.4.0 h1:XxiBSf5jWZ5i16lNOPbMTVdgHBdhfGRD5PZ1LWazzvg= @@ -825,8 +828,8 @@ github.com/go-kratos/kratos/contrib/registry/consul/v2 v2.0.0-20230830131453-6c0 github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230830131453-6c026bce56a9 h1:xNRaNxgOHmM06aQKCUXlddav4FJvoVqLQg3gfbJQcME= github.com/go-kratos/kratos/contrib/registry/etcd/v2 v2.0.0-20230830131453-6c026bce56a9/go.mod h1:+XKxmAGjJ1ZTmNvhcdCQSWVM9xqmmYBBy/wOLhXLZkE= github.com/go-kratos/kratos/v2 v2.0.3/go.mod h1:Hgl0YPry9YyLtwTTfwLfowPKg+YS0dgZ06O5NHqz5hE= -github.com/go-kratos/kratos/v2 v2.7.2 h1:WVPGFNLKpv+0odMnCPxM4ZHa2hy9I5FOnwpG3Vv4w5c= -github.com/go-kratos/kratos/v2 v2.7.2/go.mod h1:rppuc8+pGL2UtXA29bgFHWKqaaF6b6GB2XIYiDvFBRk= +github.com/go-kratos/kratos/v2 v2.7.3 h1:T9MS69qk4/HkVUuHw5GS9PDVnOfzn+kxyF0CL5StqxA= +github.com/go-kratos/kratos/v2 v2.7.3/go.mod h1:CQZ7V0qyVPwrotIpS5VNNUJNzEbcyRUl5pRtxLOIvn4= github.com/go-kratos/swagger-api v1.0.1 h1:zBagw2tWA+icYrRPFqM3jFL60nO743ZiIvuiI6CpV6E= github.com/go-kratos/swagger-api v1.0.1/go.mod h1:KMYylgeNaApBgPYIF6kIP1kjGFgI4aDQNbQNBTqaewI= github.com/go-latex/latex v0.0.0-20210118124228-b3d85cf34e07/go.mod h1:CO1AlKB2CSIqUrmQPqA0gdRIlnLEY0gK5JGjh37zN5U= @@ -837,12 +840,12 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.4/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY= -github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= -github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= +github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= @@ -855,8 +858,9 @@ github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhO github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic= github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= +github.com/go-playground/form/v4 v4.2.1 h1:HjdRDKO0fftVMU5epjPW2SOREcZ6/wLUzEobqUGJuPw= +github.com/go-playground/form/v4 v4.2.1/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= @@ -885,9 +889,8 @@ github.com/goccy/go-json v0.9.7/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGF github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= @@ -952,8 +955,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/cel-go v0.17.7 h1:6ebJFzu1xO2n7TLtN+UBqShGBhlD85bhvglh5DpcfqQ= -github.com/google/cel-go v0.17.7/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= +github.com/google/cel-go v0.17.8 h1:j9m730pMZt1Fc4oKhCLUHfjj6527LuhYcYw0Rl8gqto= +github.com/google/cel-go v0.17.8/go.mod h1:HXZKzB0LXqer5lHHgfWAnlYwJaQBDKMjxjulNQzhwhY= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= @@ -1005,8 +1008,9 @@ github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3 github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/wire v0.5.0 h1:I7ELFeVBr3yfPIcc8+MWvrjk+3VjbcSzoXm3JVa+jD8= github.com/google/wire v0.5.0/go.mod h1:ngWDr9Qvq3yZA10YrxfyGELY/AFWGVpy9c1LTRi1EoU= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= @@ -1031,8 +1035,10 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGa github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= @@ -1154,7 +1160,6 @@ github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0f github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.3.0/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= @@ -1224,6 +1229,8 @@ github.com/likexian/host-stat-go v0.0.0-20190516151207-c9cf36dd6ce9/go.mod h1:Hn github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= +github.com/looplab/fsm v1.0.2 h1:f0kdMzr4CRpXtaKKRUxwLYJ7PirTdwrtNumeLN+mDx8= +github.com/looplab/fsm v1.0.2/go.mod h1:PmD3fFvQEIsjMEfvZdrCDZ6y8VwKTwWNjlpEr6IKPO4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a h1:N9zuLhTvBSRt0gWSiJswwQ2HqDmtX/ZCDJURnKUt1Ik= github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE= @@ -1277,6 +1284,8 @@ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTS github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= github.com/moby/term v0.0.0-20221205130635-1aeaba878587 h1:HfkjXDfhgVaN5rmueG8cL8KKeFNecRCXFhaJ2qZ5SKA= github.com/moby/term v0.0.0-20221205130635-1aeaba878587/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1295,19 +1304,23 @@ github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= +github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nicksnyder/go-i18n/v2 v2.2.1 h1:aOzRCdwsJuoExfZhoiXHy4bjruwCMdt5otbYojM/PaA= github.com/nicksnyder/go-i18n/v2 v2.2.1/go.mod h1:fF2++lPHlo+/kPaj3nB0uxtPwzlPm+BlgwGX7MkeGj0= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8= +github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg= -github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.32.0 h1:JRYU78fJ1LPxlckP6Txi/EYqJvjtMrDC04/MM5XRHPk= +github.com/onsi/gomega v1.32.0/go.mod h1:a4x4gW6Pz2yK1MAmvluYme5lvYTn61afQ2ETw/8n4Lg= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/panjf2000/ants/v2 v2.9.1 h1:Q5vh5xohbsZXGcD6hhszzGqB7jSSc2/CRr3QKIga8Kw= +github.com/panjf2000/ants/v2 v2.9.1/go.mod h1:7ZxyxsqE4vvW0M7LSD8aI3cKwgFhBHbxnlN8mDqHa1I= github.com/parnurzeal/gorequest v0.2.16 h1:T/5x+/4BT+nj+3eSknXmCTnEVGSzFzPGdpqmUVVZXHQ= github.com/parnurzeal/gorequest v0.2.16/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= @@ -1464,6 +1477,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= @@ -1561,23 +1575,19 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.5.1 h1:e1YG66Lrk73dn4qhg8WFSvhF0JuFQF0ERIp4rpuV8Qk= go.uber.org/automaxprocs v1.5.1/go.mod h1:BF4eumQw0P9GtnuxxovUd06vwm1o18oMzFtK66vU6XU= -go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= -go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= -go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1599,8 +1609,8 @@ golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20221005025214-4161e89ecf1b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1660,8 +1670,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= @@ -1730,8 +1740,8 @@ golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= 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= @@ -1763,8 +1773,8 @@ golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= -golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= +golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4= +golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1781,8 +1791,9 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/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= @@ -1885,8 +1896,8 @@ golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1898,8 +1909,8 @@ golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/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= @@ -1997,8 +2008,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= -golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= -golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2294,8 +2305,8 @@ google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= 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= @@ -2363,43 +2374,41 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= -k8s.io/api v0.29.3 h1:2ORfZ7+bGC3YJqGpV0KSDDEVf8hdGQ6A03/50vj8pmw= -k8s.io/api v0.29.3/go.mod h1:y2yg2NTyHUUkIoTC+phinTnEa3KFM6RZ3szxt014a80= -k8s.io/apiextensions-apiserver v0.29.3 h1:9HF+EtZaVpFjStakF4yVufnXGPRppWFEQ87qnO91YeI= -k8s.io/apiextensions-apiserver v0.29.3/go.mod h1:po0XiY5scnpJfFizNGo6puNU6Fq6D70UJY2Cb2KwAVc= -k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU= -k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU= -k8s.io/apiserver v0.29.3 h1:xR7ELlJ/BZSr2n4CnD3lfA4gzFivh0wwfNfz9L0WZcE= -k8s.io/apiserver v0.29.3/go.mod h1:hrvXlwfRulbMbBgmWRQlFru2b/JySDpmzvQwwk4GUOs= -k8s.io/cli-runtime v0.29.3 h1:r68rephmmytoywkw2MyJ+CxjpasJDQY7AGc3XY2iv1k= -k8s.io/cli-runtime v0.29.3/go.mod h1:aqVUsk86/RhaGJwDhHXH0jcdqBrgdF3bZWk4Z9D4mkM= -k8s.io/client-go v0.29.3 h1:R/zaZbEAxqComZ9FHeQwOh3Y1ZUs7FaHKZdQtIc2WZg= -k8s.io/client-go v0.29.3/go.mod h1:tkDisCvgPfiRpxGnOORfkljmS+UrW+WtXAy2fTvXJB0= -k8s.io/cloud-provider v0.29.3 h1:y39hNq0lrPD1qmqQ2ykwMJGeWF9LsepVkR2a4wskwLc= -k8s.io/cloud-provider v0.29.3/go.mod h1:daDV1WkAO6pTrdsn7v8TpN/q9n75ExUC4RJDl7vlPKk= -k8s.io/code-generator v0.29.3 h1:m7E25/t9R9NvejspO2zBdyu+/Gl0Z5m7dCRc680KS14= -k8s.io/code-generator v0.29.3/go.mod h1:x47ofBhN4gxYFcxeKA1PYXeaPreAGaDN85Y/lNUsPoM= -k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo= -k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio= -k8s.io/component-helpers v0.29.3 h1:1dqZswuZgT2ZMixYeORyCUOAApXxgsvjVSgfoUT+P4o= -k8s.io/component-helpers v0.29.3/go.mod h1:yiDqbRQrnQY+sPju/bL7EkwDJb6LVOots53uZNMZBos= -k8s.io/controller-manager v0.29.3 h1:pvm3mirypgW7kM6dHRk6O5ANZj4bZTWirfk5gO6RlCo= -k8s.io/controller-manager v0.29.3/go.mod h1:RNxpf0d1WAo59sOLd32isWJP0oZ7Zxr+q4VEEaSq4gk= +k8s.io/apiextensions-apiserver v0.30.2 h1:l7Eue2t6QiLHErfn2vwK4KgF4NeDgjQkCXtEbOocKIE= +k8s.io/apiextensions-apiserver v0.30.2/go.mod h1:lsJFLYyK40iguuinsb3nt+Sj6CmodSI4ACDLep1rgjw= +k8s.io/apiserver v0.30.2 h1:ACouHiYl1yFI2VFI3YGM+lvxgy6ir4yK2oLOsLI1/tw= +k8s.io/apiserver v0.30.2/go.mod h1:BOTdFBIch9Sv0ypSEcUR6ew/NUFGocRFNl72Ra7wTm8= +k8s.io/cli-runtime v0.30.2 h1:ooM40eEJusbgHNEqnHziN9ZpLN5U4WcQGsdLKVxpkKE= +k8s.io/cli-runtime v0.30.2/go.mod h1:Y4g/2XezFyTATQUbvV5WaChoUGhojv/jZAtdp5Zkm0A= +k8s.io/cloud-provider v0.30.2 h1:yov6r02v7sMUNNvzEz51LtL2krn2c1wsC+dy/8BxKQI= +k8s.io/cloud-provider v0.30.2/go.mod h1:w69t2dSjDtI9BYK6SEqj6HmMKIojEk08fXRoUzjFN2I= +k8s.io/code-generator v0.30.2 h1:ZY1+aGkqZVwKIyGsOzquaeZ5rSfE6wZHur8z3jQAaiw= +k8s.io/code-generator v0.30.2/go.mod h1:RQP5L67QxqgkVquk704CyvWFIq0e6RCMmLTXxjE8dVA= +k8s.io/component-base v0.30.2 h1:pqGBczYoW1sno8q9ObExUqrYSKhtE5rW3y6gX88GZII= +k8s.io/component-base v0.30.2/go.mod h1:yQLkQDrkK8J6NtP+MGJOws+/PPeEXNpwFixsUI7h/OE= +k8s.io/component-helpers v0.30.2 h1:kDMYLiWEYeWU7H6jBI+Ua1i2hqNh0DzqDHNIppFC3po= +k8s.io/component-helpers v0.30.2/go.mod h1:tI0anfS6AbRqooaICkGg7UVAQLedOauVSQW9srDBnJw= +k8s.io/controller-manager v0.30.2 h1:tC7V7IdGUW2I4de3bXx4m2fS3naP7VlCYlECCajK9fU= +k8s.io/controller-manager v0.30.2/go.mod h1:CYltIHGhCgldEkXT5vS2JHCCWM1WyBI4kA2UfP9cZvY= k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70 h1:NGrVE502P0s0/1hudf8zjgwki1X/TByhmAoILTarmzo= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.110.1 h1:U/Af64HJf7FcwMcXyKm2RPM22WZzyR7OSpYj5tg3cL0= -k8s.io/klog/v2 v2.110.1/go.mod h1:YGtd1984u+GgbuZ7e08/yBuAfKLSO0+uR1Fhi6ExXjo= -k8s.io/kms v0.29.3 h1:ReljsAUhYlm2spdT4yXmY+9a8x8dc/OT4mXvwQPPteQ= -k8s.io/kms v0.29.3/go.mod h1:TBGbJKpRUMk59neTMDMddjIDL+D4HuFUbpuiuzmOPg0= -k8s.io/kube-controller-manager v0.29.3 h1:CZvh2FE0UrTh4gzSC0tohLQ8V0S1KQAiO2ARg6qNvdA= -k8s.io/kube-controller-manager v0.29.3/go.mod h1:Tf+BQG52nu8f2Ra9he9MsNFJ2sK7U3TSVvmTB+OVgiw= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/AuzbMm96cd3YHRTU83I780= -k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA= -k8s.io/kubelet v0.26.9 h1:+abHk/+qA8AD+1cfWCWkScLg3ye/sL0ToAhQ5xG5kcU= -k8s.io/kubelet v0.26.9/go.mod h1:b7p+z/h63qWQeHLa0eAphLbLJ2LEqQsx/SgirzmJhlU= -k8s.io/kubernetes v1.29.3 h1:EuOAKN4zpiP+kBx/0e9yS5iBkPSyLml19juOqZxBtDw= -k8s.io/kubernetes v1.29.3/go.mod h1:CP+Z+S9haxyB7J+nV6ywYry4dqlphArPXjcc0CsBVXc= +k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= +k8s.io/kms v0.30.2 h1:VSZILO/tkzrz5Tu2j+yFQZ2Dc5JerQZX2GqhFJbQrfw= +k8s.io/kms v0.30.2/go.mod h1:GrMurD0qk3G4yNgGcsCEmepqf9KyyIrTXYR2lyUOJC4= +k8s.io/kube-aggregator v0.30.2 h1:0+yk/ED6foCprY8VmkDPUhngjaAPKsNTXB/UrtvbIz0= +k8s.io/kube-aggregator v0.30.2/go.mod h1:EhqCfDdxysNWXk1wRL9SEHAdo1DKl6EULQagztkBcXE= +k8s.io/kube-controller-manager v0.30.2 h1:lLQKdk8iWrV1j7gKH0kirfc0YmlSl7xoHuqc8r7Fel0= +k8s.io/kube-controller-manager v0.30.2/go.mod h1:TzerTuCPZZvz5OOzYgRgbJDvXkeV6UggoqI4UhW+bSA= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= +k8s.io/kubelet v0.30.2 h1:Ck4E/pHndI20IzDXxS57dElhDGASPO5pzXF7BcKfmCY= +k8s.io/kubelet v0.30.2/go.mod h1:DSwwTbLQmdNkebAU7ypIALR4P9aXZNFwgRmedojUE94= +k8s.io/kubernetes v1.30.2 h1:11WhS78OYX/lnSy6TXxPO6Hk+E5K9ZNrEsk9JgMSX8I= +k8s.io/kubernetes v1.30.2/go.mod h1:yPbIk3MhmhGigX62FLJm+CphNtjxqCvAIFQXup6RKS0= k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI= k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= @@ -2459,12 +2468,12 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0 h1:TgtAeesdhpm2SGwkQasmbeqDo8th5wOBA5h/AjTKA4I= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.28.0/go.mod h1:VHVDI/KrK4fjnV61bE2g3sA7tiETLn8sooImelsCx3Y= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0 h1:/U5vjBbQn3RChhv7P11uhYvCSm5G2GaIi5AIGBS6r4c= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.29.0/go.mod h1:z7+wmGM2dfIiLRfrC6jb5kV2Mq/sK1ZP303cxzkV5Y4= sigs.k8s.io/cluster-api v1.5.2 h1:pCsyEHwTBb7n+U5Z2OA5STxdJ1EuSpJv8FLBx4lii3s= sigs.k8s.io/cluster-api v1.5.2/go.mod h1:EGJUNpFWi7dF426tO8MG/jE+w7T0UO5KyMnOwQ5riUY= -sigs.k8s.io/controller-runtime v0.16.3 h1:2TuvuokmfXvDUamSx1SuAOO3eTyye+47mJCigwG62c4= -sigs.k8s.io/controller-runtime v0.16.3/go.mod h1:j7bialYoSn142nv9sCOJmQgDXQXxnroFU4VnX/brVJ0= +sigs.k8s.io/controller-runtime v0.18.4 h1:87+guW1zhvuPLh1PHybKdYFLU0YJp4FhJRmiHvm5BZw= +sigs.k8s.io/controller-runtime v0.18.4/go.mod h1:TVoGrfdpbA9VRFaRnKgk9P5/atA0pMwq+f+msb9M8Sg= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo= sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0= sigs.k8s.io/kustomize/api v0.13.5-0.20230601165947-6ce0bf390ce3 h1:XX3Ajgzov2RKUdc5jW3t5jwY7Bo7dcRm+tFxT+NfgY0= diff --git a/internal/admission/initializer/interfaces.go b/internal/admission/initializer/interfaces.go deleted file mode 100644 index d85a07021e4..00000000000 --- a/internal/admission/initializer/interfaces.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package initializer - -import ( - "k8s.io/apiserver/pkg/admission" - - clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" -) - -// WantsInternalMinerInformerFactory defines a function which sets InformerFactory for admission plugins that need it. -type WantsInternalMinerInformerFactory interface { - admission.InitializationValidator - SetInternalMinerInformerFactory(informers.SharedInformerFactory) -} - -// WantsExternalMinerClientSet defines a function which sets external ClientSet for admission plugins that need it. -type WantsExternalMinerClientSet interface { - admission.InitializationValidator - SetExternalMinerClientSet(clientset.Interface) -} diff --git a/internal/apiserver/README.md b/internal/apiserver/README.md new file mode 100644 index 00000000000..52f047c6f95 --- /dev/null +++ b/internal/apiserver/README.md @@ -0,0 +1,5 @@ +# apiserver 目录 + +该目录存放 onex-apiserver 业务的逻辑,包括: +- registry: CURD 逻辑 +- admission: 动态准入控制 diff --git a/internal/admission/initializer/doc.go b/internal/apiserver/admission/initializer/doc.go similarity index 89% rename from internal/admission/initializer/doc.go rename to internal/apiserver/admission/initializer/doc.go index 233d055e2ba..6c44c545e91 100644 --- a/internal/admission/initializer/doc.go +++ b/internal/apiserver/admission/initializer/doc.go @@ -4,4 +4,4 @@ // this file is https://github.com/superproj/onex. // -package initializer // import "github.com/superproj/onex/internal/admission/initializer" +package initializer // import "github.com/superproj/onex/internal/controlplane/admission/initializer" diff --git a/internal/admission/initializer/initializer.go b/internal/apiserver/admission/initializer/initializer.go similarity index 73% rename from internal/admission/initializer/initializer.go rename to internal/apiserver/admission/initializer/initializer.go index 832a0cc8af8..2d534a48ee4 100644 --- a/internal/admission/initializer/initializer.go +++ b/internal/apiserver/admission/initializer/initializer.go @@ -10,12 +10,15 @@ import ( "k8s.io/apiserver/pkg/admission" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" ) type pluginInitializer struct { informers informers.SharedInformerFactory externalClient clientset.Interface + //authorizer authorizer.Authorizer + //featureGates featuregate.FeatureGate + stopCh <-chan struct{} } var _ admission.PluginInitializer = pluginInitializer{} @@ -34,11 +37,11 @@ func New( // Initialize checks the initialization interfaces implemented by a plugin // and provide the appropriate initialization data. func (i pluginInitializer) Initialize(plugin admission.Interface) { - if wants, ok := plugin.(WantsInternalMinerInformerFactory); ok { - wants.SetInternalMinerInformerFactory(i.informers) + if wants, ok := plugin.(WantsExternalInformerFactory); ok { + wants.SetInternalInformerFactory(i.informers) } - if wants, ok := plugin.(WantsExternalMinerClientSet); ok { - wants.SetExternalMinerClientSet(i.externalClient) + if wants, ok := plugin.(WantsExternalClientSet); ok { + wants.SetExternalClientSet(i.externalClient) } } diff --git a/internal/apiserver/admission/initializer/interfaces.go b/internal/apiserver/admission/initializer/interfaces.go new file mode 100644 index 00000000000..817e1172cfd --- /dev/null +++ b/internal/apiserver/admission/initializer/interfaces.go @@ -0,0 +1,26 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package initializer + +import ( + "k8s.io/apiserver/pkg/admission" + + clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/generated/informers" +) + +// WantsExternalInformerFactory defines a function which sets InformerFactory for admission plugins that need it. +type WantsExternalInformerFactory interface { + admission.InitializationValidator + SetInternalInformerFactory(informers.SharedInformerFactory) +} + +// WantsExternalClientSet defines a function which sets external ClientSet for admission plugins that need it. +type WantsExternalClientSet interface { + admission.InitializationValidator + SetExternalClientSet(clientset.Interface) +} diff --git a/internal/admission/plugin/deny/doc.go b/internal/apiserver/admission/plugin/doc.go similarity index 73% rename from internal/admission/plugin/deny/doc.go rename to internal/apiserver/admission/plugin/doc.go index a878dd4fb44..b2ced3228af 100644 --- a/internal/admission/plugin/deny/doc.go +++ b/internal/apiserver/admission/plugin/doc.go @@ -4,4 +4,4 @@ // this file is https://github.com/superproj/onex. // -package deny // import "github.com/superproj/onex/internal/admission/plugin/deny" +package plugin // import "github.com/superproj/onex/internal/controlplane/admission/plugin" diff --git a/internal/apiserver/admission/plugin/minerset/admission.go b/internal/apiserver/admission/plugin/minerset/admission.go new file mode 100644 index 00000000000..c2cff76ed60 --- /dev/null +++ b/internal/apiserver/admission/plugin/minerset/admission.go @@ -0,0 +1,177 @@ +/* +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 minerset contains an admission controller that modifies and validation every new MinerSet. +package minerset + +import ( + "context" + "fmt" + "io" + + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apiserver/pkg/admission" + + "github.com/superproj/onex/pkg/apis/apps" + clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/generated/informers" + appslisters "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" +) + +// PluginName indicates name of admission plugin. +const PluginName = "MinerSet" + +// Register registers a plugin +func Register(plugins *admission.Plugins) { + plugins.Register(PluginName, func(config io.Reader) (admission.Interface, error) { + return NewPlugin(), nil + }) +} + +// Plugin is an implementation of admission.Interface. +// It is validation and mutation plugin for MinerSet resource. +type Plugin struct { + *admission.Handler + lister appslisters.MinerSetLister + client clientset.Interface +} + +var _ admission.MutationInterface = &Plugin{} +var _ admission.ValidationInterface = &Plugin{} + +// Admit makes an admission decision based on the request attributes +func (p *Plugin) Admit(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) (err error) { + // Ignore all calls to subresources or resources other than minersets. + if shouldIgnore(attributes) { + return nil + } + + if !p.WaitForReady() { + return admission.NewForbidden(attributes, fmt.Errorf("not yet ready to handle request")) + } + // Deletion operation does not require Admission. + if attributes.GetOperation() == admission.Delete { + return nil + } + + ms, ok := attributes.GetObject().(*apps.MinerSet) + if err != nil { + return err + } + if !ok { + return apierrors.NewBadRequest("Resource was marked with kind MinerSet but was unable to be converted") + } + ms.Spec.Template.Spec.DisplayName = fmt.Sprintf("miner-for-%s-minerset", ms.Name) + // Ensure the label selector and template labels for the given MinerSet object. + addMinerSetSelector(ms) + + return nil +} + +// Validate do some validation on MinerSet. +func (p *Plugin) Validate(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) (err error) { + if shouldIgnore(attributes) { + return nil + } + + // Since we cannot obtain the specific resource when deleting, + // we need to first Get and then check here. + if attributes.GetOperation() == admission.Delete { + ms, err := p.lister.MinerSets(attributes.GetNamespace()).Get(attributes.GetName()) + if err != nil { + if apierrors.IsNotFound(err) { + return nil + } + return apierrors.NewInternalError(fmt.Errorf("can not get minerset: %s", attributes.GetName())) + } + + if v, ok := ms.GetAnnotations()[apps.AnnotationDeletionProtection]; ok && v == "true" { + return admission.NewForbidden(attributes, fmt.Errorf("minerset has deletion protection turned on")) + } + + return nil + } + + _, ok := attributes.GetObject().(*apps.MinerSet) + if !ok { + return apierrors.NewBadRequest("Resource was marked with kind MinerSet but was unable to be converted") + } + + // Here, we can add some validation logic. + var allErrs []error + if len(allErrs) > 0 { + return utilerrors.NewAggregate(allErrs) + } + + return nil +} + +// addMinerSetSelector sets the label selector and template labels for the given MinerSet object. +// This function ensures that the MinerSet's Spec.Selector matches the template's labels, +// allowing the MinerSet to select the correct Miner. +func addMinerSetSelector(ms *apps.MinerSet) { + // Set the Spec.Selector field to a LabelSelector that matches the MinerSet's name + ms.Spec.Selector = metav1.LabelSelector{ + MatchLabels: map[string]string{ + apps.LabelMinerSet: ms.Name, + }, + } + + // Ensure the template's labels include the MinerSet label + // If the labels map is nil, initialize it + if ms.Spec.Template.ObjectMeta.Labels == nil { + ms.Spec.Template.ObjectMeta.Labels = map[string]string{} + } + ms.Spec.Template.ObjectMeta.Labels[apps.LabelMinerSet] = ms.Name +} + +// SetInternalInformerFactory gets Lister from SharedInformerFactory. +// The lister knows how to lists MinerSets. +func (p *Plugin) SetInternalInformerFactory(f informers.SharedInformerFactory) { + p.lister = f.Apps().V1beta1().MinerSets().Lister() + p.SetReadyFunc(f.Apps().V1beta1().MinerSets().Informer().HasSynced) +} + +// SetExternalClientSet implements the WantsExternalClientSet interface. +func (p *Plugin) SetExternalClientSet(client clientset.Interface) { + p.client = client +} + +// ValidateInitialization checks whether the plugin was correctly initialized. +func (p *Plugin) ValidateInitialization() error { + if p.lister == nil { + return fmt.Errorf("%s requires a machine lister", PluginName) + } + return nil +} + +func shouldIgnore(attributes admission.Attributes) bool { + // Ignore all calls to subresources or resources other than minersets. + if len(attributes.GetSubresource()) != 0 || attributes.GetResource().GroupResource() != apps.Resource("minersets") { + return true + } + + return false +} + +// NewPlugin creates a new always minerset admission control handler. +func NewPlugin() *Plugin { + return &Plugin{ + Handler: admission.NewHandler(admission.Create, admission.Update, admission.Delete), + } +} diff --git a/internal/registry/apps/OWNERS b/internal/apiserver/registry/apps/OWNERS similarity index 100% rename from internal/registry/apps/OWNERS rename to internal/apiserver/registry/apps/OWNERS diff --git a/internal/registry/apps/chain/doc.go b/internal/apiserver/registry/apps/chain/doc.go similarity index 100% rename from internal/registry/apps/chain/doc.go rename to internal/apiserver/registry/apps/chain/doc.go diff --git a/internal/registry/apps/chain/storage/doc.go b/internal/apiserver/registry/apps/chain/storage/doc.go similarity index 78% rename from internal/registry/apps/chain/storage/doc.go rename to internal/apiserver/registry/apps/chain/storage/doc.go index a572cfaab0b..fd51a7cd887 100644 --- a/internal/registry/apps/chain/storage/doc.go +++ b/internal/apiserver/registry/apps/chain/storage/doc.go @@ -6,4 +6,4 @@ // Package storage provides Registry interface and its REST // implementation for storing chain api objects. -package storage // import "github.com/superproj/onex/internal/registry/apps/chain/storage" +package storage // import "github.com/superproj/onex/internal/apiserver/registry/apps/chain/storage" diff --git a/internal/registry/apps/chain/storage/storage.go b/internal/apiserver/registry/apps/chain/storage/storage.go similarity index 98% rename from internal/registry/apps/chain/storage/storage.go rename to internal/apiserver/registry/apps/chain/storage/storage.go index e33070f352f..25dcb864002 100644 --- a/internal/registry/apps/chain/storage/storage.go +++ b/internal/apiserver/registry/apps/chain/storage/storage.go @@ -20,7 +20,7 @@ import ( "sigs.k8s.io/structured-merge-diff/v4/fieldpath" printersinternal "github.com/superproj/onex/internal/pkg/printers/internalversion" - "github.com/superproj/onex/internal/registry/apps/chain" + "github.com/superproj/onex/internal/apiserver/registry/apps/chain" "github.com/superproj/onex/pkg/apis/apps" ) diff --git a/internal/registry/apps/chain/strategy.go b/internal/apiserver/registry/apps/chain/strategy.go similarity index 100% rename from internal/registry/apps/chain/strategy.go rename to internal/apiserver/registry/apps/chain/strategy.go diff --git a/internal/registry/apps/miner/doc.go b/internal/apiserver/registry/apps/miner/doc.go similarity index 80% rename from internal/registry/apps/miner/doc.go rename to internal/apiserver/registry/apps/miner/doc.go index b502cdfc6ba..cbfc536de37 100644 --- a/internal/registry/apps/miner/doc.go +++ b/internal/apiserver/registry/apps/miner/doc.go @@ -6,4 +6,4 @@ // Package miner provides Registry interface and its RESTStorage // implementation for storing Miner objects. -package miner // import "github.com/superproj/onex/internal/registry/apps/miner" +package miner // import "github.com/superproj/onex/internal/apiserver/registry/apps/miner" diff --git a/internal/registry/apps/miner/storage/doc.go b/internal/apiserver/registry/apps/miner/storage/doc.go similarity index 78% rename from internal/registry/apps/miner/storage/doc.go rename to internal/apiserver/registry/apps/miner/storage/doc.go index 91c1de03694..2c1cdd2f87c 100644 --- a/internal/registry/apps/miner/storage/doc.go +++ b/internal/apiserver/registry/apps/miner/storage/doc.go @@ -6,4 +6,4 @@ // Package storage provides Registry interface and its REST // implementation for storing miner api objects. -package storage // import "github.com/superproj/onex/internal/registry/apps/miner/storage" +package storage // import "github.com/superproj/onex/internal/apiserver/registry/apps/miner/storage" diff --git a/internal/registry/apps/miner/storage/storage.go b/internal/apiserver/registry/apps/miner/storage/storage.go similarity index 98% rename from internal/registry/apps/miner/storage/storage.go rename to internal/apiserver/registry/apps/miner/storage/storage.go index 1b10620204f..b18ee88e5c1 100644 --- a/internal/registry/apps/miner/storage/storage.go +++ b/internal/apiserver/registry/apps/miner/storage/storage.go @@ -19,7 +19,7 @@ import ( "sigs.k8s.io/structured-merge-diff/v4/fieldpath" printersinternal "github.com/superproj/onex/internal/pkg/printers/internalversion" - "github.com/superproj/onex/internal/registry/apps/miner" + "github.com/superproj/onex/internal/apiserver/registry/apps/miner" "github.com/superproj/onex/pkg/apis/apps" ) diff --git a/internal/registry/apps/miner/strategy.go b/internal/apiserver/registry/apps/miner/strategy.go similarity index 100% rename from internal/registry/apps/miner/strategy.go rename to internal/apiserver/registry/apps/miner/strategy.go diff --git a/internal/registry/apps/minerset/doc.go b/internal/apiserver/registry/apps/minerset/doc.go similarity index 79% rename from internal/registry/apps/minerset/doc.go rename to internal/apiserver/registry/apps/minerset/doc.go index cd491237c9e..fda4c1950d4 100644 --- a/internal/registry/apps/minerset/doc.go +++ b/internal/apiserver/registry/apps/minerset/doc.go @@ -6,4 +6,4 @@ // Package minerset provides Registry interface and its RESTStorage // implementation for storing Miner objects. -package minerset // import "github.com/superproj/onex/internal/registry/apps/minerset" +package minerset // import "github.com/superproj/onex/internal/apiserver/registry/apps/minerset" diff --git a/internal/registry/apps/minerset/storage/doc.go b/internal/apiserver/registry/apps/minerset/storage/doc.go similarity index 78% rename from internal/registry/apps/minerset/storage/doc.go rename to internal/apiserver/registry/apps/minerset/storage/doc.go index 0c3135cef9f..380cd57ccbe 100644 --- a/internal/registry/apps/minerset/storage/doc.go +++ b/internal/apiserver/registry/apps/minerset/storage/doc.go @@ -6,4 +6,4 @@ // Package storage provides Registry interface and its REST // implementation for storing minerset api objects. -package storage // import "github.com/superproj/onex/internal/registry/apps/minerset/storage" +package storage // import "github.com/superproj/onex/internal/apiserver/registry/apps/minerset/storage" diff --git a/internal/registry/apps/minerset/storage/storage.go b/internal/apiserver/registry/apps/minerset/storage/storage.go similarity index 99% rename from internal/registry/apps/minerset/storage/storage.go rename to internal/apiserver/registry/apps/minerset/storage/storage.go index cb708756657..f21f935786a 100644 --- a/internal/registry/apps/minerset/storage/storage.go +++ b/internal/apiserver/registry/apps/minerset/storage/storage.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/structured-merge-diff/v4/fieldpath" printersinternal "github.com/superproj/onex/internal/pkg/printers/internalversion" - "github.com/superproj/onex/internal/registry/apps/minerset" + "github.com/superproj/onex/internal/apiserver/registry/apps/minerset" "github.com/superproj/onex/pkg/apis/apps" ) diff --git a/internal/registry/apps/minerset/strategy.go b/internal/apiserver/registry/apps/minerset/strategy.go similarity index 100% rename from internal/registry/apps/minerset/strategy.go rename to internal/apiserver/registry/apps/minerset/strategy.go diff --git a/internal/admission/plugin/admit/doc.go b/internal/apiserver/registry/apps/rest/doc.go similarity index 74% rename from internal/admission/plugin/admit/doc.go rename to internal/apiserver/registry/apps/rest/doc.go index 421572d2736..634d9064ae0 100644 --- a/internal/admission/plugin/admit/doc.go +++ b/internal/apiserver/registry/apps/rest/doc.go @@ -4,4 +4,4 @@ // this file is https://github.com/superproj/onex. // -package admit // import "github.com/superproj/onex/internal/admission/plugin/admit" +package rest // import "github.com/superproj/onex/internal/apiserver/registry/apps/rest" diff --git a/internal/registry/apps/rest/storage_apps.go b/internal/apiserver/registry/apps/rest/storage_apps.go similarity index 91% rename from internal/registry/apps/rest/storage_apps.go rename to internal/apiserver/registry/apps/rest/storage_apps.go index 594cdb69cda..1d87ced0f70 100644 --- a/internal/registry/apps/rest/storage_apps.go +++ b/internal/apiserver/registry/apps/rest/storage_apps.go @@ -13,11 +13,11 @@ import ( serverstorage "k8s.io/apiserver/pkg/server/storage" "k8s.io/kubernetes/pkg/api/legacyscheme" - "github.com/superproj/onex/internal/apiserver/storage" + "github.com/superproj/onex/internal/controlplane/storage" serializerutil "github.com/superproj/onex/internal/pkg/util/serializer" - chainstore "github.com/superproj/onex/internal/registry/apps/chain/storage" - minerstore "github.com/superproj/onex/internal/registry/apps/miner/storage" - minersetstore "github.com/superproj/onex/internal/registry/apps/minerset/storage" + chainstore "github.com/superproj/onex/internal/apiserver/registry/apps/chain/storage" + minerstore "github.com/superproj/onex/internal/apiserver/registry/apps/miner/storage" + minersetstore "github.com/superproj/onex/internal/apiserver/registry/apps/minerset/storage" "github.com/superproj/onex/pkg/apis/apps" "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) diff --git a/internal/controller/alias.go b/internal/controller/alias.go index 6b18f0e4bd7..f244ca89e07 100644 --- a/internal/controller/alias.go +++ b/internal/controller/alias.go @@ -109,6 +109,7 @@ func (r *SyncReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, return nil } +/* // NamespacedResourcesDeleterReconciler is a reconciler used to delete a namespace with all resources in it. type NamespacedResourcesDeleterReconciler struct { Client clientset.Interface @@ -118,3 +119,4 @@ type NamespacedResourcesDeleterReconciler struct { func (r *NamespacedResourcesDeleterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { return namespacecontroller.NewNamespacedResourcesDeleter(mgr, r.Client, r.MetadataClient).SetupWithManager(mgr, options) } +*/ diff --git a/internal/controller/apis/config/types.go b/internal/controller/apis/config/types.go index 2bcd58ea607..b3fc5a192ec 100644 --- a/internal/controller/apis/config/types.go +++ b/internal/controller/apis/config/types.go @@ -20,7 +20,7 @@ type OneXControllerManagerConfiguration struct { metav1.TypeMeta // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental features. - FeatureGates map[string]bool + //FeatureGates map[string]bool // Generic holds configuration for a generic controller-manager Generic GenericControllerManagerConfiguration @@ -74,6 +74,13 @@ type GenericControllerManagerConfiguration struct { // Label value that the controller watches to reconcile cloud miner objects WatchFilterValue string + + // Controllers is the list of controllers to enable or disable + // '*' means "all enabled by default controllers" + // 'foo' means "enable 'foo'" + // '-foo' means "disable 'foo'" + // first item for a particular name wins + Controllers []string } type ChainControllerConfiguration struct { diff --git a/internal/controller/apis/config/v1beta1/defaults.go b/internal/controller/apis/config/v1beta1/defaults.go index be487c6460d..078c1a46649 100644 --- a/internal/controller/apis/config/v1beta1/defaults.go +++ b/internal/controller/apis/config/v1beta1/defaults.go @@ -26,10 +26,6 @@ func addDefaultingFuncs(scheme *runtime.Scheme) error { } func SetDefaults_OneXControllerManagerConfiguration(obj *OneXControllerManagerConfiguration) { - if obj.FeatureGates == nil { - obj.FeatureGates = make(map[string]bool) - } - RecommendedDefaultGenericControllerManagerConfiguration(&obj.Generic) RecommendedDefaultGarbageCollectorControllerConfiguration(&obj.GarbageCollectorController) RecommendedDefaultChainControllerConfiguration(&obj.ChainController) diff --git a/internal/controller/apis/config/v1beta1/types.go b/internal/controller/apis/config/v1beta1/types.go index 960a820bc8a..697790e557d 100644 --- a/internal/controller/apis/config/v1beta1/types.go +++ b/internal/controller/apis/config/v1beta1/types.go @@ -28,7 +28,7 @@ type OneXControllerManagerConfiguration struct { metav1.TypeMeta `json:",inline"` // FeatureGates is a map of feature names to bools that enable or disable alpha/experimental features. - FeatureGates map[string]bool `json:"featureGates,omitempty"` + // FeatureGates map[string]bool `json:"featureGates,omitempty"` // Generic holds configuration for a generic controller-manager Generic GenericControllerManagerConfiguration `json:"generic,omitempty"` @@ -82,6 +82,13 @@ type GenericControllerManagerConfiguration struct { // Label value that the controller watches to reconcile cloud miner objects WatchFilterValue string `json:"watchFilterValue,omitempty"` + + // Controllers is the list of controllers to enable or disable + // '*' means "all enabled by default controllers" + // 'foo' means "enable 'foo'" + // '-foo' means "disable 'foo'" + // first item for a particular name wins + Controllers []string `json:"controllers,omitempty"` } type ChainControllerConfiguration struct { diff --git a/internal/controller/apis/config/v1beta1/zz_generated.conversion.go b/internal/controller/apis/config/v1beta1/zz_generated.conversion.go index 8c69e2f331d..1935133847c 100644 --- a/internal/controller/apis/config/v1beta1/zz_generated.conversion.go +++ b/internal/controller/apis/config/v1beta1/zz_generated.conversion.go @@ -13,13 +13,12 @@ package v1beta1 import ( unsafe "unsafe" + config "github.com/superproj/onex/internal/controller/apis/config" + configv1beta1 "github.com/superproj/onex/pkg/config/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" v1alpha1 "k8s.io/component-base/config/v1alpha1" - - config "github.com/superproj/onex/internal/controller/apis/config" - configv1beta1 "github.com/superproj/onex/pkg/config/v1beta1" ) func init() { @@ -29,52 +28,52 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ChainControllerConfiguration)(nil), (*config.ChainControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*ChainControllerConfiguration)(nil), (*config.ChainControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ChainControllerConfiguration_To_config_ChainControllerConfiguration(a.(*ChainControllerConfiguration), b.(*config.ChainControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.ChainControllerConfiguration)(nil), (*ChainControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.ChainControllerConfiguration)(nil), (*ChainControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_ChainControllerConfiguration_To_v1beta1_ChainControllerConfiguration(a.(*config.ChainControllerConfiguration), b.(*ChainControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*GarbageCollectorControllerConfiguration)(nil), (*config.GarbageCollectorControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*GarbageCollectorControllerConfiguration)(nil), (*config.GarbageCollectorControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_GarbageCollectorControllerConfiguration_To_config_GarbageCollectorControllerConfiguration(a.(*GarbageCollectorControllerConfiguration), b.(*config.GarbageCollectorControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.GarbageCollectorControllerConfiguration)(nil), (*GarbageCollectorControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.GarbageCollectorControllerConfiguration)(nil), (*GarbageCollectorControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_GarbageCollectorControllerConfiguration_To_v1beta1_GarbageCollectorControllerConfiguration(a.(*config.GarbageCollectorControllerConfiguration), b.(*GarbageCollectorControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*GenericControllerManagerConfiguration)(nil), (*config.GenericControllerManagerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*GenericControllerManagerConfiguration)(nil), (*config.GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(a.(*GenericControllerManagerConfiguration), b.(*config.GenericControllerManagerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.GenericControllerManagerConfiguration)(nil), (*GenericControllerManagerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.GenericControllerManagerConfiguration)(nil), (*GenericControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_GenericControllerManagerConfiguration_To_v1beta1_GenericControllerManagerConfiguration(a.(*config.GenericControllerManagerConfiguration), b.(*GenericControllerManagerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*GroupResource)(nil), (*config.GroupResource)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*GroupResource)(nil), (*config.GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_GroupResource_To_config_GroupResource(a.(*GroupResource), b.(*config.GroupResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.GroupResource)(nil), (*GroupResource)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.GroupResource)(nil), (*GroupResource)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_GroupResource_To_v1beta1_GroupResource(a.(*config.GroupResource), b.(*GroupResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OneXControllerManagerConfiguration)(nil), (*config.OneXControllerManagerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*OneXControllerManagerConfiguration)(nil), (*config.OneXControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_OneXControllerManagerConfiguration_To_config_OneXControllerManagerConfiguration(a.(*OneXControllerManagerConfiguration), b.(*config.OneXControllerManagerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.OneXControllerManagerConfiguration)(nil), (*OneXControllerManagerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.OneXControllerManagerConfiguration)(nil), (*OneXControllerManagerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_OneXControllerManagerConfiguration_To_v1beta1_OneXControllerManagerConfiguration(a.(*config.OneXControllerManagerConfiguration), b.(*OneXControllerManagerConfiguration), scope) }); err != nil { return err @@ -145,6 +144,7 @@ func autoConvert_v1beta1_GenericControllerManagerConfiguration_To_config_Generic out.Parallelism = in.Parallelism out.SyncPeriod = in.SyncPeriod out.WatchFilterValue = in.WatchFilterValue + out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers)) return nil } @@ -168,6 +168,7 @@ func autoConvert_config_GenericControllerManagerConfiguration_To_v1beta1_Generic out.Parallelism = in.Parallelism out.SyncPeriod = in.SyncPeriod out.WatchFilterValue = in.WatchFilterValue + out.Controllers = *(*[]string)(unsafe.Pointer(&in.Controllers)) return nil } @@ -199,7 +200,6 @@ func Convert_config_GroupResource_To_v1beta1_GroupResource(in *config.GroupResou } func autoConvert_v1beta1_OneXControllerManagerConfiguration_To_config_OneXControllerManagerConfiguration(in *OneXControllerManagerConfiguration, out *config.OneXControllerManagerConfiguration, s conversion.Scope) error { - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) if err := Convert_v1beta1_GenericControllerManagerConfiguration_To_config_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil { return err } @@ -218,7 +218,6 @@ func Convert_v1beta1_OneXControllerManagerConfiguration_To_config_OneXController } func autoConvert_config_OneXControllerManagerConfiguration_To_v1beta1_OneXControllerManagerConfiguration(in *config.OneXControllerManagerConfiguration, out *OneXControllerManagerConfiguration, s conversion.Scope) error { - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) if err := Convert_config_GenericControllerManagerConfiguration_To_v1beta1_GenericControllerManagerConfiguration(&in.Generic, &out.Generic, s); err != nil { return err } diff --git a/internal/controller/apis/config/v1beta1/zz_generated.deepcopy.go b/internal/controller/apis/config/v1beta1/zz_generated.deepcopy.go index 3a873ab5b14..03d311915b2 100644 --- a/internal/controller/apis/config/v1beta1/zz_generated.deepcopy.go +++ b/internal/controller/apis/config/v1beta1/zz_generated.deepcopy.go @@ -62,6 +62,11 @@ func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericContro out.MySQL = in.MySQL in.LeaderElection.DeepCopyInto(&out.LeaderElection) out.SyncPeriod = in.SyncPeriod + if in.Controllers != nil { + in, out := &in.Controllers, &out.Controllers + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -95,13 +100,6 @@ func (in *GroupResource) DeepCopy() *GroupResource { func (in *OneXControllerManagerConfiguration) DeepCopyInto(out *OneXControllerManagerConfiguration) { *out = *in out.TypeMeta = in.TypeMeta - if in.FeatureGates != nil { - in, out := &in.FeatureGates, &out.FeatureGates - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } in.Generic.DeepCopyInto(&out.Generic) in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController) out.ChainController = in.ChainController diff --git a/internal/controller/apis/config/v1beta1/zz_generated.defaults.go b/internal/controller/apis/config/v1beta1/zz_generated.defaults.go index 3d4e8c061c3..6f4d8e8afc3 100644 --- a/internal/controller/apis/config/v1beta1/zz_generated.defaults.go +++ b/internal/controller/apis/config/v1beta1/zz_generated.defaults.go @@ -18,7 +18,7 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&OneXControllerManagerConfiguration{}, func(obj any) { + scheme.AddTypeDefaultingFunc(&OneXControllerManagerConfiguration{}, func(obj interface{}) { SetObjectDefaults_OneXControllerManagerConfiguration(obj.(*OneXControllerManagerConfiguration)) }) return nil diff --git a/internal/controller/apis/config/validation/validation.go b/internal/controller/apis/config/validation/validation.go index 13c9cf41024..778c9be40c4 100644 --- a/internal/controller/apis/config/validation/validation.go +++ b/internal/controller/apis/config/validation/validation.go @@ -8,7 +8,6 @@ package validation import ( "k8s.io/apimachinery/pkg/util/validation/field" - utilfeature "k8s.io/apiserver/pkg/util/feature" componentbasevalidation "k8s.io/component-base/config/validation" "github.com/superproj/onex/internal/controller/apis/config" @@ -21,11 +20,6 @@ func Validate(cc *config.OneXControllerManagerConfiguration) field.ErrorList { allErrs := field.ErrorList{} newPath := field.NewPath("OneXControllerManagerConfiguration") - effectiveFeatures := utilfeature.DefaultFeatureGate.DeepCopy() - if err := effectiveFeatures.SetFromMap(cc.FeatureGates); err != nil { - allErrs = append(allErrs, field.Invalid(newPath.Child("featureGates"), cc.FeatureGates, err.Error())) - } - allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.Generic.LeaderElection, field.NewPath("generic", "leaderElection"))...) allErrs = append(allErrs, cmvalidation.ValidateMySQLConfiguration(&cc.Generic.MySQL, field.NewPath("generic", "mysql"))...) diff --git a/internal/controller/apis/config/zz_generated.deepcopy.go b/internal/controller/apis/config/zz_generated.deepcopy.go index 52a02fa3ad3..42ede41a5fc 100644 --- a/internal/controller/apis/config/zz_generated.deepcopy.go +++ b/internal/controller/apis/config/zz_generated.deepcopy.go @@ -57,6 +57,11 @@ func (in *GenericControllerManagerConfiguration) DeepCopyInto(out *GenericContro out.MySQL = in.MySQL out.LeaderElection = in.LeaderElection out.SyncPeriod = in.SyncPeriod + if in.Controllers != nil { + in, out := &in.Controllers, &out.Controllers + *out = make([]string, len(*in)) + copy(*out, *in) + } return } @@ -90,14 +95,7 @@ func (in *GroupResource) DeepCopy() *GroupResource { func (in *OneXControllerManagerConfiguration) DeepCopyInto(out *OneXControllerManagerConfiguration) { *out = *in out.TypeMeta = in.TypeMeta - if in.FeatureGates != nil { - in, out := &in.FeatureGates, &out.FeatureGates - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - out.Generic = in.Generic + in.Generic.DeepCopyInto(&out.Generic) in.GarbageCollectorController.DeepCopyInto(&out.GarbageCollectorController) out.ChainController = in.ChainController return diff --git a/internal/controller/miner/apis/config/v1beta1/zz_generated.conversion.go b/internal/controller/miner/apis/config/v1beta1/zz_generated.conversion.go index cff75b6f03d..3c08438e81c 100644 --- a/internal/controller/miner/apis/config/v1beta1/zz_generated.conversion.go +++ b/internal/controller/miner/apis/config/v1beta1/zz_generated.conversion.go @@ -13,12 +13,11 @@ package v1beta1 import ( unsafe "unsafe" + config "github.com/superproj/onex/internal/controller/miner/apis/config" + configv1beta1 "github.com/superproj/onex/pkg/config/v1beta1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" v1alpha1 "k8s.io/component-base/config/v1alpha1" - - config "github.com/superproj/onex/internal/controller/miner/apis/config" - configv1beta1 "github.com/superproj/onex/pkg/config/v1beta1" ) func init() { @@ -28,22 +27,22 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*MinerControllerConfiguration)(nil), (*config.MinerControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerControllerConfiguration)(nil), (*config.MinerControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerControllerConfiguration_To_config_MinerControllerConfiguration(a.(*MinerControllerConfiguration), b.(*config.MinerControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.MinerControllerConfiguration)(nil), (*MinerControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.MinerControllerConfiguration)(nil), (*MinerControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_MinerControllerConfiguration_To_v1beta1_MinerControllerConfiguration(a.(*config.MinerControllerConfiguration), b.(*MinerControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerProfile)(nil), (*config.MinerProfile)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerProfile)(nil), (*config.MinerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerProfile_To_config_MinerProfile(a.(*MinerProfile), b.(*config.MinerProfile), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.MinerProfile)(nil), (*MinerProfile)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.MinerProfile)(nil), (*MinerProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_MinerProfile_To_v1beta1_MinerProfile(a.(*config.MinerProfile), b.(*MinerProfile), scope) }); err != nil { return err diff --git a/internal/controller/miner/apis/config/v1beta1/zz_generated.defaults.go b/internal/controller/miner/apis/config/v1beta1/zz_generated.defaults.go index b72b78352dc..bbd3eebdc63 100644 --- a/internal/controller/miner/apis/config/v1beta1/zz_generated.defaults.go +++ b/internal/controller/miner/apis/config/v1beta1/zz_generated.defaults.go @@ -18,7 +18,7 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&MinerControllerConfiguration{}, func(obj any) { + scheme.AddTypeDefaultingFunc(&MinerControllerConfiguration{}, func(obj interface{}) { SetObjectDefaults_MinerControllerConfiguration(obj.(*MinerControllerConfiguration)) }) return nil diff --git a/internal/controller/miner/controller.go b/internal/controller/miner/controller.go index 7eeacaf63bf..22a2d27e05c 100644 --- a/internal/controller/miner/controller.go +++ b/internal/controller/miner/controller.go @@ -20,13 +20,11 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" - builderruntime "sigs.k8s.io/controller-runtime/pkg/builder" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" - "sigs.k8s.io/controller-runtime/pkg/source" "github.com/superproj/onex/internal/controller/miner/apis/config" @@ -56,6 +54,7 @@ type Reconciler struct { DryRun bool ProviderClient kubernetes.Interface + ProviderCluster cluster.Cluster RedisClient *redis.Client ComponentConfig *config.MinerControllerConfiguration @@ -68,7 +67,7 @@ type Reconciler struct { ssaCache ssa.Cache } -func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options, providerCluster cluster.Cluster) error { +func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { if r.podDeletionRetryTimeout.Nanoseconds() == 0 { r.podDeletionRetryTimeout = 10 * time.Second } @@ -80,15 +79,16 @@ func (r *Reconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, opt WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)) if !r.DryRun { + var obj client.Object = &corev1.Pod{} builder = builder.WatchesRawSource( - source.Kind(providerCluster.GetCache(), &corev1.Pod{}), - handler.EnqueueRequestsFromMapFunc(r.PodToMiners), - builderruntime.WithPredicates( - predicates.All(ctrl.LoggerFrom(ctx), + source.Kind(r.ProviderCluster.GetCache(), obj, handler.EnqueueRequestsFromMapFunc(r.PodToMiners), + predicates.All( + ctrl.LoggerFrom(ctx), predicates.Any(ctrl.LoggerFrom(ctx), predicates.MinerSetUnpaused(ctrl.LoggerFrom(ctx))), predicates.ResourceHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue), ), - )) + ), + ) } if _, err := builder.Build(r); err != nil { diff --git a/internal/controller/minerset/apis/config/v1beta1/zz_generated.conversion.go b/internal/controller/minerset/apis/config/v1beta1/zz_generated.conversion.go index c1102c52225..7a1d8c2244c 100644 --- a/internal/controller/minerset/apis/config/v1beta1/zz_generated.conversion.go +++ b/internal/controller/minerset/apis/config/v1beta1/zz_generated.conversion.go @@ -13,11 +13,10 @@ package v1beta1 import ( unsafe "unsafe" + config "github.com/superproj/onex/internal/controller/minerset/apis/config" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" v1alpha1 "k8s.io/component-base/config/v1alpha1" - - config "github.com/superproj/onex/internal/controller/minerset/apis/config" ) func init() { @@ -27,12 +26,12 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*MinerSetControllerConfiguration)(nil), (*config.MinerSetControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerSetControllerConfiguration)(nil), (*config.MinerSetControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerSetControllerConfiguration_To_config_MinerSetControllerConfiguration(a.(*MinerSetControllerConfiguration), b.(*config.MinerSetControllerConfiguration), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*config.MinerSetControllerConfiguration)(nil), (*MinerSetControllerConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*config.MinerSetControllerConfiguration)(nil), (*MinerSetControllerConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_MinerSetControllerConfiguration_To_v1beta1_MinerSetControllerConfiguration(a.(*config.MinerSetControllerConfiguration), b.(*MinerSetControllerConfiguration), scope) }); err != nil { return err diff --git a/internal/controller/minerset/apis/config/v1beta1/zz_generated.defaults.go b/internal/controller/minerset/apis/config/v1beta1/zz_generated.defaults.go index 1c33e2343a2..ef0f17f4a67 100644 --- a/internal/controller/minerset/apis/config/v1beta1/zz_generated.defaults.go +++ b/internal/controller/minerset/apis/config/v1beta1/zz_generated.defaults.go @@ -18,7 +18,7 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&MinerSetControllerConfiguration{}, func(obj any) { + scheme.AddTypeDefaultingFunc(&MinerSetControllerConfiguration{}, func(obj interface{}) { SetObjectDefaults_MinerSetControllerConfiguration(obj.(*MinerSetControllerConfiguration)) }) return nil diff --git a/internal/controller/minerset/controller.go b/internal/controller/minerset/controller.go index 8b7fc20eb21..a3cee37f140 100644 --- a/internal/controller/minerset/controller.go +++ b/internal/controller/minerset/controller.go @@ -775,7 +775,7 @@ func (r *Reconciler) createMiners(ctx context.Context, ms *v1beta1.MinerSet, con eg.Go(func() error { select { case <-ctx.Done(): - return nil + return ctx.Err() default: miner := r.computeDesiredMiner(ms, nil) diff --git a/internal/controller/namespace/controller.go b/internal/controller/namespace/controller.go index 55fb1119968..4e70c788e77 100644 --- a/internal/controller/namespace/controller.go +++ b/internal/controller/namespace/controller.go @@ -14,10 +14,8 @@ import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/errors" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" @@ -31,12 +29,27 @@ import ( clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" v1clientset "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/core/v1" + //clientset "k8s.io/client-go/kubernetes" + //v1clientset "k8s.io/client-go/kubernetes/typed/core/v1" ) const controllerName = "controller-manager.namespace" -// NamespacedResourcesDeleter is a reconciler used to delete a namespace with all resources in it. -type NamespacedResourcesDeleter struct { +// namespacedResourcesDeleter deletes all resources in the given namespace. +// Before deleting resources: +// - It ensures that deletion timestamp is set on the +// namespace (does nothing if deletion timestamp is missing). +// - Verifies that the namespace is in the "terminating" phase +// (updates the namespace phase if it is not yet marked terminating) +// +// After deleting the resources: +// * It removes finalizer token from the given namespace. +// +// Returns an error if any of those steps fail. +// Returns ResourcesRemainingError if it deleted some resources but needs +// to wait for them to go away. +// Caller is expected to keep calling this until it succeeds. +type namespacedResourcesDeleter struct { client.Client // Client to manipulate the namespace. nsClient v1clientset.NamespaceInterface @@ -50,9 +63,9 @@ type NamespacedResourcesDeleter struct { finalizerToken v1.FinalizerName } -// newReconciler returns a new reconcile.Reconciler. -func NewNamespacedResourcesDeleter(mgr manager.Manager, client clientset.Interface, metadataClient metadata.Interface) *NamespacedResourcesDeleter { - return &NamespacedResourcesDeleter{ +// NewNamespacedResourcesDeleter returns a new reconcile.Reconciler. +func NewNamespacedResourcesDeleter(mgr manager.Manager, client clientset.Interface, metadataClient metadata.Interface) *namespacedResourcesDeleter { + return &namespacedResourcesDeleter{ Client: mgr.GetClient(), nsClient: client.CoreV1().Namespaces(), metadataClient: metadataClient, @@ -65,32 +78,37 @@ func NewNamespacedResourcesDeleter(mgr manager.Manager, client clientset.Interfa } // SetupWithManager sets up the controller with the Manager. -func (r *NamespacedResourcesDeleter) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (d *namespacedResourcesDeleter) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { return ctrl.NewControllerManagedBy(mgr). For(&v1.Namespace{}). WithOptions(options). Named(controllerName). - Complete(r) + Complete(d) } // reconcile reads that state of the cluster for a RollingUpgrade object and makes changes based on the state read // and the details in the RollingUpgrade.Spec. -func (r *NamespacedResourcesDeleter) Reconcile(ctx context.Context, rq ctrl.Request) (ctrl.Result, error) { +func (d *namespacedResourcesDeleter) Reconcile(ctx context.Context, rq ctrl.Request) (ctrl.Result, error) { namespace := &v1.Namespace{} - err := r.Get(ctx, rq.NamespacedName, namespace) + err := d.Get(ctx, rq.NamespacedName, namespace) if err != nil { return ctrl.Result{}, client.IgnoreNotFound(err) } + startTime := time.Now() + defer func() { + klog.V(4).InfoS("Finished syncing namespace", "namespace", klog.KObj(namespace), "duration", time.Since(startTime)) + }() + if namespace.DeletionTimestamp == nil { return ctrl.Result{}, nil } - klog.V(4).InfoS("Reconciling namespace", "namespace", klog.KObj(namespace), "finalizerToken", r.finalizerToken) + klog.V(4).InfoS("Reconciling namespace", "namespace", klog.KObj(namespace), "finalizerToken", d.finalizerToken) // ensure that the status is up to date on the namespace // if we get a not found error, we assume the namespace is truly gone - namespace, err = r.retryOnConflictError(namespace, r.updateNamespaceStatusFunc) + namespace, err = d.retryOnConflictError(ctx, namespace, d.updateNamespaceStatusFunc) if err != nil { return ctrl.Result{}, client.IgnoreNotFound(err) } @@ -105,7 +123,7 @@ func (r *NamespacedResourcesDeleter) Reconcile(ctx context.Context, rq ctrl.Requ } // there may still be content for us to remove - estimate, err := r.deleteAllContent(namespace) + estimate, err := d.deleteAllContent(ctx, namespace) if err != nil { return ctrl.Result{}, err } @@ -114,51 +132,49 @@ func (r *NamespacedResourcesDeleter) Reconcile(ctx context.Context, rq ctrl.Requ } // we have removed content, so mark it finalized by us - _, err = r.retryOnConflictError(namespace, r.finalizeNamespace) + _, err = d.retryOnConflictError(ctx, namespace, d.finalizeNamespace) if err != nil { // in normal practice, this should not be possible, but if a deployment is running // two controllers to do namespace deletion that share a common finalizer token it's // possible that a not found could occur since the other controller would have finished the delete. - if apierrors.IsNotFound(err) { - return ctrl.Result{}, nil - } - - return ctrl.Result{}, err + return ctrl.Result{}, client.IgnoreNotFound(err) } return ctrl.Result{}, nil } -func (r *NamespacedResourcesDeleter) initOpCache() { +func (d *namespacedResourcesDeleter) initOpCache(ctx context.Context) { // pre-fill opCache with the discovery info // // TODO(sttts): get rid of opCache and http 405 logic around it and trust discovery info - resources, err := r.DiscoverResourcesFn() + resources, err := d.DiscoverResourcesFn() if err != nil { - utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %w", err)) + utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %v", err)) } + logger := klog.FromContext(ctx) if len(resources) == 0 { - klog.Fatalf("Unable to get any supported resources from server: %v", err) + logger.Error(err, "Unable to get any supported resources from server") + klog.FlushAndExit(klog.ExitFlushTimeout, 1) } for _, rl := range resources { gv, err := schema.ParseGroupVersion(rl.GroupVersion) if err != nil { - klog.ErrorS(err, fmt.Sprintf("Failed to parse GroupVersion %q", rl.GroupVersion)) + logger.Error(err, "Failed to parse GroupVersion, skipping", "groupVersion", rl.GroupVersion) continue } - for _, rs := range rl.APIResources { - gvr := schema.GroupVersionResource{Group: gv.Group, Version: gv.Version, Resource: rs.Name} - verbs := sets.NewString([]string(rs.Verbs)...) + for _, r := range rl.APIResources { + gvr := schema.GroupVersionResource{Group: gv.Group, Version: gv.Version, Resource: r.Name} + verbs := sets.NewString([]string(r.Verbs)...) if !verbs.Has("delete") { - klog.V(6).Infof("Skipping resource %v because it cannot be deleted.", gvr) + logger.V(6).Info("Skipping resource because it cannot be deleted", "resource", gvr) } for _, op := range []operation{operationList, operationDeleteCollection} { if !verbs.Has(string(op)) { - r.opCache.setNotSupported(operationKey{operation: op, gvr: gvr}) + d.opCache.setNotSupported(operationKey{operation: op, gvr: gvr}) } } } @@ -181,7 +197,7 @@ const ( operationDeleteCollection operation = "deletecollection" operationList operation = "list" // assume a default estimate for finalizers to complete when found on items pending deletion. - finalizerEstimateSeconds int64 = int64(15) + finalizerEstimateSeconds = int64(15) ) // operationKey is an entry in a cache. @@ -197,7 +213,7 @@ type operationNotSupportedCache struct { m map[operationKey]bool } -// isSupported returns true if the operation is supported. +// isSupported returns true if the operation is supported func (o *operationNotSupportedCache) isSupported(key operationKey) bool { o.lock.RLock() defer o.lock.RUnlock() @@ -210,59 +226,56 @@ func (o *operationNotSupportedCache) setNotSupported(key operationKey) { o.m[key] = true } -// updateNamespaceFunc is a function that makes an update to a namespace. -type updateNamespaceFunc func(namespace *v1.Namespace) (*v1.Namespace, error) +// updateNamespaceFunc is a function that makes an update to a namespace +type updateNamespaceFunc func(ctx context.Context, namespace *v1.Namespace) (*v1.Namespace, error) // retryOnConflictError retries the specified fn if there was a conflict error // it will return an error if the UID for an object changes across retry operations. -// TODO RetryOnConflict should be a generic concept in client code. -func (r *NamespacedResourcesDeleter) retryOnConflictError(namespace *v1.Namespace, fn updateNamespaceFunc) (result *v1.Namespace, err error) { +// TODO RetryOnConflict should be a generic concept in client code +func (d *namespacedResourcesDeleter) retryOnConflictError(ctx context.Context, namespace *v1.Namespace, fn updateNamespaceFunc) (result *v1.Namespace, err error) { latestNamespace := namespace for { - result, err = fn(latestNamespace) + result, err = fn(ctx, latestNamespace) if err == nil { return result, nil } - if !apierrors.IsConflict(err) { + if !errors.IsConflict(err) { return nil, err } prevNamespace := latestNamespace - - latestNamespace = &v1.Namespace{} - // if err := r.Client.Get(context.TODO(), prevNamespace.Name, latestNamespace); err != nil { - if err := r.Client.Get(context.TODO(), types.NamespacedName{}, latestNamespace); err != nil { + latestNamespace, err = d.nsClient.Get(ctx, latestNamespace.Name, metav1.GetOptions{}) + if err != nil { return nil, err } - if prevNamespace.UID != latestNamespace.UID { return nil, fmt.Errorf("namespace uid has changed across retries") } } } -// updateNamespaceStatusFunc will verify that the status of the namespace is correct. -func (r *NamespacedResourcesDeleter) updateNamespaceStatusFunc(namespace *v1.Namespace) (*v1.Namespace, error) { +// updateNamespaceStatusFunc will verify that the status of the namespace is correct +func (d *namespacedResourcesDeleter) updateNamespaceStatusFunc(ctx context.Context, namespace *v1.Namespace) (*v1.Namespace, error) { if namespace.DeletionTimestamp.IsZero() || namespace.Status.Phase == v1.NamespaceTerminating { return namespace, nil } newNamespace := namespace.DeepCopy() newNamespace.Status.Phase = v1.NamespaceTerminating - return newNamespace, r.Client.Status().Update(context.TODO(), newNamespace) + return d.nsClient.UpdateStatus(ctx, newNamespace, metav1.UpdateOptions{}) } -// finalized returns true if the namespace.Spec.Finalizers is an empty list. +// finalized returns true if the namespace.Spec.Finalizers is an empty list func finalized(namespace *v1.Namespace) bool { return len(namespace.Spec.Finalizers) == 0 } -// finalizeNamespace removes the specified finalizerToken and finalizes the namespace. -func (r *NamespacedResourcesDeleter) finalizeNamespace(namespace *v1.Namespace) (*v1.Namespace, error) { +// finalizeNamespace removes the specified finalizerToken and finalizes the namespace +func (d *namespacedResourcesDeleter) finalizeNamespace(ctx context.Context, namespace *v1.Namespace) (*v1.Namespace, error) { namespaceFinalize := v1.Namespace{} namespaceFinalize.ObjectMeta = namespace.ObjectMeta namespaceFinalize.Spec = namespace.Spec finalizerSet := sets.NewString() for i := range namespace.Spec.Finalizers { - if namespace.Spec.Finalizers[i] != r.finalizerToken { + if namespace.Spec.Finalizers[i] != d.finalizerToken { finalizerSet.Insert(string(namespace.Spec.Finalizers[i])) } } @@ -270,10 +283,10 @@ func (r *NamespacedResourcesDeleter) finalizeNamespace(namespace *v1.Namespace) for _, value := range finalizerSet.List() { namespaceFinalize.Spec.Finalizers = append(namespaceFinalize.Spec.Finalizers, v1.FinalizerName(value)) } - namespace, err := r.nsClient.Finalize(context.Background(), &namespaceFinalize, metav1.UpdateOptions{}) + namespace, err := d.nsClient.Finalize(ctx, &namespaceFinalize, metav1.UpdateOptions{}) if err != nil { // it was removed already, so life is good - if apierrors.IsNotFound(err) { + if errors.IsNotFound(err) { return namespace, nil } } @@ -283,12 +296,13 @@ func (r *NamespacedResourcesDeleter) finalizeNamespace(namespace *v1.Namespace) // deleteCollection is a helper function that will delete the collection of resources // it returns true if the operation was supported on the server. // it returns an error if the operation was supported on the server but was unable to complete. -func (r *NamespacedResourcesDeleter) deleteCollection(gvr schema.GroupVersionResource, namespace string) (bool, error) { - klog.V(5).Infof("namespace controller - deleteCollection - namespace: %s, gvr: %v", namespace, gvr) +func (d *namespacedResourcesDeleter) deleteCollection(ctx context.Context, gvr schema.GroupVersionResource, namespace string) (bool, error) { + logger := klog.FromContext(ctx) + logger.V(5).Info("Namespace controller - deleteCollection", "namespace", namespace, "resource", gvr) key := operationKey{operation: operationDeleteCollection, gvr: gvr} - if !r.opCache.isSupported(key) { - klog.V(5).Infof("namespace controller - deleteCollection ignored since not supported - namespace: %s, gvr: %v", namespace, gvr) + if !d.opCache.isSupported(key) { + logger.V(5).Info("Namespace controller - deleteCollection ignored since not supported", "namespace", namespace, "resource", gvr) return false, nil } @@ -297,9 +311,7 @@ func (r *NamespacedResourcesDeleter) deleteCollection(gvr schema.GroupVersionRes // namespace itself. background := metav1.DeletePropagationBackground opts := metav1.DeleteOptions{PropagationPolicy: &background} - //nolint:kubelistcheck - err := r.metadataClient.Resource(gvr).Namespace(namespace).DeleteCollection(context.TODO(), opts, metav1.ListOptions{}) - + err := d.metadataClient.Resource(gvr).Namespace(namespace).DeleteCollection(ctx, opts, metav1.ListOptions{}) if err == nil { return true, nil } @@ -309,12 +321,12 @@ func (r *NamespacedResourcesDeleter) deleteCollection(gvr schema.GroupVersionRes // we have a resource returned in the discovery API that supports no top-level verbs: // /apis/extensions/v1beta1/namespaces/default/replicationcontrollers // when working with this resource type, we will get a literal not found error rather than expected method not supported - if errors.IsMethodNotSupported(err) || apierrors.IsNotFound(err) { - klog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr) + if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) { + logger.V(5).Info("Namespace controller - deleteCollection not supported", "namespace", namespace, "resource", gvr) return false, nil } - klog.V(5).Infof("namespace controller - deleteCollection unexpected error - namespace: %s, gvr: %v, error: %v", namespace, gvr, err) + logger.V(5).Info("Namespace controller - deleteCollection unexpected error", "namespace", namespace, "resource", gvr, "err", err) return true, err } @@ -324,17 +336,17 @@ func (r *NamespacedResourcesDeleter) deleteCollection(gvr schema.GroupVersionRes // the list of items in the collection (if found) // a boolean if the operation is supported // an error if the operation is supported but could not be completed. -func (r *NamespacedResourcesDeleter) listCollection(gvr schema.GroupVersionResource, namespace string) (*metav1.PartialObjectMetadataList, bool, error) { - klog.V(5).Infof("namespace controller - listCollection - namespace: %s, gvr: %v", namespace, gvr) +func (d *namespacedResourcesDeleter) listCollection(ctx context.Context, gvr schema.GroupVersionResource, namespace string) (*metav1.PartialObjectMetadataList, bool, error) { + logger := klog.FromContext(ctx) + logger.V(5).Info("Namespace controller - listCollection", "namespace", namespace, "resource", gvr) key := operationKey{operation: operationList, gvr: gvr} - if !r.opCache.isSupported(key) { - klog.V(5).Infof("namespace controller - listCollection ignored since not supported - namespace: %s, gvr: %v", namespace, gvr) + if !d.opCache.isSupported(key) { + logger.V(5).Info("Namespace controller - listCollection ignored since not supported", "namespace", namespace, "resource", gvr) return nil, false, nil } - //nolint:kubelistcheck - partialList, err := r.metadataClient.Resource(gvr).Namespace(namespace).List(context.TODO(), metav1.ListOptions{}) + partialList, err := d.metadataClient.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{}) if err == nil { return partialList, true, nil } @@ -344,8 +356,8 @@ func (r *NamespacedResourcesDeleter) listCollection(gvr schema.GroupVersionResou // we have a resource returned in the discovery API that supports no top-level verbs: // /apis/extensions/v1beta1/namespaces/default/replicationcontrollers // when working with this resource type, we will get a literal not found error rather than expected method not supported - if errors.IsMethodNotSupported(err) || apierrors.IsNotFound(err) { - klog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr) + if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) { + logger.V(5).Info("Namespace controller - listCollection not supported", "namespace", namespace, "resource", gvr) return nil, false, nil } @@ -353,20 +365,20 @@ func (r *NamespacedResourcesDeleter) listCollection(gvr schema.GroupVersionResou } // deleteEachItem is a helper function that will list the collection of resources and delete each item 1 by 1. -func (r *NamespacedResourcesDeleter) deleteEachItem(gvr schema.GroupVersionResource, namespace string) error { - klog.V(5).Infof("namespace controller - deleteEachItem - namespace: %s, gvr: %v", namespace, gvr) +func (d *namespacedResourcesDeleter) deleteEachItem(ctx context.Context, gvr schema.GroupVersionResource, namespace string) error { + klog.FromContext(ctx).V(5).Info("Namespace controller - deleteEachItem", "namespace", namespace, "resource", gvr) - unstructuredList, listSupported, err := r.listCollection(gvr, namespace) + partialList, listSupported, err := d.listCollection(ctx, gvr, namespace) if err != nil { return err } if !listSupported { return nil } - for _, item := range unstructuredList.Items { + for _, item := range partialList.Items { background := metav1.DeletePropagationBackground opts := metav1.DeleteOptions{PropagationPolicy: &background} - if err = r.metadataClient.Resource(gvr).Namespace(namespace).Delete(context.TODO(), item.GetName(), opts); err != nil && !apierrors.IsNotFound(err) && !errors.IsMethodNotSupported(err) { + if err = d.metadataClient.Resource(gvr).Namespace(namespace).Delete(ctx, item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) { return err } } @@ -386,29 +398,30 @@ type gvrDeletionMetadata struct { // deleteAllContentForGroupVersionResource will use the dynamic client to delete each resource identified in gvr. // It returns an estimate of the time remaining before the remaining resources are deleted. // If estimate > 0, not all resources are guaranteed to be gone. -func (r *NamespacedResourcesDeleter) deleteAllContentForGroupVersionResource( +func (d *namespacedResourcesDeleter) deleteAllContentForGroupVersionResource( + ctx context.Context, gvr schema.GroupVersionResource, namespace string, - namespaceDeletedAt metav1.Time, -) (gvrDeletionMetadata, error) { - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - namespace: %s, gvr: %v", namespace, gvr) + namespaceDeletedAt metav1.Time) (gvrDeletionMetadata, error) { + logger := klog.FromContext(ctx) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource", "namespace", namespace, "resource", gvr) // estimate how long it will take for the resource to be deleted (needed for objects that support graceful delete) - estimate, err := r.estimateGracefulTermination(gvr, namespace, namespaceDeletedAt) + estimate, err := d.estimateGracefulTermination(ctx, gvr, namespace, namespaceDeletedAt) if err != nil { - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - unable to estimate - namespace: %s, gvr: %v, err: %v", namespace, gvr, err) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - unable to estimate", "namespace", namespace, "resource", gvr, "err", err) return gvrDeletionMetadata{}, err } - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - estimate - namespace: %s, gvr: %v, estimate: %v", namespace, gvr, estimate) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - estimate", "namespace", namespace, "resource", gvr, "estimate", estimate) // first try to delete the entire collection - deleteCollectionSupported, err := r.deleteCollection(gvr, namespace) + deleteCollectionSupported, err := d.deleteCollection(ctx, gvr, namespace) if err != nil { return gvrDeletionMetadata{finalizerEstimateSeconds: estimate}, err } // delete collection was not supported, so we list and delete each item... if !deleteCollectionSupported { - err = r.deleteEachItem(gvr, namespace) + err = d.deleteEachItem(ctx, gvr, namespace) if err != nil { return gvrDeletionMetadata{finalizerEstimateSeconds: estimate}, err } @@ -416,16 +429,16 @@ func (r *NamespacedResourcesDeleter) deleteAllContentForGroupVersionResource( // verify there are no more remaining items // it is not an error condition for there to be remaining items if local estimate is non-zero - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - checking for no more items in namespace: %s, gvr: %v", namespace, gvr) - unstructuredList, listSupported, err := r.listCollection(gvr, namespace) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - checking for no more items in namespace", "namespace", namespace, "resource", gvr) + unstructuredList, listSupported, err := d.listCollection(ctx, gvr, namespace) if err != nil { - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - error verifying no items in namespace: %s, gvr: %v, err: %v", namespace, gvr, err) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - error verifying no items in namespace", "namespace", namespace, "resource", gvr, "err", err) return gvrDeletionMetadata{finalizerEstimateSeconds: estimate}, err } if !listSupported { return gvrDeletionMetadata{finalizerEstimateSeconds: estimate}, nil } - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - items remaining - namespace: %s, gvr: %v, items: %v", namespace, gvr, len(unstructuredList.Items)) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - items remaining", "namespace", namespace, "resource", gvr, "items", len(unstructuredList.Items)) if len(unstructuredList.Items) == 0 { // we're done return gvrDeletionMetadata{finalizerEstimateSeconds: 0, numRemaining: 0}, nil @@ -435,12 +448,12 @@ func (r *NamespacedResourcesDeleter) deleteAllContentForGroupVersionResource( finalizersToNumRemaining := map[string]int{} for _, item := range unstructuredList.Items { for _, finalizer := range item.GetFinalizers() { - finalizersToNumRemaining[finalizer]++ + finalizersToNumRemaining[finalizer] = finalizersToNumRemaining[finalizer] + 1 } } if estimate != int64(0) { - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - estimate is present - namespace: %s, gvr: %v, finalizers: %v", namespace, gvr, finalizersToNumRemaining) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - estimate is present", "namespace", namespace, "resource", gvr, "finalizers", finalizersToNumRemaining) return gvrDeletionMetadata{ finalizerEstimateSeconds: estimate, numRemaining: len(unstructuredList.Items), @@ -450,7 +463,7 @@ func (r *NamespacedResourcesDeleter) deleteAllContentForGroupVersionResource( // if any item has a finalizer, we treat that as a normal condition, and use a default estimation to allow for GC to complete. if len(finalizersToNumRemaining) > 0 { - klog.V(5).Infof("namespace controller - deleteAllContentForGroupVersionResource - items remaining with finalizers - namespace: %s, gvr: %v, finalizers: %v", namespace, gvr, finalizersToNumRemaining) + logger.V(5).Info("Namespace controller - deleteAllContentForGroupVersionResource - items remaining with finalizers", "namespace", namespace, "resource", gvr, "finalizers", finalizersToNumRemaining) return gvrDeletionMetadata{ finalizerEstimateSeconds: finalizerEstimateSeconds, numRemaining: len(unstructuredList.Items), @@ -475,15 +488,16 @@ type allGVRDeletionMetadata struct { // deleteAllContent will use the dynamic client to delete each resource identified in groupVersionResources. // It returns an estimate of the time remaining before the remaining resources are deleted. // If estimate > 0, not all resources are guaranteed to be gone. -func (r *NamespacedResourcesDeleter) deleteAllContent(ns *v1.Namespace) (int64, error) { +func (d *namespacedResourcesDeleter) deleteAllContent(ctx context.Context, ns *v1.Namespace) (int64, error) { namespace := ns.Name namespaceDeletedAt := *ns.DeletionTimestamp var errs []error conditionUpdater := namespaceConditionUpdater{} estimate := int64(0) - klog.V(4).InfoS("namespace controller - deleteAllContent", "namespace", klog.KObj(ns)) + logger := klog.FromContext(ctx) + logger.V(4).Info("namespace controller - deleteAllContent", "namespace", namespace) - resources, err := r.DiscoverResourcesFn() + resources, err := d.DiscoverResourcesFn() if err != nil { // discovery errors are not fatal. We often have some set of resources we can operate against even if we don't have a complete list errs = append(errs, err) @@ -503,7 +517,7 @@ func (r *NamespacedResourcesDeleter) deleteAllContent(ns *v1.Namespace) (int64, finalizersToNumRemaining: map[string]int{}, } for gvr := range groupVersionResources { - gvrDeletionMetadata, err := r.deleteAllContentForGroupVersionResource(gvr, namespace, namespaceDeletedAt) + gvrDeletionMetadata, err := d.deleteAllContentForGroupVersionResource(ctx, gvr, namespace, namespaceDeletedAt) if err != nil { // If there is an error, hold on to it but proceed with all the remaining // groupVersionResources. @@ -519,7 +533,7 @@ func (r *NamespacedResourcesDeleter) deleteAllContent(ns *v1.Namespace) (int64, if numRemaining == 0 { continue } - numRemainingTotals.finalizersToNumRemaining[finalizer] += numRemaining + numRemainingTotals.finalizersToNumRemaining[finalizer] = numRemainingTotals.finalizersToNumRemaining[finalizer] + numRemaining } } } @@ -529,26 +543,26 @@ func (r *NamespacedResourcesDeleter) deleteAllContent(ns *v1.Namespace) (int64, // we need to reflect that information. Recall that additional finalizers can be set on namespaces, so this finalizer may clear itself and // NOT remove the resource instance. if hasChanged := conditionUpdater.Update(ns); hasChanged { - if err = r.Client.Status().Update(context.TODO(), ns); err != nil { - utilruntime.HandleError(fmt.Errorf("couldn't update status condition for namespace %q: %w", namespace, err)) + if _, err = d.nsClient.UpdateStatus(ctx, ns, metav1.UpdateOptions{}); err != nil { + utilruntime.HandleError(fmt.Errorf("couldn't update status condition for namespace %q: %v", namespace, err)) } } // if len(errs)==0, NewAggregate returns nil. - klog.V(4).Infof("namespace controller - deleteAllContent - namespace: %s, estimate: %v, errors: %v", namespace, estimate, utilerrors.NewAggregate(errs)) - return estimate, utilerrors.NewAggregate(errs) + err = utilerrors.NewAggregate(errs) + logger.V(4).Info("namespace controller - deleteAllContent", "namespace", namespace, "estimate", estimate, "err", err) + return estimate, err } -// estimateGracefulTermination will estimate the graceful termination rquired for the specific entity in the namespace. -func (r *NamespacedResourcesDeleter) estimateGracefulTermination(gvr schema.GroupVersionResource, ns string, namespaceDeletedAt metav1.Time) (int64, error) { +// estimateGracefulTermination will estimate the graceful termination required for the specific entity in the namespace +func (d *namespacedResourcesDeleter) estimateGracefulTermination(ctx context.Context, gvr schema.GroupVersionResource, ns string, namespaceDeletedAt metav1.Time) (int64, error) { groupResource := gvr.GroupResource() - klog.V(5).Infof("namespace controller - estimateGracefulTermination - group %s, resource: %s", groupResource.Group, groupResource.Resource) + klog.FromContext(ctx).V(5).Info("Namespace controller - estimateGracefulTermination", "group", groupResource.Group, "resource", groupResource.Resource) estimate := int64(0) var err error - //nolint:gocritic switch groupResource { case schema.GroupResource{Group: "", Resource: "pods"}: - estimate, err = r.estimateGracefulTerminationForPods(ns) + estimate, err = d.estimateGracefulTerminationForPods(ctx, ns) } if err != nil { return 0, err @@ -562,7 +576,7 @@ func (r *NamespacedResourcesDeleter) estimateGracefulTermination(gvr schema.Grou return estimate, nil } -// estimateGracefulTerminationForPods determines the graceful termination period for pods in the namespace. -func (r *NamespacedResourcesDeleter) estimateGracefulTerminationForPods(ns string) (int64, error) { +// estimateGracefulTerminationForPods determines the graceful termination period for pods in the namespace +func (d *namespacedResourcesDeleter) estimateGracefulTerminationForPods(ctx context.Context, ns string) (int64, error) { return 0, nil } diff --git a/cmd/onex-controller-manager/app/cleaner/chain.go b/internal/controller/resourceclean/cleaner_chain.go similarity index 95% rename from cmd/onex-controller-manager/app/cleaner/chain.go rename to internal/controller/resourceclean/cleaner_chain.go index 6c0d46a2cea..e211c0cadfa 100644 --- a/cmd/onex-controller-manager/app/cleaner/chain.go +++ b/internal/controller/resourceclean/cleaner_chain.go @@ -4,7 +4,7 @@ // this file is https://github.com/superproj/onex. // -package cleaner +package resourceclean import ( "context" @@ -33,7 +33,7 @@ func (c *Chain) Initialize(client client.Client, ds store.IStore) { c.ds = ds } -func (c *Chain) Sync(ctx context.Context) error { +func (c *Chain) Delete(ctx context.Context) error { c.mu.Lock() defer c.mu.Unlock() diff --git a/cmd/onex-controller-manager/app/cleaner/miner.go b/internal/controller/resourceclean/cleaner_miner.go similarity index 95% rename from cmd/onex-controller-manager/app/cleaner/miner.go rename to internal/controller/resourceclean/cleaner_miner.go index ead0c897ab7..090760dc408 100644 --- a/cmd/onex-controller-manager/app/cleaner/miner.go +++ b/internal/controller/resourceclean/cleaner_miner.go @@ -4,7 +4,7 @@ // this file is https://github.com/superproj/onex. // -package cleaner +package resourceclean import ( "context" @@ -33,7 +33,7 @@ func (c *Miner) Initialize(client client.Client, ds store.IStore) { c.ds = ds } -func (c *Miner) Sync(ctx context.Context) error { +func (c *Miner) Delete(ctx context.Context) error { c.mu.Lock() defer c.mu.Unlock() diff --git a/cmd/onex-controller-manager/app/cleaner/minerset.go b/internal/controller/resourceclean/cleaner_minerset.go similarity index 95% rename from cmd/onex-controller-manager/app/cleaner/minerset.go rename to internal/controller/resourceclean/cleaner_minerset.go index 701efc06029..0bd4915fa4c 100644 --- a/cmd/onex-controller-manager/app/cleaner/minerset.go +++ b/internal/controller/resourceclean/cleaner_minerset.go @@ -4,7 +4,7 @@ // this file is https://github.com/superproj/onex. // -package cleaner +package resourceclean import ( "context" @@ -33,7 +33,7 @@ func (c *MinerSet) Initialize(client client.Client, ds store.IStore) { c.ds = ds } -func (c *MinerSet) Sync(ctx context.Context) error { +func (c *MinerSet) Delete(ctx context.Context) error { c.mu.Lock() defer c.mu.Unlock() diff --git a/cmd/onex-controller-manager/app/cleaner.go b/internal/controller/resourceclean/controller.go similarity index 55% rename from cmd/onex-controller-manager/app/cleaner.go rename to internal/controller/resourceclean/controller.go index 1f04ac84646..2128226a24c 100644 --- a/cmd/onex-controller-manager/app/cleaner.go +++ b/internal/controller/resourceclean/controller.go @@ -4,7 +4,7 @@ // this file is https://github.com/superproj/onex. // -package app +package resourceclean import ( "context" @@ -16,34 +16,34 @@ import ( "github.com/superproj/onex/internal/gateway/store" ) -// ICleaner interface defines the methods required for a cleaner implementation:. -type ICleaner interface { +// Cleaner interface defines the methods required for a cleaner implementation. +type Cleaner interface { // Name returns the name of the cleaner. Name() string - // Sync performs the synchronization operation. - Sync(ctx context.Context) error + // Delete performs the deletion operation. + Delete(ctx context.Context) error // Initialize initializes the cleaner with the provided client and store client. Initialize(client client.Client, storeClient store.IStore) } -// Cleaner is a struct that represents a set of cleaners used to clean deleted resources from onex db. -type Cleaner struct { - cleaners []ICleaner +// CleanReconciler is a struct that represents a set of cleaners used to clean deleted resources from onex db. +type CleanReconciler struct { + cleaners []Cleaner } -// newCleaner return a cleaner set used to clean deleted resources from onex db. -func newCleaner(client client.Client, ds store.IStore, cleaners ...ICleaner) *Cleaner { +// NewCleanReconciler return a cleaner set used to clean deleted resources from onex db. +func NewCleanReconciler(client client.Client, ds store.IStore, cleaners ...Cleaner) *CleanReconciler { for _, cleaner := range cleaners { cleaner.Initialize(client, ds) } - return &Cleaner{cleaners} + return &CleanReconciler{cleaners} } // Start starts the Cleaner and runs the SyncAll() method periodically. -func (c *Cleaner) Start(ctx context.Context) error { +func (r *CleanReconciler) Start(ctx context.Context) error { ticker := time.NewTicker(1 * time.Hour) defer ticker.Stop() @@ -52,16 +52,16 @@ func (c *Cleaner) Start(ctx context.Context) error { case <-ctx.Done(): return nil case <-ticker.C: - c.SyncAll(ctx) + r.SyncAll(ctx) } } } // SyncAll runs the Sync() method of all registered cleaners. -func (c *Cleaner) SyncAll(ctx context.Context) { - for _, cleaner := range c.cleaners { - go func(cleaner ICleaner) { - if err := cleaner.Sync(ctx); err != nil { +func (r *CleanReconciler) SyncAll(ctx context.Context) { + for _, cleaner := range r.cleaners { + go func(cleaner Cleaner) { + if err := cleaner.Delete(ctx); err != nil { klog.ErrorS(err, "Failed to sync", "cleaner", cleaner.Name()) } }(cleaner) diff --git a/internal/controller/resourceclean/doc.go b/internal/controller/resourceclean/doc.go new file mode 100644 index 00000000000..6cf1de0f1a5 --- /dev/null +++ b/internal/controller/resourceclean/doc.go @@ -0,0 +1,11 @@ +// Package resourceclean is used to delete resoures from database which is already deleted from onex-apiserver. + +// Sometimes resources are deleted from the onex-apiserver, but due to reasons such as deployments, +// component failures, etc., the sync controller fails to remove the resources from the database, +// resulting in residual dirty data in the database. In such cases, the clean controller is needed +// to delete the residual resources from the database. + +// Alternatively, you have another option: disable the clean controller, set the deletedAt field +// during synchronization to maintain historical resource data. + +package resourceclean // import "github.com/superproj/onex/internal/controller/resourceclean" diff --git a/internal/controller/sync/chain_sync.go b/internal/controller/sync/chain_sync_controller.go similarity index 99% rename from internal/controller/sync/chain_sync.go rename to internal/controller/sync/chain_sync_controller.go index 2d4c0fc598b..655d7875487 100644 --- a/internal/controller/sync/chain_sync.go +++ b/internal/controller/sync/chain_sync_controller.go @@ -29,8 +29,7 @@ const chainControllerName = "controller-manager.chainSync" // ChainSyncReconciler sync a Chain object to database. type ChainSyncReconciler struct { client client.Client - - Store store.IStore + Store store.IStore } // SetupWithManager sets up the controller with the Manager. diff --git a/internal/controller/sync/docs.go b/internal/controller/sync/docs.go new file mode 100644 index 00000000000..c531e91323f --- /dev/null +++ b/internal/controller/sync/docs.go @@ -0,0 +1,7 @@ +// Package sync is used to synchronize resources from the onex-apiserver to the MySQL database. + +// When there is a large amount of data in Etcd, there is a query bottleneck, especially with the +// List interface. Therefore, the Sync package can be used to continuously synchronize data from Etcd +// to the MySQL database in real-time. When onex-gateway performs list queries, it can directly query +// from the MySQL database. +package sync diff --git a/internal/controller/sync/miner_sync.go b/internal/controller/sync/miner_sync_controller.go similarity index 100% rename from internal/controller/sync/miner_sync.go rename to internal/controller/sync/miner_sync_controller.go diff --git a/internal/controller/sync/minerset_sync.go b/internal/controller/sync/minerset_sync_controller.go similarity index 100% rename from internal/controller/sync/minerset_sync.go rename to internal/controller/sync/minerset_sync_controller.go diff --git a/internal/controlplane/README.md b/internal/controlplane/README.md new file mode 100644 index 00000000000..68dac9c03d4 --- /dev/null +++ b/internal/controlplane/README.md @@ -0,0 +1,3 @@ +# controlplane + +kube-apiserver 风格的 HTTP 服务器应用基座 diff --git a/internal/controlplane/admission/initializer/doc.go b/internal/controlplane/admission/initializer/doc.go new file mode 100644 index 00000000000..6c44c545e91 --- /dev/null +++ b/internal/controlplane/admission/initializer/doc.go @@ -0,0 +1,7 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package initializer // import "github.com/superproj/onex/internal/controlplane/admission/initializer" diff --git a/internal/controlplane/admission/initializer/initializer.go b/internal/controlplane/admission/initializer/initializer.go new file mode 100644 index 00000000000..b6bb01d1d33 --- /dev/null +++ b/internal/controlplane/admission/initializer/initializer.go @@ -0,0 +1,47 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package initializer + +import ( + "k8s.io/apiserver/pkg/admission" + + clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/generated/informers" +) + +type pluginInitializer struct { + informers informers.SharedInformerFactory + externalClient clientset.Interface + //authorizer authorizer.Authorizer + //featureGates featuregate.FeatureGate + stopCh <-chan struct{} +} + +var _ admission.PluginInitializer = pluginInitializer{} + +// New creates an instance of node admission plugins initializer. +func New( + informers informers.SharedInformerFactory, + extClientset clientset.Interface, +) pluginInitializer { + return pluginInitializer{ + informers: informers, + externalClient: extClientset, + } +} + +// Initialize checks the initialization interfaces implemented by a plugin +// and provide the appropriate initialization data. +func (i pluginInitializer) Initialize(plugin admission.Interface) { + if wants, ok := plugin.(WantsInternalInformerFactory); ok { + wants.SetInternalInformerFactory(i.informers) + } + + if wants, ok := plugin.(WantsInternalClientSet); ok { + wants.SetInternalClientSet(i.externalClient) + } +} diff --git a/internal/controlplane/admission/initializer/interfaces.go b/internal/controlplane/admission/initializer/interfaces.go new file mode 100644 index 00000000000..e8b99d4aa9e --- /dev/null +++ b/internal/controlplane/admission/initializer/interfaces.go @@ -0,0 +1,26 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package initializer + +import ( + "k8s.io/apiserver/pkg/admission" + + clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/generated/informers" +) + +// WantsInternalInformerFactory defines a function which sets InformerFactory for admission plugins that need it. +type WantsInternalInformerFactory interface { + admission.InitializationValidator + SetInternalInformerFactory(informers.SharedInformerFactory) +} + +// WantsInternalClientSet defines a function which sets external ClientSet for admission plugins that need it. +type WantsInternalClientSet interface { + admission.InitializationValidator + SetInternalClientSet(clientset.Interface) +} diff --git a/internal/admission/plugin/admit/admission.go b/internal/controlplane/admission/plugin/admit/admission.go similarity index 100% rename from internal/admission/plugin/admit/admission.go rename to internal/controlplane/admission/plugin/admit/admission.go diff --git a/internal/controlplane/admission/plugin/admit/doc.go b/internal/controlplane/admission/plugin/admit/doc.go new file mode 100644 index 00000000000..3ceb8d10a8e --- /dev/null +++ b/internal/controlplane/admission/plugin/admit/doc.go @@ -0,0 +1,7 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package admit // import "github.com/superproj/onex/internal/controlplane/admission/plugin/admit" diff --git a/internal/admission/plugin/deny/admission.go b/internal/controlplane/admission/plugin/deny/admission.go similarity index 100% rename from internal/admission/plugin/deny/admission.go rename to internal/controlplane/admission/plugin/deny/admission.go diff --git a/internal/controlplane/admission/plugin/deny/doc.go b/internal/controlplane/admission/plugin/deny/doc.go new file mode 100644 index 00000000000..8894e0855e2 --- /dev/null +++ b/internal/controlplane/admission/plugin/deny/doc.go @@ -0,0 +1,7 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package deny // import "github.com/superproj/onex/internal/controlplane/admission/plugin/deny" diff --git a/internal/admission/plugin/doc.go b/internal/controlplane/admission/plugin/doc.go similarity index 73% rename from internal/admission/plugin/doc.go rename to internal/controlplane/admission/plugin/doc.go index dd5a76e3211..b2ced3228af 100644 --- a/internal/admission/plugin/doc.go +++ b/internal/controlplane/admission/plugin/doc.go @@ -4,4 +4,4 @@ // this file is https://github.com/superproj/onex. // -package plugin // import "github.com/superproj/onex/internal/admission/plugin" +package plugin // import "github.com/superproj/onex/internal/controlplane/admission/plugin" diff --git a/internal/admission/plugin/namespace/autoprovision/admission.go b/internal/controlplane/admission/plugin/namespace/autoprovision/admission.go similarity index 83% rename from internal/admission/plugin/namespace/autoprovision/admission.go rename to internal/controlplane/admission/plugin/namespace/autoprovision/admission.go index 5a0130c4ce2..121701e195c 100644 --- a/internal/admission/plugin/namespace/autoprovision/admission.go +++ b/internal/controlplane/admission/plugin/namespace/autoprovision/admission.go @@ -17,9 +17,9 @@ import ( "k8s.io/apiserver/pkg/admission" api "k8s.io/kubernetes/pkg/apis/core" - "github.com/superproj/onex/internal/admission/initializer" + "github.com/superproj/onex/internal/controlplane/admission/initializer" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" corev1listers "github.com/superproj/onex/pkg/generated/listers/core/v1" ) @@ -44,8 +44,8 @@ type Provision struct { var ( _ admission.MutationInterface = &Provision{} - _ = initializer.WantsInternalMinerInformerFactory(&Provision{}) - _ = initializer.WantsExternalMinerClientSet(&Provision{}) + _ = initializer.WantsInternalInformerFactory(&Provision{}) + _ = initializer.WantsInternalClientSet(&Provision{}) ) // Admit makes an admission decision based on the request attributes. @@ -98,13 +98,13 @@ func NewProvision() *Provision { } } -// SetExternalMinerClientSet implements the WantsExternalMinerClientSet interface. -func (p *Provision) SetExternalMinerClientSet(client clientset.Interface) { +// SetInternalClientSet implements the WantsInternalClientSet interface. +func (p *Provision) SetInternalClientSet(client clientset.Interface) { p.client = client } -// SetInternalMinerInformerFactory implements the WantsInternalMinerInformerFactory interface. -func (p *Provision) SetInternalMinerInformerFactory(f informers.SharedInformerFactory) { +// SetInternalInformerFactory implements the WantsInternalInformerFactory interface. +func (p *Provision) SetInternalInformerFactory(f informers.SharedInformerFactory) { namespaceInformer := f.Core().V1().Namespaces() p.namespaceLister = namespaceInformer.Lister() p.SetReadyFunc(namespaceInformer.Informer().HasSynced) diff --git a/internal/admission/plugin/namespace/exists/admission.go b/internal/controlplane/admission/plugin/namespace/exists/admission.go similarity index 82% rename from internal/admission/plugin/namespace/exists/admission.go rename to internal/controlplane/admission/plugin/namespace/exists/admission.go index 2944f1fe616..ae96e0d57a9 100644 --- a/internal/admission/plugin/namespace/exists/admission.go +++ b/internal/controlplane/admission/plugin/namespace/exists/admission.go @@ -16,9 +16,9 @@ import ( "k8s.io/apiserver/pkg/admission" api "k8s.io/kubernetes/pkg/apis/core" - "github.com/superproj/onex/internal/admission/initializer" + "github.com/superproj/onex/internal/controlplane/admission/initializer" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" corev1listers "github.com/superproj/onex/pkg/generated/listers/core/v1" ) @@ -43,8 +43,8 @@ type Exists struct { var ( _ admission.ValidationInterface = &Exists{} - _ = initializer.WantsInternalMinerInformerFactory(&Exists{}) - _ = initializer.WantsExternalMinerClientSet(&Exists{}) + _ = initializer.WantsInternalInformerFactory(&Exists{}) + _ = initializer.WantsInternalClientSet(&Exists{}) ) // Validate makes an admission decision based on the request attributes. @@ -87,13 +87,13 @@ func NewExists() *Exists { } } -// SetExternalMinerClientSet implements the WantsExternalMinerClientSet interface. -func (e *Exists) SetExternalMinerClientSet(client clientset.Interface) { +// SetInternalClientSet implements the WantsInternalClientSet interface. +func (e *Exists) SetInternalClientSet(client clientset.Interface) { e.client = client } -// SetInternalMinerInformerFactory implements the WantsInternalMinerInformerFactory interface. -func (e *Exists) SetInternalMinerInformerFactory(f informers.SharedInformerFactory) { +// SetInternalInformerFactory implements the WantsInternalInformerFactory interface. +func (e *Exists) SetInternalInformerFactory(f informers.SharedInformerFactory) { namespaceInformer := f.Core().V1().Namespaces() e.namespaceLister = namespaceInformer.Lister() e.SetReadyFunc(namespaceInformer.Informer().HasSynced) diff --git a/internal/admission/plugin/namespace/lifecycle/admission.go b/internal/controlplane/admission/plugin/namespace/lifecycle/admission.go similarity index 92% rename from internal/admission/plugin/namespace/lifecycle/admission.go rename to internal/controlplane/admission/plugin/namespace/lifecycle/admission.go index 5605df588d5..c0492afae53 100644 --- a/internal/admission/plugin/namespace/lifecycle/admission.go +++ b/internal/controlplane/admission/plugin/namespace/lifecycle/admission.go @@ -23,9 +23,9 @@ import ( "k8s.io/apiserver/pkg/admission" "k8s.io/utils/clock" - "github.com/superproj/onex/internal/admission/initializer" + "github.com/superproj/onex/internal/controlplane/admission/initializer" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" corelisters "github.com/superproj/onex/pkg/generated/listers/core/v1" ) @@ -62,8 +62,8 @@ type Lifecycle struct { } var ( - _ = initializer.WantsInternalMinerInformerFactory(&Lifecycle{}) - _ = initializer.WantsExternalMinerClientSet(&Lifecycle{}) + _ = initializer.WantsInternalInformerFactory(&Lifecycle{}) + _ = initializer.WantsInternalClientSet(&Lifecycle{}) ) // Admit makes an admission decision based on the request attributes. @@ -188,15 +188,15 @@ func newLifecycleWithClock(immortalNamespaces sets.String, clock utilcache.Clock }, nil } -// SetInternalMinerInformerFactory implements the WantsInternalMinerInformerFactory interface. -func (l *Lifecycle) SetInternalMinerInformerFactory(f informers.SharedInformerFactory) { +// SetInternalInformerFactory implements the WantsInternalInformerFactory interface. +func (l *Lifecycle) SetInternalInformerFactory(f informers.SharedInformerFactory) { namespaceInformer := f.Core().V1().Namespaces() l.namespaceLister = namespaceInformer.Lister() l.SetReadyFunc(namespaceInformer.Informer().HasSynced) } -// SetExternalMinerClientSet implements the WantsExternalMinerClientSet interface. -func (l *Lifecycle) SetExternalMinerClientSet(client clientset.Interface) { +// SetInternalClientSet implements the WantsInternalClientSet interface. +func (l *Lifecycle) SetInternalClientSet(client clientset.Interface) { l.client = client } diff --git a/internal/controlplane/apiserver/apiextensions.go b/internal/controlplane/apiserver/apiextensions.go new file mode 100644 index 00000000000..2cbc2c01190 --- /dev/null +++ b/internal/controlplane/apiserver/apiextensions.go @@ -0,0 +1,85 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 apiserver + +import ( + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + apiextensionsapiserver "k8s.io/apiextensions-apiserver/pkg/apiserver" + apiextensionsoptions "k8s.io/apiextensions-apiserver/pkg/cmd/server/options" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apiserver/pkg/admission" + "k8s.io/apiserver/pkg/server" + "k8s.io/apiserver/pkg/util/webhook" + kubeinformers "k8s.io/client-go/informers" + + controlplaneoptions "github.com/superproj/onex/internal/controlplane/apiserver/options" +) + +func CreateAPIExtensionsConfig( + onexAPIServerConfig server.Config, + kubeInformers kubeinformers.SharedInformerFactory, + pluginInitializers []admission.PluginInitializer, + commandOptions controlplaneoptions.CompletedOptions, + masterCount int, + serviceResolver webhook.ServiceResolver, + authResolverWrapper webhook.AuthenticationInfoResolverWrapper, +) (*apiextensionsapiserver.Config, error) { + // make a shallow copy to let us twiddle a few things + // most of the config actually remains the same. We only need to mess with a couple items related to the particulars of the apiextensions + genericConfig := onexAPIServerConfig + genericConfig.PostStartHooks = map[string]server.PostStartHookConfigEntry{} + genericConfig.RESTOptionsGetter = nil + + // copy the etcd options so we don't mutate originals. + // we assume that the etcd options have been completed already. avoid messing with anything outside + // of changes to StorageConfig as that may lead to unexpected behavior when the options are applied. + etcdOptions := *commandOptions.RecommendedOptions.Etcd + // this is where the true decodable levels come from. + etcdOptions.StorageConfig.Codec = apiextensionsapiserver.Codecs.LegacyCodec(v1beta1.SchemeGroupVersion, v1.SchemeGroupVersion) + // prefer the more compact serialization (v1beta1) for storage until https://issue.k8s.io/82292 is resolved for objects whose v1 serialization is too big but whose v1beta1 serialization can be stored + etcdOptions.StorageConfig.EncodeVersioner = runtime.NewMultiGroupVersioner(v1beta1.SchemeGroupVersion, schema.GroupKind{Group: v1beta1.GroupName}) + etcdOptions.SkipHealthEndpoints = true // avoid double wiring of health checks + if err := etcdOptions.ApplyTo(&genericConfig); err != nil { + return nil, err + } + + // override MergedResourceConfig with apiextensions defaults and registry + if err := commandOptions.APIEnablement.ApplyTo( + &genericConfig, + apiextensionsapiserver.DefaultAPIResourceConfigSource(), + apiextensionsapiserver.Scheme); err != nil { + return nil, err + } + apiextensionsConfig := &apiextensionsapiserver.Config{ + GenericConfig: &server.RecommendedConfig{ + Config: genericConfig, + SharedInformerFactory: kubeInformers, + }, + ExtraConfig: apiextensionsapiserver.ExtraConfig{ + CRDRESTOptionsGetter: apiextensionsoptions.NewCRDRESTOptionsGetter(etcdOptions, genericConfig.ResourceTransformers, genericConfig.StorageObjectCountTracker), + AuthResolverWrapper: authResolverWrapper, + ServiceResolver: serviceResolver, + }, + } + + // we need to clear the poststarthooks so we don't add them multiple times to all the servers (that fails) + apiextensionsConfig.GenericConfig.PostStartHooks = map[string]server.PostStartHookConfigEntry{} + + return apiextensionsConfig, nil +} diff --git a/internal/controlplane/apiserver/config.go b/internal/controlplane/apiserver/config.go new file mode 100644 index 00000000000..b6ad3566bf1 --- /dev/null +++ b/internal/controlplane/apiserver/config.go @@ -0,0 +1,261 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +// Package app does all of the work necessary to create a OneX +// APIServer by binding together the API, master and APIServer infrastructure. +// +//nolint:nakedret +package apiserver + +import ( + "fmt" + "strconv" + + "github.com/blang/semver/v4" + oteltrace "go.opentelemetry.io/otel/trace" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/sets" + kversion "k8s.io/apimachinery/pkg/version" + "k8s.io/apiserver/pkg/admission" + //"k8s.io/apiserver/pkg/admission" + "k8s.io/apiserver/pkg/endpoints/discovery/aggregated" + openapinamer "k8s.io/apiserver/pkg/endpoints/openapi" + genericfeatures "k8s.io/apiserver/pkg/features" + "k8s.io/apiserver/pkg/reconcilers" + genericapiserver "k8s.io/apiserver/pkg/server" + "k8s.io/apiserver/pkg/server/filters" + serverstorage "k8s.io/apiserver/pkg/server/storage" + "k8s.io/apiserver/pkg/storageversion" + utilfeature "k8s.io/apiserver/pkg/util/feature" + "k8s.io/apiserver/pkg/util/openapi" + utilpeerproxy "k8s.io/apiserver/pkg/util/peerproxy" + kubeinformers "k8s.io/client-go/informers" + kubeclientset "k8s.io/client-go/kubernetes" + "k8s.io/client-go/transport" + "k8s.io/klog/v2" + openapicommon "k8s.io/kube-openapi/pkg/common" + "k8s.io/kubernetes/pkg/api/legacyscheme" + api "k8s.io/kubernetes/pkg/apis/core" + + "github.com/superproj/onex/internal/controlplane" + "github.com/superproj/onex/internal/controlplane/admission/initializer" + controlplaneoptions "github.com/superproj/onex/internal/controlplane/apiserver/options" + "github.com/superproj/onex/internal/controlplane/storage" + "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/generated/informers" + "github.com/superproj/onex/pkg/version" +) + +// BuildGenericConfig takes the master server options and produces the genericapiserver.Config associated with it. +func BuildGenericConfig( + s controlplaneoptions.CompletedOptions, + schemes []*runtime.Scheme, + getOpenAPIDefinitions func(ref openapicommon.ReferenceCallback) map[string]openapicommon.OpenAPIDefinition, +) ( + genericConfig *genericapiserver.RecommendedConfig, + versionedInformers informers.SharedInformerFactory, + kubeSharedInformers kubeinformers.SharedInformerFactory, + storageFactory *serverstorage.DefaultStorageFactory, + lastErr error, +) { + genericConfig = genericapiserver.NewRecommendedConfig(legacyscheme.Codecs) + genericConfig.MergedResourceConfig = controlplane.DefaultAPIResourceConfigSource() + + if lastErr = s.GenericServerRunOptions.ApplyTo(&genericConfig.Config); lastErr != nil { + return + } + + s.RecommendedOptions.ExtraAdmissionInitializers = func(c *genericapiserver.RecommendedConfig) ([]admission.PluginInitializer, error) { + client, err := versioned.NewForConfig(c.LoopbackClientConfig) + if err != nil { + return nil, err + } + informerFactory := informers.NewSharedInformerFactory(client, c.LoopbackClientConfig.Timeout) + s.InternalVersionedInformers = informerFactory + return []admission.PluginInitializer{initializer.New(informerFactory, client)}, nil + } + + // RecommendedOptions.ApplyTo must after RecommendedOptions.ExtraAdmissionInitializers. + // Because RecommendedOptions.ApplyTo need init ExtraAdmissionInitializers. + if lastErr = s.RecommendedOptions.ApplyTo(genericConfig); lastErr != nil { + return + } + + // Use protobufs for self-communication. + // Since not every generic apiserver has to support protobufs, we + // cannot default to it in generic apiserver and need to explicitly + // set it in onex-apiserver. + genericConfig.LoopbackClientConfig.ContentConfig.ContentType = "application/vnd.kubernetes.protobuf" + // Disable compression for self-communication, since we are going to be + // on a fast local network + genericConfig.LoopbackClientConfig.DisableCompression = true + + loopbackClientConfig := genericConfig.LoopbackClientConfig + // Build onex client + internalClient, err := versioned.NewForConfig(loopbackClientConfig) + if err != nil { + lastErr = fmt.Errorf("failed to create real external clientset: %w", err) + return + } + versionedInformers = informers.NewSharedInformerFactory(internalClient, loopbackClientConfig.Timeout) + + // Build kubernetes client + // Use onex's config to mock a kubernetes client. + kubeClient, err := kubeclientset.NewForConfig(loopbackClientConfig) + if err != nil { + lastErr = fmt.Errorf("failed to create real external clientset: %v", err) + return + } + kubeSharedInformers = kubeinformers.NewSharedInformerFactory(kubeClient, loopbackClientConfig.Timeout) + + if lastErr = s.Features.ApplyTo(&genericConfig.Config, kubeClient, kubeSharedInformers); lastErr != nil { + return + } + if lastErr = s.APIEnablement.ApplyTo(&genericConfig.Config, controlplane.DefaultAPIResourceConfigSource(), legacyscheme.Scheme); lastErr != nil { + return + } + + if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) { + if lastErr = s.Traces.ApplyTo(genericConfig.EgressSelector, &genericConfig.Config); lastErr != nil { + return + } + } + + // wrap the definitions to revert any changes from disabled features + getOpenAPIDefinitions = openapi.GetOpenAPIDefinitionsWithoutDisabledFeatures(getOpenAPIDefinitions) + //namer := openapinamer.NewDefinitionNamer(legacyscheme.Scheme) + namer := openapinamer.NewDefinitionNamer(schemes...) + genericConfig.OpenAPIConfig = genericapiserver.DefaultOpenAPIConfig(getOpenAPIDefinitions, namer) + genericConfig.OpenAPIConfig.Info.Title = "OneX" + genericConfig.OpenAPIConfig.Info.Version = "v0.0.1" + genericConfig.OpenAPIV3Config = genericapiserver.DefaultOpenAPIV3Config(getOpenAPIDefinitions, namer) + genericConfig.OpenAPIV3Config.Info.Title = "OneX" + genericConfig.OpenAPIV3Config.Info.Version = "v0.0.1" + // Not in use, just serving as a placeholder. + genericConfig.LongRunningFunc = filters.BasicLongRunningRequestCheck( + sets.NewString("watch", "proxy"), + sets.NewString("attach", "exec", "proxy", "log", "portforward"), + ) + genericConfig.Version = convertVersion(version.Get()) + + if genericConfig.EgressSelector != nil { + s.RecommendedOptions.Etcd.StorageConfig.Transport.EgressLookup = genericConfig.EgressSelector.Lookup + } + if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIServerTracing) { + s.RecommendedOptions.Etcd.StorageConfig.Transport.TracerProvider = genericConfig.TracerProvider + } else { + s.RecommendedOptions.Etcd.StorageConfig.Transport.TracerProvider = oteltrace.NewNoopTracerProvider() + } + + storageFactoryConfig := storage.NewStorageFactoryConfig() + storageFactoryConfig.APIResourceConfig = genericConfig.MergedResourceConfig + storageFactory, lastErr = storageFactoryConfig.Complete(s.RecommendedOptions.Etcd).New() + if lastErr != nil { + return + } + if lastErr = s.RecommendedOptions.Etcd.ApplyWithStorageFactoryTo(storageFactory, &genericConfig.Config); lastErr != nil { + return + } + + // UPDATEME: Currently authentication and authorization rely on kubernetes cluster. Support in the future. + /* + ctx := wait.ContextForChannel(genericConfig.DrainedNotify()) + + // Authentication.ApplyTo requires already applied OpenAPIConfig and EgressSelector if present + if lastErr = s.Authentication.ApplyTo(ctx, &genericConfig.Authentication, genericConfig.SecureServing, genericConfig.EgressSelector, genericConfig.OpenAPIConfig, genericConfig.OpenAPIV3Config, clientgoExternalClient, versionedInformers, genericConfig.APIServerID); lastErr != nil { + return + } + + var enablesRBAC bool + genericConfig.Authorization.Authorizer, genericConfig.RuleResolver, enablesRBAC, err = BuildAuthorizer( + ctx, + s, + genericConfig.EgressSelector, + genericConfig.APIServerID, + versionedInformers, + ) + if err != nil { + lastErr = fmt.Errorf("invalid authorization config: %v", err) + return + } + if s.Authorization != nil && !enablesRBAC { + genericConfig.DisabledPostStartHooks.Insert(rbacrest.PostStartHookName) + } + */ + + lastErr = s.RecommendedOptions.Audit.ApplyTo(&genericConfig.Config) + if lastErr != nil { + return + } + + if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.AggregatedDiscoveryEndpoint) { + genericConfig.AggregatedDiscoveryGroupManager = aggregated.NewResourceManager("apis") + } + + return +} + +// CreatePeerEndpointLeaseReconciler creates a apiserver endpoint lease reconciliation loop +// The peer endpoint leases are used to find network locations of apiservers for peer proxy +func CreatePeerEndpointLeaseReconciler(c genericapiserver.Config, storageFactory serverstorage.StorageFactory) (reconcilers.PeerEndpointLeaseReconciler, error) { + ttl := controlplane.DefaultEndpointReconcilerTTL + config, err := storageFactory.NewConfig(api.Resource("apiServerPeerIPInfo")) + if err != nil { + return nil, fmt.Errorf("error creating storage factory config: %w", err) + } + reconciler, err := reconcilers.NewPeerEndpointLeaseReconciler(config, "/peerserverleases/", ttl) + return reconciler, err +} + +func BuildPeerProxy(versionedInformer kubeinformers.SharedInformerFactory, svm storageversion.Manager, + proxyClientCertFile string, proxyClientKeyFile string, peerCAFile string, peerAdvertiseAddress reconcilers.PeerAdvertiseAddress, + apiServerID string, reconciler reconcilers.PeerEndpointLeaseReconciler, serializer runtime.NegotiatedSerializer) (utilpeerproxy.Interface, error) { + if proxyClientCertFile == "" { + return nil, fmt.Errorf("error building peer proxy handler, proxy-cert-file not specified") + } + if proxyClientKeyFile == "" { + return nil, fmt.Errorf("error building peer proxy handler, proxy-key-file not specified") + } + // create proxy client config + clientConfig := &transport.Config{ + TLS: transport.TLSConfig{ + Insecure: false, + CertFile: proxyClientCertFile, + KeyFile: proxyClientKeyFile, + CAFile: peerCAFile, + ServerName: "kubernetes.default.svc", + }} + + // build proxy transport + proxyRoundTripper, transportBuildingError := transport.New(clientConfig) + if transportBuildingError != nil { + klog.Error(transportBuildingError.Error()) + return nil, transportBuildingError + } + return utilpeerproxy.NewPeerProxyHandler( + versionedInformer, + svm, + proxyRoundTripper, + apiServerID, + reconciler, + serializer, + ), nil +} + +func convertVersion(info version.Info) *kversion.Info { + v, _ := semver.Make(info.GitVersion) + return &kversion.Info{ + Major: strconv.FormatUint(v.Major, 10), + Minor: strconv.FormatUint(v.Minor, 10), + GitVersion: info.GitVersion, + GitCommit: info.GitCommit, + GitTreeState: info.GitTreeState, + BuildDate: info.BuildDate, + GoVersion: info.GoVersion, + Compiler: info.Compiler, + Platform: info.Platform, + } +} diff --git a/internal/controlplane/apiserver/options/options.go b/internal/controlplane/apiserver/options/options.go new file mode 100644 index 00000000000..cb0d453affd --- /dev/null +++ b/internal/controlplane/apiserver/options/options.go @@ -0,0 +1,242 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +// Package options contains flags and options for initializing an apiserver +package options + +import ( + "fmt" + "net" + "os" + "strings" + "time" + + //"k8s.io/apimachinery/pkg/runtime" + //"k8s.io/apimachinery/pkg/runtime/schema" + corev1 "k8s.io/api/core/v1" + "k8s.io/apiserver/pkg/admission" + peerreconcilers "k8s.io/apiserver/pkg/reconcilers" + genericoptions "k8s.io/apiserver/pkg/server/options" + cliflag "k8s.io/component-base/cli/flag" + "k8s.io/component-base/logs" + logsapi "k8s.io/component-base/logs/api/v1" + "k8s.io/component-base/metrics" + "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/api/legacyscheme" + netutils "k8s.io/utils/net" + + "github.com/superproj/onex/internal/pkg/options" + "github.com/superproj/onex/pkg/generated/informers" +) + +const defaultEtcdPathPrefix = "/registry/onex.io" + +// Options contains state for master/api server. +type Options struct { + // RecommendedOptions *genericoptions.RecommendedOptions + GenericServerRunOptions *genericoptions.ServerRunOptions + RecommendedOptions *options.RecommendedOptions + Features *genericoptions.FeatureOptions + Metrics *metrics.Options + Logs *logs.Options + Traces *genericoptions.TracingOptions + // CloudOptions *cloud.CloudOptions + APIEnablement *genericoptions.APIEnablementOptions + AlternateDNS []string + + ProxyClientCertFile string + ProxyClientKeyFile string + + // PeerCAFile is the ca bundle used by this kube-apiserver to verify peer apiservers' + // serving certs when routing a request to the peer in the case the request can not be served + // locally due to version skew. + PeerCAFile string + + // PeerAdvertiseAddress is the IP for this kube-apiserver which is used by peer apiservers to route a request + // to this apiserver. This happens in cases where the peer is not able to serve the request due to + // version skew. + PeerAdvertiseAddress peerreconcilers.PeerAdvertiseAddress + + EnableAggregatorRouting bool + AggregatorRejectForwardingRedirects bool + + EnableLogsHandler bool + EventTTL time.Duration + InternalVersionedInformers informers.SharedInformerFactory +} + +// completedServerRunOptions is a private wrapper that enforces a call of Complete() before Run can be invoked. +type completedOptions struct { + Options +} + +type CompletedOptions struct { + // Embed a private pointer that cannot be instantiated outside of this package. + *completedOptions +} + +// NewOptions returns a new Options. +func NewOptions() *Options { + o := &Options{ + GenericServerRunOptions: genericoptions.NewServerRunOptions(), + RecommendedOptions: options.NewRecommendedOptions( + defaultEtcdPathPrefix, + legacyscheme.Codecs.LegacyCodec(corev1.SchemeGroupVersion), // NOTICE: [Custom API] Set default with corev1.SchemeGroupVersion + ), + Features: genericoptions.NewFeatureOptions(), + Metrics: metrics.NewOptions(), + Logs: logs.NewOptions(), + Traces: genericoptions.NewTracingOptions(), + APIEnablement: genericoptions.NewAPIEnablementOptions(), + + AlternateDNS: []string{"onex.io"}, + EnableLogsHandler: true, + EventTTL: 2 * time.Hour, + EnableAggregatorRouting: false, + // CloudOptions: cloud.NewCloudOptions(), + } + + // NOTICE: Commented out temporarily, no side effects observed. + /* + o.RecommendedOptions.Etcd.StorageConfig.EncodeVersioner = runtime.NewMultiGroupVersioner( + v1beta1.SchemeGroupVersion, + schema.GroupKind{Group: v1beta1.GroupName}, + ) + */ + + // Redirect the certificates output directory to avoid creating the "apiserver.local.config" directory in the root directory + // and keep the root directory clean. + o.RecommendedOptions.SecureServing.ServerCert.CertDirectory = "_output/certificates" + + // the following three lines remove dependence with kube-apiserver + o.RecommendedOptions.Authorization = nil + o.RecommendedOptions.CoreAPI.CoreAPIKubeconfigPath = "/home/colin/.onex/config.local" + // We only register the plugin of onex-apiserver, + // so we need to clear the plugin registered by apiserver by default. + o.RecommendedOptions.Admission.Plugins = admission.NewPlugins() + + // register all custom dmission plugins + RegisterAllAdmissionPlugins(o.RecommendedOptions.Admission.Plugins) + o.RecommendedOptions.Admission.RecommendedPluginOrder = AllOrderedPlugins + o.RecommendedOptions.Admission.DefaultOffPlugins = DefaultOffAdmissionPlugins() + + // Overwrite the default for storage data format. + o.RecommendedOptions.Etcd.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf" + return o +} + +func (o *Options) AddFlags(fss *cliflag.NamedFlagSets) { + // Add the generic flags. + o.GenericServerRunOptions.AddUniversalFlags(fss.FlagSet("generic")) + o.RecommendedOptions.AddFlags(fss.FlagSet("recommended")) + o.Features.AddFlags(fss.FlagSet("features")) + o.APIEnablement.AddFlags(fss.FlagSet("API enablement")) + o.Metrics.AddFlags(fss.FlagSet("metrics")) + logsapi.AddFlags(o.Logs, fss.FlagSet("logs")) + o.Traces.AddFlags(fss.FlagSet("traces")) + // o.CloudOptions.AddFlags(fss.FlagSet("cloud")) + + // Note: the weird ""+ in below lines seems to be the only way to get gofmt to + // arrange these text blocks sensibly. Grrr. + fs := fss.FlagSet("misc") + fs.StringSliceVar(&o.AlternateDNS, "alternate-dns", o.AlternateDNS, "Specify an alternate DNS to use (e.g. 'onex.io').") + fs.DurationVar(&o.EventTTL, "event-ttl", o.EventTTL, "Amount of time to retain events.") + + fs.BoolVar(&o.EnableLogsHandler, "enable-logs-handler", o.EnableLogsHandler, + "If true, install a /logs handler for the apiserver logs.") + _ = fs.MarkDeprecated("enable-logs-handler", "This flag will be removed in v1.19") + + fs.StringVar(&o.ProxyClientCertFile, "proxy-client-cert-file", o.ProxyClientCertFile, ""+ + "Client certificate used to prove the identity of the aggregator or kube-apiserver "+ + "when it must call out during a request. This includes proxying requests to a user "+ + "api-server and calling out to webhook admission plugins. It is expected that this "+ + "cert includes a signature from the CA in the --requestheader-client-ca-file flag. "+ + "That CA is published in the 'extension-apiserver-authentication' configmap in "+ + "the kube-system namespace. Components receiving calls from kube-aggregator should "+ + "use that CA to perform their half of the mutual TLS verification.") + fs.StringVar(&o.ProxyClientKeyFile, "proxy-client-key-file", o.ProxyClientKeyFile, ""+ + "Private key for the client certificate used to prove the identity of the aggregator or kube-apiserver "+ + "when it must call out during a request. This includes proxying requests to a user "+ + "api-server and calling out to webhook admission plugins.") + + fs.StringVar(&o.PeerCAFile, "peer-ca-file", o.PeerCAFile, + "If set and the UnknownVersionInteroperabilityProxy feature gate is enabled, this file will be used to verify serving certificates of peer kube-apiservers. "+ + "This flag is only used in clusters configured with multiple kube-apiservers for high availability.") + + fs.StringVar(&o.PeerAdvertiseAddress.PeerAdvertiseIP, "peer-advertise-ip", o.PeerAdvertiseAddress.PeerAdvertiseIP, + "If set and the UnknownVersionInteroperabilityProxy feature gate is enabled, this IP will be used by peer kube-apiservers to proxy requests to this kube-apiserver "+ + "when the request cannot be handled by the peer due to version skew between the kube-apiservers. "+ + "This flag is only used in clusters configured with multiple kube-apiservers for high availability. ") + + fs.StringVar(&o.PeerAdvertiseAddress.PeerAdvertisePort, "peer-advertise-port", o.PeerAdvertiseAddress.PeerAdvertisePort, + "If set and the UnknownVersionInteroperabilityProxy feature gate is enabled, this port will be used by peer kube-apiservers to proxy requests to this kube-apiserver "+ + "when the request cannot be handled by the peer due to version skew between the kube-apiservers. "+ + "This flag is only used in clusters configured with multiple kube-apiservers for high availability. ") + + fs.BoolVar(&o.EnableAggregatorRouting, "enable-aggregator-routing", o.EnableAggregatorRouting, + "Turns on aggregator routing requests to endpoints IP rather than cluster IP.") + + fs.BoolVar(&o.AggregatorRejectForwardingRedirects, "aggregator-reject-forwarding-redirect", o.AggregatorRejectForwardingRedirects, + "Aggregator reject forwarding redirect response back to client.") +} + +func (o *Options) Complete() (CompletedOptions, error) { + if o == nil { + return CompletedOptions{completedOptions: &completedOptions{}}, nil + } + + completed := completedOptions{Options: *o} + + // set defaults + if err := completed.GenericServerRunOptions.DefaultAdvertiseAddress(completed.RecommendedOptions.SecureServing.SecureServingOptions); err != nil { + return CompletedOptions{}, err + } + + // TODO have a "real" external address + if err := completed.RecommendedOptions.SecureServing.MaybeDefaultWithSelfSignedCerts( + completed.GenericServerRunOptions.AdvertiseAddress.String(), + completed.AlternateDNS, + []net.IP{netutils.ParseIPSloppy("127.0.0.1")}); err != nil { + return CompletedOptions{}, fmt.Errorf("error creating self-signed certificates: %w", err) + } + + //nolint: nestif + if len(completed.GenericServerRunOptions.ExternalHost) == 0 { + if len(completed.GenericServerRunOptions.AdvertiseAddress) > 0 { + completed.GenericServerRunOptions.ExternalHost = completed.GenericServerRunOptions.AdvertiseAddress.String() + } else { + if hostname, err := os.Hostname(); err == nil { + completed.GenericServerRunOptions.ExternalHost = hostname + } else { + return CompletedOptions{}, fmt.Errorf("error finding host name: %w", err) + } + } + klog.Infof("external host was not specified, using %v", completed.GenericServerRunOptions.ExternalHost) + } + + // UPDATEME: When add authorization and authentication features + /* + // put authorization options in final state + completed.Authorization.Complete() + // adjust authentication for completed authorization + completed.Authentication.ApplyAuthorization(completed.Authorization) + */ + + for key, value := range completed.APIEnablement.RuntimeConfig { + if key == "v1" || strings.HasPrefix(key, "v1/") || + key == "api/v1" || strings.HasPrefix(key, "api/v1/") { + delete(completed.APIEnablement.RuntimeConfig, key) + completed.APIEnablement.RuntimeConfig["/v1"] = value + } + if key == "api/legacy" { + delete(completed.APIEnablement.RuntimeConfig, key) + } + } + + return CompletedOptions{ + completedOptions: &completed, + }, nil +} diff --git a/cmd/onex-apiserver/app/options/plugins.go b/internal/controlplane/apiserver/options/plugins.go similarity index 75% rename from cmd/onex-apiserver/app/options/plugins.go rename to internal/controlplane/apiserver/options/plugins.go index 0371c3be120..1011aa4b7ea 100644 --- a/cmd/onex-apiserver/app/options/plugins.go +++ b/internal/controlplane/apiserver/options/plugins.go @@ -16,11 +16,12 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apiserver/pkg/admission" - "github.com/superproj/onex/internal/admission/plugin/admit" - "github.com/superproj/onex/internal/admission/plugin/deny" - "github.com/superproj/onex/internal/admission/plugin/namespace/autoprovision" - "github.com/superproj/onex/internal/admission/plugin/namespace/exists" - "github.com/superproj/onex/internal/admission/plugin/namespace/lifecycle" + "github.com/superproj/onex/internal/controlplane/admission/plugin/admit" + "github.com/superproj/onex/internal/controlplane/admission/plugin/deny" + //"github.com/superproj/onex/internal/controlplane/admission/plugin/minerset" + "github.com/superproj/onex/internal/controlplane/admission/plugin/namespace/autoprovision" + "github.com/superproj/onex/internal/controlplane/admission/plugin/namespace/exists" + "github.com/superproj/onex/internal/controlplane/admission/plugin/namespace/lifecycle" ) // AllOrderedPlugins is the list of all the plugins in order. @@ -32,6 +33,7 @@ var AllOrderedPlugins = []string{ // new admission plugins should generally be inserted above here // webhook, resourcequota, and deny plugins must go at the end + //minerset.PluginName, // MinerSet // mutatingwebhook.PluginName, // MutatingAdmissionWebhook // validatingwebhook.PluginName, // ValidatingAdmissionWebhook @@ -46,6 +48,7 @@ func RegisterAllAdmissionPlugins(plugins *admission.Plugins) { autoprovision.Register(plugins) lifecycle.Register(plugins) exists.Register(plugins) + //minerset.Register(plugins) deny.Register(plugins) // DEPRECATED as no real meaning } @@ -56,7 +59,5 @@ func DefaultOffAdmissionPlugins() sets.String { lifecycle.PluginName, // NamespaceLifecycle ) - defaultOffPlugins := sets.NewString(AllOrderedPlugins...).Difference(defaultOnPlugins) - - return defaultOffPlugins + return sets.NewString(AllOrderedPlugins...).Difference(defaultOnPlugins) } diff --git a/internal/controlplane/apiserver/options/validation.go b/internal/controlplane/apiserver/options/validation.go new file mode 100644 index 00000000000..590b4d46891 --- /dev/null +++ b/internal/controlplane/apiserver/options/validation.go @@ -0,0 +1,48 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package options + +import ( + "fmt" + + apiextensionsapiserver "k8s.io/apiextensions-apiserver/pkg/apiserver" + utilfeature "k8s.io/apiserver/pkg/util/feature" + aggregatorscheme "k8s.io/kube-aggregator/pkg/apiserver/scheme" + "k8s.io/kubernetes/pkg/api/legacyscheme" + "k8s.io/kubernetes/pkg/features" +) + +// Validate checks ServerRunOptions and return a slice of found errs. +func (o *Options) Validate() []error { + errs := []error{} + errs = append(errs, o.GenericServerRunOptions.Validate()...) + errs = append(errs, o.RecommendedOptions.Validate()...) + errs = append(errs, o.Features.Validate()...) + errs = append(errs, o.Metrics.Validate()...) + errs = append(errs, o.Traces.Validate()...) + errs = append(errs, o.APIEnablement.Validate(legacyscheme.Scheme, apiextensionsapiserver.Scheme, aggregatorscheme.Scheme)...) + // errs = append(errs, o.CloudOptions.Validate()...) + errs = append(errs, validateUnknownVersionInteroperabilityProxyFlags(o)...) + + return errs +} + +func validateUnknownVersionInteroperabilityProxyFlags(options *Options) []error { + err := []error{} + if !utilfeature.DefaultFeatureGate.Enabled(features.UnknownVersionInteroperabilityProxy) { + if options.PeerCAFile != "" { + err = append(err, fmt.Errorf("--peer-ca-file requires UnknownVersionInteroperabilityProxy feature to be turned on")) + } + if options.PeerAdvertiseAddress.PeerAdvertiseIP != "" { + err = append(err, fmt.Errorf("--peer-advertise-ip requires UnknownVersionInteroperabilityProxy feature to be turned on")) + } + if options.PeerAdvertiseAddress.PeerAdvertisePort != "" { + err = append(err, fmt.Errorf("--peer-advertise-port requires UnknownVersionInteroperabilityProxy feature to be turned on")) + } + } + return err +} diff --git a/internal/apiserver/controller/systemnamespaces/system_namespaces_controller.go b/internal/controlplane/controller/systemnamespaces/system_namespaces_controller.go similarity index 99% rename from internal/apiserver/controller/systemnamespaces/system_namespaces_controller.go rename to internal/controlplane/controller/systemnamespaces/system_namespaces_controller.go index cb4ed9ced27..78e5f8311c6 100644 --- a/internal/apiserver/controller/systemnamespaces/system_namespaces_controller.go +++ b/internal/controlplane/controller/systemnamespaces/system_namespaces_controller.go @@ -34,7 +34,7 @@ import ( "k8s.io/klog/v2" "github.com/superproj/onex/pkg/generated/clientset/versioned" - coreinformers "github.com/superproj/onex/pkg/generated/informers/externalversions/core/v1" + coreinformers "github.com/superproj/onex/pkg/generated/informers/core/v1" listers "github.com/superproj/onex/pkg/generated/listers/core/v1" ) diff --git a/internal/controlplane/doc.go b/internal/controlplane/doc.go new file mode 100644 index 00000000000..ee6d10ca432 --- /dev/null +++ b/internal/controlplane/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 controlplane contains code for setting up and running a OneX control plane API server. +package controlplane // import "github.com/superproj/onex/internal/controlplane" diff --git a/internal/controlplane/import_known_versions.go b/internal/controlplane/import_known_versions.go new file mode 100644 index 00000000000..a1dcc5d2c14 --- /dev/null +++ b/internal/controlplane/import_known_versions.go @@ -0,0 +1,17 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package controlplane + +// UPDATEME: When add new api group. +import ( + // These imports are the API groups the API server will support. + _ "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/install" + _ "k8s.io/kubernetes/pkg/apis/autoscaling/install" + _ "k8s.io/kubernetes/pkg/apis/coordination/install" + _ "k8s.io/kubernetes/pkg/apis/core/install" + _ "k8s.io/kubernetes/pkg/apis/flowcontrol/install" +) diff --git a/internal/apiserver/apiserver.go b/internal/controlplane/instance.go similarity index 62% rename from internal/apiserver/apiserver.go rename to internal/controlplane/instance.go index 32339feba49..95f37ce740c 100644 --- a/internal/apiserver/apiserver.go +++ b/internal/controlplane/instance.go @@ -4,36 +4,68 @@ // this file is https://github.com/superproj/onex. // -package apiserver +package controlplane import ( "context" "fmt" + "net/http" + "reflect" "time" + coordinationv1 "k8s.io/api/coordination/v1" + apiv1 "k8s.io/api/core/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" apiserverfeatures "k8s.io/apiserver/pkg/features" + peerreconcilers "k8s.io/apiserver/pkg/reconcilers" "k8s.io/apiserver/pkg/registry/generic" genericapiserver "k8s.io/apiserver/pkg/server" serverstorage "k8s.io/apiserver/pkg/server/storage" utilfeature "k8s.io/apiserver/pkg/util/feature" + utilpeerproxy "k8s.io/apiserver/pkg/util/peerproxy" + kubeinformers "k8s.io/client-go/informers" "k8s.io/klog/v2" "k8s.io/kubernetes/pkg/routes" - "github.com/superproj/onex/internal/apiserver/controller/systemnamespaces" - "github.com/superproj/onex/internal/apiserver/storage" + "github.com/superproj/onex/internal/controlplane/controller/systemnamespaces" + "github.com/superproj/onex/internal/controlplane/storage" "github.com/superproj/onex/internal/pkg/config/minerprofile" - appsrest "github.com/superproj/onex/internal/registry/apps/rest" coordinationrest "github.com/superproj/onex/internal/registry/coordination/rest" corerest "github.com/superproj/onex/internal/registry/core/rest" - "github.com/superproj/onex/pkg/apis/apps/v1beta1" - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" - apiv1 "github.com/superproj/onex/pkg/apis/core/v1" + flowcontrolrest "github.com/superproj/onex/internal/registry/flowcontrol/rest" "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" ) +const ( + // DefaultEndpointReconcilerInterval is the default amount of time for how often the endpoints for + // the kubernetes Service are reconciled. + DefaultEndpointReconcilerInterval = 10 * time.Second + // DefaultEndpointReconcilerTTL is the default TTL timeout for the storage layer + DefaultEndpointReconcilerTTL = 15 * time.Second + // IdentityLeaseComponentLabelKey is used to apply a component label to identity lease objects, indicating: + // 1. the lease is an identity lease (different from leader election leases) + // 2. which component owns this lease + IdentityLeaseComponentLabelKey = "apiserver.kubernetes.io/identity" + // KubeAPIServer defines variable used internally when referring to kube-apiserver component + KubeAPIServer = "kube-apiserver" + // KubeAPIServerIdentityLeaseLabelSelector selects kube-apiserver identity leases + KubeAPIServerIdentityLeaseLabelSelector = IdentityLeaseComponentLabelKey + "=" + KubeAPIServer + // repairLoopInterval defines the interval used to run the Services ClusterIP and NodePort repair loops + repairLoopInterval = 3 * time.Minute +) + +type ExternalSharedInformerFactory interface { + // Start initializes all requested informers. They are handled in goroutines + // which run until the stop channel gets closed. + Start(stopCh <-chan struct{}) + // WaitForCacheSync blocks until all started informers' caches were synced + // or the stop channel gets closed. + WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool +} + // ExtraConfig defines extra configuration for the onex-apiserver. type ExtraConfig struct { // Place you custom config here. @@ -41,8 +73,26 @@ type ExtraConfig struct { StorageFactory serverstorage.StorageFactory EventTTL time.Duration EnableLogsSupport bool - VersionedInformers informers.SharedInformerFactory - SharedInformerFactory informers.SharedInformerFactory + ProxyTransport *http.Transport + + // PeerProxy, if not nil, sets proxy transport between kube-apiserver peers for requests + // that can not be served locally + PeerProxy utilpeerproxy.Interface + // PeerEndpointLeaseReconciler updates the peer endpoint leases + PeerEndpointLeaseReconciler peerreconcilers.PeerEndpointLeaseReconciler + + // For external resources and rest storage providers. + ExternalRESTStorageProviders []storage.RESTStorageProvider + //ExternalGroupResources []schema.GroupResource + + // Number of masters running; all masters must be started with the + // same value for this field. (Numbers > 1 currently untested.) + MasterCount int + + KubeVersionedInformers kubeinformers.SharedInformerFactory + InternalVersionedInformers informers.SharedInformerFactory + ExternalVersionedInformers ExternalSharedInformerFactory + ExternalPostStartHooks map[string]genericapiserver.PostStartHookFunc } // Config defines configuration for the onex-apiserver. @@ -53,7 +103,7 @@ type Config struct { type completedConfig struct { GenericConfig genericapiserver.CompletedConfig - ExtraConfig *ExtraConfig + ExtraConfig ExtraConfig } // CompletedConfig embeds a private pointer that cannot be instantiated outside of this package. @@ -61,45 +111,33 @@ type CompletedConfig struct { *completedConfig } -type runnable interface { - Run(stopCh <-chan struct{}) error -} - -// preparedAPIServer is a private wrapper that enforces a call of PrepareRun() before Run can be invoked. -type preparedAPIServer struct { - *APIServer - runnable runnable -} - -// APIServer contains state for a onex-apiserver. -type APIServer struct { +// Instance contains state for a onex-apiserver instance. +type Instance struct { GenericAPIServer *genericapiserver.GenericAPIServer } // Complete fills in any fields not set that are required to have valid data. It's mutating the receiver. -func (c *Config) Complete() (CompletedConfig, error) { - cfg := completedConfig{ +func (c *Config) Complete() CompletedConfig { + return CompletedConfig{&completedConfig{ GenericConfig: c.GenericConfig.Complete(), - ExtraConfig: &c.ExtraConfig, - } - - return CompletedConfig{&cfg}, nil + ExtraConfig: c.ExtraConfig, + }} } // New returns a new instance of APIServer from the given config. // Certain config fields will be set to a default value if unset. -func (c completedConfig) New() (*APIServer, error) { - genericServer, err := c.GenericConfig.New("onex-apiserver", genericapiserver.NewEmptyDelegate()) +func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*Instance, error) { + s, err := c.GenericConfig.New("onex-apiserver", delegationTarget) if err != nil { return nil, err } if c.ExtraConfig.EnableLogsSupport { - routes.Logs{}.Install(genericServer.Handler.GoRestfulContainer) + routes.Logs{}.Install(s.Handler.GoRestfulContainer) } - s := &APIServer{ - GenericAPIServer: genericServer, + m := &Instance{ + GenericAPIServer: s, } clientset, err := versioned.NewForConfig(c.GenericConfig.LoopbackClientConfig) @@ -110,7 +148,7 @@ func (c completedConfig) New() (*APIServer, error) { // Install onex legacy rest storage // This part of the code is different from kube-apiserver because // we do not need to install all kube-apiserver legacy APIs. - if err := s.InstallLegacyAPI(&c, c.GenericConfig.RESTOptionsGetter); err != nil { + if err := m.InstallLegacyAPI(&c, c.GenericConfig.RESTOptionsGetter); err != nil { return nil, err } @@ -123,15 +161,16 @@ func (c completedConfig) New() (*APIServer, error) { // handlers that we have. restStorageProviders := []storage.RESTStorageProvider{ // &admissionrest.StorageProvider{LoopbackClientConfig: c.GenericConfig.LoopbackClientConfig}, - appsrest.RESTStorageProvider{}, coordinationrest.RESTStorageProvider{}, + flowcontrolrest.RESTStorageProvider{InformerFactory: c.ExtraConfig.InternalVersionedInformers}, } - if err := s.InstallAPIs(c.ExtraConfig.APIResourceConfigSource, c.GenericConfig.RESTOptionsGetter, restStorageProviders...); err != nil { + restStorageProviders = append(restStorageProviders, c.ExtraConfig.ExternalRESTStorageProviders...) + if err := m.InstallAPIs(c.ExtraConfig.APIResourceConfigSource, c.GenericConfig.RESTOptionsGetter, restStorageProviders...); err != nil { return nil, err } - s.GenericAPIServer.AddPostStartHookOrDie("start-system-namespaces-controller", func(hookContext genericapiserver.PostStartHookContext) error { - go systemnamespaces.NewController(clientset, c.ExtraConfig.VersionedInformers.Core().V1().Namespaces()).Run(hookContext.StopCh) + m.GenericAPIServer.AddPostStartHookOrDie("start-system-namespaces-controller", func(hookContext genericapiserver.PostStartHookContext) error { + go systemnamespaces.NewController(clientset, c.ExtraConfig.InternalVersionedInformers.Core().V1().Namespaces()).Run(hookContext.StopCh) return nil }) @@ -139,25 +178,27 @@ func (c completedConfig) New() (*APIServer, error) { // add post start hooks which onex-apiserver needs // TODO: copy from kube-apiserver - s.GenericAPIServer.AddPostStartHookOrDie( - "start-onex-server-informers", + m.GenericAPIServer.AddPostStartHookOrDie( + "start-internal-informers", func(context genericapiserver.PostStartHookContext) error { // remove dependence with kube-apiserver - c.ExtraConfig.VersionedInformers.Start(context.StopCh) + c.ExtraConfig.KubeVersionedInformers.Start(context.StopCh) + c.ExtraConfig.InternalVersionedInformers.Start(context.StopCh) return nil }, ) - s.GenericAPIServer.AddPostStartHookOrDie( - "start-onex-informers", + m.GenericAPIServer.AddPostStartHookOrDie( + "start-external-informers", func(context genericapiserver.PostStartHookContext) error { - // remove dependence with kube-apiserver - c.ExtraConfig.SharedInformerFactory.Start(context.StopCh) + if c.ExtraConfig.ExternalVersionedInformers != nil { + c.ExtraConfig.ExternalVersionedInformers.Start(context.StopCh) + } return nil }, ) - s.GenericAPIServer.AddPostStartHookOrDie( + m.GenericAPIServer.AddPostStartHookOrDie( "initialize-instance-config-client", func(ctx genericapiserver.PostStartHookContext) error { client, err := versioned.NewForConfig(ctx.LoopbackClientConfig) @@ -184,22 +225,21 @@ func (c completedConfig) New() (*APIServer, error) { // put some post start hook here // refer to: https://github.com/kubernetes/kubernetes/blob/v1.29.3/pkg/controlplane/instance.go#L515 } + // Add PostStartHooks for Unknown Version Proxy filter. + if c.ExtraConfig.PeerProxy != nil { + c.GenericConfig.AddPostStartHookOrDie("unknown-version-proxy-filter", func(context genericapiserver.PostStartHookContext) error { + err := c.ExtraConfig.PeerProxy.WaitForCacheSync(context.StopCh) + return err + }) + } - return s, nil -} - -// PrepareRun prepares the apiserver to run, by calling the generic PrepareRun. -func (s *APIServer) PrepareRun() (preparedAPIServer, error) { - prepared := s.GenericAPIServer.PrepareRun() - return preparedAPIServer{runnable: prepared}, nil -} - -func (s preparedAPIServer) Run(stopCh <-chan struct{}) error { - return s.runnable.Run(stopCh) + return m, nil } // InstallLegacyAPI will install the legacy APIs for the restStorageProviders if they are enabled. -func (s *APIServer) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.RESTOptionsGetter) error { +func (m *Instance) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.RESTOptionsGetter) error { + // This is different from the implementation of kube-apiserver, where we directly configure the + // LegacyRESTStorageProvider field. Although it's a bit heavy-handed, it's definitely more convenient. legacyRESTStorageProvider := corerest.LegacyRESTStorageProvider{ EventTTL: c.ExtraConfig.EventTTL, // If necessary in the future, you can uncomment the following comment codes @@ -216,14 +256,14 @@ func (s *APIServer) InstallLegacyAPI(c *completedConfig, restOptionsGetter gener return nil } - if err := s.GenericAPIServer.InstallLegacyAPIGroup(genericapiserver.DefaultLegacyAPIPrefix, &apiGroupInfo); err != nil { + if err := m.GenericAPIServer.InstallLegacyAPIGroup(genericapiserver.DefaultLegacyAPIPrefix, &apiGroupInfo); err != nil { return fmt.Errorf("error in registering group versions: %w", err) } return nil } -// APIServer will install the APIs for the restStorageProviders if they are enabled. -func (s *APIServer) InstallAPIs( +// Instance will install the APIs for the restStorageProviders if they are enabled. +func (m *Instance) InstallAPIs( apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter, restStorageProviders ...storage.RESTStorageProvider, @@ -231,7 +271,7 @@ func (s *APIServer) InstallAPIs( nonLegacy := []*genericapiserver.APIGroupInfo{} // used later in the loop to filter the served resource by those that have expired. - resourceExpirationEvaluator, err := genericapiserver.NewResourceExpirationEvaluator(*s.GenericAPIServer.Version) + resourceExpirationEvaluator, err := genericapiserver.NewResourceExpirationEvaluator(*m.GenericAPIServer.Version) if err != nil { return err } @@ -270,12 +310,12 @@ func (s *APIServer) InstallAPIs( if err != nil { klog.Fatalf("Error building PostStartHook: %v", err) } - s.GenericAPIServer.AddPostStartHookOrDie(name, hook) + m.GenericAPIServer.AddPostStartHookOrDie(name, hook) } if len(groupName) == 0 { // the legacy group for core APIs is special that it is installed into /api via this special install method. - if err := s.GenericAPIServer.InstallLegacyAPIGroup(genericapiserver.DefaultLegacyAPIPrefix, &apiGroupInfo); err != nil { + if err := m.GenericAPIServer.InstallLegacyAPIGroup(genericapiserver.DefaultLegacyAPIPrefix, &apiGroupInfo); err != nil { return fmt.Errorf("error in registering legacy API: %w", err) } } else { @@ -284,18 +324,20 @@ func (s *APIServer) InstallAPIs( } } - if err := s.GenericAPIServer.InstallAPIGroups(nonLegacy...); err != nil { + if err := m.GenericAPIServer.InstallAPIGroups(nonLegacy...); err != nil { return fmt.Errorf("error in registering group versions: %w", err) } return nil } var ( + // UPDATEME: When add new api group. // stableAPIGroupVersionsEnabledByDefault is a list of our stable versions. stableAPIGroupVersionsEnabledByDefault = []schema.GroupVersion{ apiv1.SchemeGroupVersion, - v1beta1.SchemeGroupVersion, coordinationv1.SchemeGroupVersion, + flowcontrolv1.SchemeGroupVersion, + // v1beta1.SchemeGroupVersion, // Migrate to WithOptions } // legacyBetaEnabledByDefaultResources is the list of beta resources we enable. You may only add to this list @@ -323,3 +365,7 @@ func DefaultAPIResourceConfigSource() *serverstorage.ResourceConfig { return ret } + +func AddStableAPIGroupVersionsEnabledByDefault(versions ...schema.GroupVersion) { + stableAPIGroupVersionsEnabledByDefault = append(stableAPIGroupVersionsEnabledByDefault, versions...) +} diff --git a/internal/apiserver/scheme.go b/internal/controlplane/scheme.go similarity index 98% rename from internal/apiserver/scheme.go rename to internal/controlplane/scheme.go index 1bb40acae81..bd72c7732a8 100644 --- a/internal/apiserver/scheme.go +++ b/internal/controlplane/scheme.go @@ -4,7 +4,7 @@ // this file is https://github.com/superproj/onex. // -package apiserver +package controlplane import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/internal/apiserver/storage/default_storage_factory_builder.go b/internal/controlplane/storage/default_storage_factory_builder.go similarity index 81% rename from internal/apiserver/storage/default_storage_factory_builder.go rename to internal/controlplane/storage/default_storage_factory_builder.go index 8fcd5e040e3..ee7b420ea73 100644 --- a/internal/apiserver/storage/default_storage_factory_builder.go +++ b/internal/controlplane/storage/default_storage_factory_builder.go @@ -16,15 +16,18 @@ import ( serverstorage "k8s.io/apiserver/pkg/server/storage" "k8s.io/apiserver/pkg/storage/storagebackend" "k8s.io/kubernetes/pkg/api/legacyscheme" - api "k8s.io/kubernetes/pkg/apis/core" - "k8s.io/kubernetes/pkg/apis/events" - "k8s.io/kubernetes/pkg/apis/extensions" - - "github.com/superproj/onex/pkg/apis/apps" + //api "k8s.io/kubernetes/pkg/apis/core" + //"k8s.io/kubernetes/pkg/apis/events" + //"k8s.io/kubernetes/pkg/apis/extensions" + //"github.com/superproj/onex/pkg/apis/apps" ) // SpecialDefaultResourcePrefixes are prefixes compiled into Zero. -var SpecialDefaultResourcePrefixes = map[schema.GroupResource]string{} +var SpecialDefaultResourcePrefixes = map[schema.GroupResource]string{ + // Not in use, just serving as a placeholder. + {Group: "", Resource: "endpoints"}: "services/endpoints", + {Group: "", Resource: "services"}: "services/specs", +} // DefaultWatchCacheSizes defines default resources for which watchcache // should be disabled. @@ -85,10 +88,13 @@ func (c *completedStorageFactoryConfig) New() (*serverstorage.DefaultStorageFact c.APIResourceConfig, SpecialDefaultResourcePrefixes) - storageFactory.AddCohabitatingResources(apps.Resource("chains"), extensions.Resource("chains")) - storageFactory.AddCohabitatingResources(apps.Resource("minersets"), extensions.Resource("minersets")) - storageFactory.AddCohabitatingResources(apps.Resource("miners"), extensions.Resource("miners")) - storageFactory.AddCohabitatingResources(api.Resource("events"), events.Resource("events")) + // NOTICE: In most cases, we do not need this, so let's comment it out first and add a NOTICE as a reminder. + /* + storageFactory.AddCohabitatingResources(apps.Resource("chains"), extensions.Resource("chains")) + storageFactory.AddCohabitatingResources(apps.Resource("minersets"), extensions.Resource("minersets")) + storageFactory.AddCohabitatingResources(apps.Resource("miners"), extensions.Resource("miners")) + storageFactory.AddCohabitatingResources(api.Resource("events"), events.Resource("events")) + */ for _, override := range c.EtcdServersOverrides { tokens := strings.Split(override, "#") diff --git a/internal/apiserver/storage/doc.go b/internal/controlplane/storage/doc.go similarity index 100% rename from internal/apiserver/storage/doc.go rename to internal/controlplane/storage/doc.go diff --git a/internal/apiserver/storage/options/doc.go b/internal/controlplane/storage/options/doc.go similarity index 100% rename from internal/apiserver/storage/options/doc.go rename to internal/controlplane/storage/options/doc.go diff --git a/internal/apiserver/storage/options/etcd_client.go b/internal/controlplane/storage/options/etcd_client.go similarity index 100% rename from internal/apiserver/storage/options/etcd_client.go rename to internal/controlplane/storage/options/etcd_client.go diff --git a/internal/apiserver/storage/options/etcd_storage.go b/internal/controlplane/storage/options/etcd_storage.go similarity index 100% rename from internal/apiserver/storage/options/etcd_storage.go rename to internal/controlplane/storage/options/etcd_storage.go diff --git a/internal/apiserver/storage/storage.go b/internal/controlplane/storage/storage.go similarity index 100% rename from internal/apiserver/storage/storage.go rename to internal/controlplane/storage/storage.go diff --git a/internal/fakeserver/biz/order/order.go b/internal/fakeserver/biz/order/order.go index 52408c61263..04298c54d80 100644 --- a/internal/fakeserver/biz/order/order.go +++ b/internal/fakeserver/biz/order/order.go @@ -13,7 +13,9 @@ import ( "errors" "sync" + "github.com/gammazero/workerpool" "github.com/jinzhu/copier" + "github.com/panjf2000/ants/v2" "golang.org/x/sync/errgroup" "google.golang.org/protobuf/types/known/timestamppb" "gorm.io/gorm" @@ -93,7 +95,7 @@ func (b *orderBiz) List(ctx context.Context, rq *v1.ListOrderRequest) (*v1.ListO eg.Go(func() error { select { case <-ctx.Done(): - return nil + return ctx.Err() default: var o v1.OrderReply _ = copier.Copy(&o, order) @@ -128,6 +130,103 @@ func (b *orderBiz) List(ctx context.Context, rq *v1.ListOrderRequest) (*v1.ListO return &v1.ListOrderResponse{TotalCount: count, Orders: orders}, nil } +// ListWithWorkerPool retrieves a list of all orders from the database use workerpool package. +// Concurrency limits can effectively protect downstream services and control the resource +// consumption of components. +func (b *orderBiz) ListWithWorkerPool(ctx context.Context, rq *v1.ListOrderRequest) (*v1.ListOrderResponse, error) { + count, list, err := b.ds.Orders().List(ctx, meta.WithOffset(rq.Offset), meta.WithLimit(rq.Limit)) + if err != nil { + log.C(ctx).Errorw(err, "Failed to list orders from storage") + return nil, err + } + + var m sync.Map + wp := workerpool.New(100) + + // Use goroutine to improve interface performance + for _, order := range list { + wp.Submit(func() { + var o v1.OrderReply + // Here simulates a time-consuming concurrent logic. + _ = copier.Copy(&o, order) + m.Store(order.ID, &v1.OrderReply{ + OrderID: order.OrderID, + Customer: order.Customer, + Product: order.Product, + Quantity: order.Quantity, + CreatedAt: timestamppb.New(order.CreatedAt), + UpdatedAt: timestamppb.New(order.UpdatedAt), + }) + + return + }) + } + + wp.StopWait() + + // The following code block is used to maintain the consistency of query order. + orders := make([]*v1.OrderReply, 0, len(list)) + for _, item := range list { + order, _ := m.Load(item.ID) + orders = append(orders, order.(*v1.OrderReply)) + } + + log.C(ctx).Debugw("Get orders from backend storage", "count", len(orders)) + + return &v1.ListOrderResponse{TotalCount: count, Orders: orders}, nil +} + +// ListWithAnts retrieves a list of all orders from the database use ants package. +// Concurrency limits can effectively protect downstream services and control the +// resource consumption of components. +func (b *orderBiz) ListWithAnts(ctx context.Context, rq *v1.ListOrderRequest) (*v1.ListOrderResponse, error) { + count, list, err := b.ds.Orders().List(ctx, meta.WithOffset(rq.Offset), meta.WithLimit(rq.Limit)) + if err != nil { + log.C(ctx).Errorw(err, "Failed to list orders from storage") + return nil, err + } + + var m sync.Map + var wg sync.WaitGroup + pool, _ := ants.NewPool(100) + defer pool.Release() + + // Use goroutine to improve interface performance + for _, order := range list { + wg.Add(1) + _ = pool.Submit(func() { + defer wg.Done() + + var o v1.OrderReply + // Here simulates a time-consuming concurrent logic. + _ = copier.Copy(&o, order) + m.Store(order.ID, &v1.OrderReply{ + OrderID: order.OrderID, + Customer: order.Customer, + Product: order.Product, + Quantity: order.Quantity, + CreatedAt: timestamppb.New(order.CreatedAt), + UpdatedAt: timestamppb.New(order.UpdatedAt), + }) + + return + }) + } + + wg.Wait() + + // The following code block is used to maintain the consistency of query order. + orders := make([]*v1.OrderReply, 0, len(list)) + for _, item := range list { + order, _ := m.Load(item.ID) + orders = append(orders, order.(*v1.OrderReply)) + } + + log.C(ctx).Debugw("Get orders from backend storage", "count", len(orders)) + + return &v1.ListOrderResponse{TotalCount: count, Orders: orders}, nil +} + // Update 是 OrderBiz 接口中 `Update` 方法的实现. func (b *orderBiz) Update(ctx context.Context, rq *v1.UpdateOrderRequest) error { orderM, err := b.ds.Orders().Get(ctx, rq.OrderID) diff --git a/internal/fakeserver/fakeserver.go b/internal/fakeserver/fakeserver.go index aa421881d88..c7a87ac9972 100644 --- a/internal/fakeserver/fakeserver.go +++ b/internal/fakeserver/fakeserver.go @@ -7,6 +7,8 @@ package fakeserver import ( + "os" + "github.com/jinzhu/copier" "github.com/superproj/onex/internal/fakeserver/biz" @@ -19,6 +21,14 @@ import ( genericoptions "github.com/superproj/onex/pkg/options" ) +var ( + // Name is the name of the compiled software. + Name = "onex-fakeserver" + + // ID contains the host name and any error encountered during the retrieval. + ID, _ = os.Hostname() +) + // Config represents the configuration of the service. type Config struct { FakeStore bool diff --git a/internal/gateway/biz/biz.go b/internal/gateway/biz/biz.go index 8521007550b..ce8b64017d1 100644 --- a/internal/gateway/biz/biz.go +++ b/internal/gateway/biz/biz.go @@ -15,7 +15,7 @@ import ( "github.com/superproj/onex/internal/gateway/biz/minerset" "github.com/superproj/onex/internal/gateway/store" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" ) // ProviderSet is biz providers. diff --git a/internal/gateway/biz/miner/miner.go b/internal/gateway/biz/miner/miner.go index b5b1b6a7f28..b03e6ceb929 100644 --- a/internal/gateway/biz/miner/miner.go +++ b/internal/gateway/biz/miner/miner.go @@ -21,7 +21,7 @@ import ( v1 "github.com/superproj/onex/pkg/api/gateway/v1" "github.com/superproj/onex/pkg/apis/apps/v1beta1" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" listers "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" "github.com/superproj/onex/pkg/log" ) diff --git a/internal/gateway/biz/minerset/minerset.go b/internal/gateway/biz/minerset/minerset.go index c544a4032a5..dfa5fb42d7e 100644 --- a/internal/gateway/biz/minerset/minerset.go +++ b/internal/gateway/biz/minerset/minerset.go @@ -21,7 +21,7 @@ import ( v1 "github.com/superproj/onex/pkg/api/gateway/v1" "github.com/superproj/onex/pkg/apis/apps/v1beta1" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" listers "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" "github.com/superproj/onex/pkg/log" ) diff --git a/internal/gateway/gateway.go b/internal/gateway/gateway.go index a6334c1b112..afe2bc3106a 100644 --- a/internal/gateway/gateway.go +++ b/internal/gateway/gateway.go @@ -18,7 +18,7 @@ import ( "github.com/superproj/onex/internal/pkg/client/usercenter" "github.com/superproj/onex/pkg/db" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" "github.com/superproj/onex/pkg/log" genericoptions "github.com/superproj/onex/pkg/options" "github.com/superproj/onex/pkg/version" diff --git a/internal/gateway/helper.go b/internal/gateway/helper.go index b5de6c4ebd7..4a7b479bb16 100644 --- a/internal/gateway/helper.go +++ b/internal/gateway/helper.go @@ -13,7 +13,7 @@ import ( "k8s.io/client-go/tools/cache" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" - informers "github.com/superproj/onex/pkg/generated/informers/externalversions" + "github.com/superproj/onex/pkg/generated/informers" "github.com/superproj/onex/pkg/log" ) diff --git a/internal/nightwatch/nightwatch.go b/internal/nightwatch/nightwatch.go index ab71f2e260b..074c325d318 100644 --- a/internal/nightwatch/nightwatch.go +++ b/internal/nightwatch/nightwatch.go @@ -7,45 +7,34 @@ package nightwatch import ( - "context" - "errors" - "time" - - "github.com/go-redsync/redsync/v4" - "github.com/go-redsync/redsync/v4/redis/goredis/v9" "github.com/jinzhu/copier" - "github.com/robfig/cron/v3" "k8s.io/apimachinery/pkg/util/wait" "github.com/superproj/onex/internal/nightwatch/watcher" "github.com/superproj/onex/pkg/db" clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" "github.com/superproj/onex/pkg/log" + "github.com/superproj/onex/pkg/watch" + onexlogger "github.com/superproj/onex/pkg/watch/logger/onex" // trigger init functions in `internal/nightwatch/watcher/all`. _ "github.com/superproj/onex/internal/nightwatch/watcher/all" genericoptions "github.com/superproj/onex/pkg/options" ) -var ( - lockName = "onex-nightwatch-lock" - jobStopTimeout = 3 * time.Minute - extendExpiration = 5 * time.Second - defaultExpiration = 10 * extendExpiration -) - type nightWatch struct { - runner *cron.Cron - // distributed lock - locker *redsync.Mutex - config *watcher.Config + *watch.Watch } // Config is the configuration for the nightwatch server. type Config struct { MySQLOptions *genericoptions.MySQLOptions RedisOptions *genericoptions.RedisOptions - Client clientset.Interface + WatchOptions *watch.Options + // The maximum concurrency event of user watcher. + UserWatcherMaxWorkers int64 + // The list of watchers that should be disabled. + Client clientset.Interface } // CompletedConfig same as Config, just to swap private object. @@ -59,7 +48,7 @@ func (c *Config) Complete() *CompletedConfig { } // CreateWatcherConfig used to create configuration used by all watcher. -func (c *Config) CreateWatcherConfig() (*watcher.Config, error) { +func (c *Config) CreateWatcherConfig() (*watcher.AggregateConfig, error) { var mysqlOptions db.MySQLOptions _ = copier.Copy(&mysqlOptions, c.MySQLOptions) storeClient, err := wireStoreClient(&mysqlOptions) @@ -68,119 +57,45 @@ func (c *Config) CreateWatcherConfig() (*watcher.Config, error) { return nil, err } - return &watcher.Config{Store: storeClient, Client: c.Client}, nil + return &watcher.AggregateConfig{ + Store: storeClient, + Client: c.Client, + UserWatcherMaxWorkers: c.UserWatcherMaxWorkers, + }, nil } // New creates an asynchronous task instance. func (c *Config) New() (*nightWatch, error) { - // Create a pool with go-redis which is the pool redisync will - // use while communicating with Redis. This can also be any pool that - // implements the `redis.Pool` interface. client, err := c.RedisOptions.NewClient() if err != nil { log.Errorw(err, "Failed to create Redis client") return nil, err } - logger := newCronLogger() - runner := cron.New( - cron.WithSeconds(), - cron.WithLogger(logger), - cron.WithChain(cron.SkipIfStillRunning(logger), cron.Recover(logger)), - ) - - pool := goredis.NewPool(client) - lockOpts := []redsync.Option{ - redsync.WithRetryDelay(50 * time.Microsecond), - redsync.WithTries(3), - redsync.WithExpiry(defaultExpiration), - } - // Create an instance of redisync and obtain a new mutex by using the same name - // for all instances wanting the same lock. - locker := redsync.New(pool).NewMutex(lockName, lockOpts...) - cfg, err := c.CreateWatcherConfig() if err != nil { return nil, err } - nw := &nightWatch{runner: runner, locker: locker, config: cfg} - if err := nw.addWatchers(); err != nil { - return nil, err + initialize := watcher.NewWatcherInitializer(cfg.Store, cfg.Client, cfg.UserWatcherMaxWorkers) + opts := []watch.Option{ + watch.WithInitialize(initialize), + watch.WithLogger(onexlogger.NewLogger()), + watch.WithLockName("onex-nightwatch-lock"), } - return nw, nil -} - -// addWatchers used to initialize all registered watchers and add the watchers as a Cron job. -func (nw *nightWatch) addWatchers() error { - for n, w := range watcher.ListWatchers() { - if err := w.Init(context.Background(), nw.config); err != nil { - log.Errorw(err, "Failed to construct watcher", "watcher", n) - return err - } - - spec := watcher.Every3Seconds - if obj, ok := w.(watcher.ISpec); ok { - spec = obj.Spec() - } - - if _, err := nw.runner.AddJob(spec, w); err != nil { - log.Errorw(err, "Failed to add job to the cron", "watcher", n) - return err - } + nw, err := watch.NewWatch(c.WatchOptions, client, opts...) + if err != nil { + return nil, err } - return nil + return &nightWatch{nw}, nil } // Run keep retrying to acquire lock and then start the Cron job. func (nw *nightWatch) Run(stopCh <-chan struct{}) { - ctx := wait.ContextForChannel(stopCh) - - ticker := time.NewTicker(defaultExpiration + (5 * time.Second)) - for { - // Obtain a lock for our given mutex. After this is successful, no one else - // can obtain the same lock (the same mutex name) until we unlock it. - err := nw.locker.LockContext(ctx) - if err == nil { - log.Debugw("Successfully acquired lock", "lockName", lockName) - break - } - log.Debugw("Failed to acquire lock.", "lockName", lockName, "err", err) - <-ticker.C - } - - go func() { - ticker := time.NewTicker(extendExpiration) - for { - <-ticker.C - if ok, err := nw.locker.ExtendContext(ctx); !ok || err != nil { - log.Debugw("Failed to extend mutex", "err", err, "status", ok) - } - } - }() - - nw.runner.Start() - log.Infof("Successfully started nightwatch server") - + nw.Start(wait.ContextForChannel(stopCh)) + // graceful shutdown <-stopCh - - nw.stop() -} - -// stop used to blocking waits for the job to complete and releases the lock. -func (nw *nightWatch) stop() { - ctx := nw.runner.Stop() - select { - case <-ctx.Done(): - case <-time.After(jobStopTimeout): - log.Errorw(errors.New("context was not done immediately"), "timeout", jobStopTimeout.String()) - } - - if ok, err := nw.locker.Unlock(); !ok || err != nil { - log.Debugw("Failed to unlock", "err", err, "status", ok) - } - - log.Infof("Successfully stopped nightwatch server") + nw.Stop() } diff --git a/internal/nightwatch/watcher/all/all.go b/internal/nightwatch/watcher/all/all.go index 8b7577cfdf3..9d9f2cb7941 100644 --- a/internal/nightwatch/watcher/all/all.go +++ b/internal/nightwatch/watcher/all/all.go @@ -10,4 +10,5 @@ package all import ( _ "github.com/superproj/onex/internal/nightwatch/watcher/clean" _ "github.com/superproj/onex/internal/nightwatch/watcher/secretsclean" + _ "github.com/superproj/onex/internal/nightwatch/watcher/user" ) diff --git a/internal/nightwatch/watcher/clean/watcher.go b/internal/nightwatch/watcher/clean/watcher.go index 63778ee5709..9d4a8faa412 100644 --- a/internal/nightwatch/watcher/clean/watcher.go +++ b/internal/nightwatch/watcher/clean/watcher.go @@ -13,9 +13,10 @@ import ( "github.com/superproj/onex/internal/nightwatch/watcher" "github.com/superproj/onex/internal/pkg/client/store" "github.com/superproj/onex/pkg/log" + "github.com/superproj/onex/pkg/watch" ) -var _ watcher.Watcher = (*cleanWatcher)(nil) +var _ watch.Watcher = (*cleanWatcher)(nil) // watcher implement. type cleanWatcher struct { @@ -35,12 +36,11 @@ func (w *cleanWatcher) Run() { } } -// Init initializes the watcher for later execution. -func (w *cleanWatcher) Init(ctx context.Context, config *watcher.Config) error { +// SetAggregateConfig initializes the watcher for later execution. +func (w *cleanWatcher) SetAggregateConfig(config *watcher.AggregateConfig) { w.store = config.Store - return nil } func init() { - watcher.Register(&cleanWatcher{}) + watch.Register("clean", &cleanWatcher{}) } diff --git a/internal/nightwatch/watcher/config.go b/internal/nightwatch/watcher/config.go index 40879cb6e1e..b4ef9a849cc 100644 --- a/internal/nightwatch/watcher/config.go +++ b/internal/nightwatch/watcher/config.go @@ -12,12 +12,15 @@ import ( clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" ) -// Config aggregates the configurations of all watchers and serves as a configuration aggregator. -type Config struct { +// AggregateConfig aggregates the configurations of all watchers and serves as a configuration aggregator. +type AggregateConfig struct { // The purpose of nightwatch is to handle asynchronous tasks on the onex platform // in a unified manner, so a store aggregation type is needed here. Store store.Interface // Client is the client for onex-apiserver. Client clientset.Interface + + // Then maximum concurrency event of user watcher. + UserWatcherMaxWorkers int64 } diff --git a/internal/nightwatch/watcher/initializer.go b/internal/nightwatch/watcher/initializer.go new file mode 100644 index 00000000000..d172934980a --- /dev/null +++ b/internal/nightwatch/watcher/initializer.go @@ -0,0 +1,47 @@ +package watcher + +import ( + "github.com/superproj/onex/internal/pkg/client/store" + clientset "github.com/superproj/onex/pkg/generated/clientset/versioned" + "github.com/superproj/onex/pkg/watch" +) + +// WatcherInitializer is used for initialization of the onex specific watcher plugins. +type WatcherInitializer struct { + // The purpose of nightwatch is to handle asynchronous tasks on the onex platform + // in a unified manner, so a store aggregation type is needed here. + store store.Interface + + // Client is the client for onex-apiserver. + client clientset.Interface + + // Then maximum concurrency event of user watcher. + userWatcherMaxWorkers int64 +} + +var _ watch.WatcherInitializer = &WatcherInitializer{} + +func NewWatcherInitializer(store store.Interface, client clientset.Interface, maxWorkers int64) *WatcherInitializer { + return &WatcherInitializer{ + store: store, + client: client, + userWatcherMaxWorkers: maxWorkers, + } +} + +func (w *WatcherInitializer) Initialize(wc watch.Watcher) { + // We can set a specific configuration as needed, as shown in the example below. + // However, for convenience, I directly assign all configurations to each watcher, + // allowing the watcher to choose which ones to use. + if wants, ok := wc.(WantsStore); ok { + wants.SetStore(w.store) + } + + if wants, ok := wc.(WantsAggregateConfig); ok { + wants.SetAggregateConfig(&AggregateConfig{ + Store: w.store, + Client: w.client, + UserWatcherMaxWorkers: w.userWatcherMaxWorkers, + }) + } +} diff --git a/internal/nightwatch/watcher/interface.go b/internal/nightwatch/watcher/interface.go new file mode 100644 index 00000000000..cd8b7ca9cb0 --- /dev/null +++ b/internal/nightwatch/watcher/interface.go @@ -0,0 +1,18 @@ +package watcher + +import ( + "github.com/superproj/onex/internal/pkg/client/store" + "github.com/superproj/onex/pkg/watch" +) + +// WantsAggregateConfig defines a function which sets AggregateConfig for watcher plugins that need it. +type WantsAggregateConfig interface { + watch.Watcher + SetAggregateConfig(config *AggregateConfig) +} + +// WantsStore defines a function which sets store for watcher plugins that need it. +type WantsStore interface { + watch.Watcher + SetStore(store store.Interface) +} diff --git a/internal/nightwatch/watcher/secretsclean/watcher.go b/internal/nightwatch/watcher/secretsclean/watcher.go index 3abfa8c0949..3c2793ef1ed 100644 --- a/internal/nightwatch/watcher/secretsclean/watcher.go +++ b/internal/nightwatch/watcher/secretsclean/watcher.go @@ -14,9 +14,10 @@ import ( "github.com/superproj/onex/internal/nightwatch/watcher" "github.com/superproj/onex/internal/pkg/client/store" "github.com/superproj/onex/pkg/log" + "github.com/superproj/onex/pkg/watch" ) -var _ watcher.Watcher = (*secretsCleanWatcher)(nil) +var _ watch.Watcher = (*secretsCleanWatcher)(nil) // watcher implement. type secretsCleanWatcher struct { @@ -43,12 +44,11 @@ func (w *secretsCleanWatcher) Run() { } } -// Init initializes the watcher for later execution. -func (w *secretsCleanWatcher) Init(ctx context.Context, config *watcher.Config) error { +// SetAggregateConfig initializes the watcher for later execution. +func (w *secretsCleanWatcher) SetAggregateConfig(config *watcher.AggregateConfig) { w.store = config.Store - return nil } func init() { - watcher.Register(&secretsCleanWatcher{}) + watch.Register("secretsclean", &secretsCleanWatcher{}) } diff --git a/internal/nightwatch/watcher/user/event.go b/internal/nightwatch/watcher/user/event.go new file mode 100644 index 00000000000..807d405f45b --- /dev/null +++ b/internal/nightwatch/watcher/user/event.go @@ -0,0 +1,156 @@ +package user + +import ( + "context" + "time" + + "github.com/looplab/fsm" + + "github.com/superproj/onex/internal/pkg/client/store" + known "github.com/superproj/onex/internal/pkg/known/usercenter" + "github.com/superproj/onex/internal/pkg/onexx" + "github.com/superproj/onex/internal/usercenter/model" + "github.com/superproj/onex/pkg/log" +) + +const ( + UserEventAfterEvent = "after_event" +) + +// NewActiveUserCallback creates a callback function for the "active user" event in a finite state machine (FSM). +func NewActiveUserCallback(store store.Interface) fsm.Callback { + return func(ctx context.Context, event *fsm.Event) { + userM := onexx.FromUserM(ctx) + log.Infow("Now active user", "event", event.Event, "username", userM.Username) + + // Active secrets if needed. + if err := iterateSecrets(ctx, store, userM.UserID, activeSecret); err != nil { + event.Err = err + return + } + + log.Infow("Success to active user", "event", event.Event, "username", userM.Username) + } +} + +// NewDisableUserCallback creates a callback function for the "disable user" event in a finite state machine (FSM). +func NewDisableUserCallback(store store.Interface) fsm.Callback { + return func(ctx context.Context, event *fsm.Event) { + userM := onexx.FromUserM(ctx) + log.Infow("Now disable user", "event", event.Event, "username", userM.Username) + + // Disable secrets if needed. + if err := iterateSecrets(ctx, store, userM.UserID, disableSecret); err != nil { + event.Err = err + return + } + + log.Infow("Success to disable user", "event", event.Event, "username", userM.Username) + } +} + +// NewDeleteUserCallback creates a callback function for the "delete user" event in a finite state machine (FSM). +func NewDeleteUserCallback(store store.Interface) fsm.Callback { + return func(ctx context.Context, event *fsm.Event) { + userM := onexx.FromUserM(ctx) + log.Infow("Now delete user if needed", "event", event.Event, "username", userM.Username) + + // If a user remains in an disalbed state for more than 5 years, + // the user should be deleted. + duration := time.Since(userM.UpdatedAt) + if duration.Hours() < 24*365*5 { + return + } + + // Delete secrets if needed. + if err := iterateSecrets(ctx, store, userM.UserID, deleteSecret); err != nil { + event.Err = err + return + } + + // Save user data for archiving purposes. + log.Infow("Success to delete user", "event", event.Event, "username", userM.Username) + } +} + +// NewUserEventAfterEvent creates a callback function that is executed after a +// user-related event is handled in a finite state machine (FSM). +func NewUserEventAfterEvent(store store.Interface) fsm.Callback { + return func(ctx context.Context, event *fsm.Event) { + alarmStatus := "success" + userM := onexx.FromUserM(ctx) + + defer func() { + log.Infow("This is a fake alarm message", "status", alarmStatus, "username", userM.Username) + }() + + if event.Err != nil { + alarmStatus = "failed" + log.Errorw(event.Err, "Failed to handle event", "event", event.Event) + // We can add some alerts here in the future. + return + } + + user := onexx.FromUserM(ctx) + user.Status = event.FSM.Current() + if err := store.UserCenter().Users().Update(ctx, user); err != nil { + log.Errorw(err, "Failed to update status into database", "event", event.Event) + event.Err = err + return + } + } +} + +// activeSecret used to active user secret. +func activeSecret(ctx context.Context, store store.Interface, secret *model.SecretM) error { + log.Infow("Now actice user secret", "userID", secret.UserID, "secretID", secret.SecretID) + // To avoid unnecessary database update operations, we first check + // whether updating the database is required. + if secret.Status == known.SecretStatusNormal { + return nil + } + secret.Status = known.SecretStatusNormal + return store.UserCenter().Secrets().Update(ctx, secret) +} + +// disableSecret used to disable user secret. +func disableSecret(ctx context.Context, store store.Interface, secret *model.SecretM) error { + log.Infow("Now disable user secret", "userID", secret.UserID, "secretID", secret.SecretID) + // To avoid unnecessary database update operations, we first check + // whether updating the database is required. + if secret.Status == known.SecretStatusDisabled { + return nil + } + secret.Status = known.SecretStatusDisabled + return store.UserCenter().Secrets().Update(ctx, secret) +} + +// deleteSecret used to delete user secret. +func deleteSecret(ctx context.Context, store store.Interface, secret *model.SecretM) error { + log.Infow("Now delete user secret", "userID", secret.UserID, "secretID", secret.SecretID) + return store.UserCenter().Secrets().Delete(ctx, secret.UserID, secret.Name) +} + +// iterateSecrets iterates through the secrets of a user specified by userID +// and calls the action function on each secret. +func iterateSecrets( + ctx context.Context, + store store.Interface, + userID string, + action func(ctx context.Context, store store.Interface, secret *model.SecretM) error, +) error { + // Retrieve the list of secrets for the specified user. + _, secrets, err := store.UserCenter().Secrets().List(ctx, userID) + if err != nil { + return err + } + + // Iterate through each secret and perform the action function. + for i := range secrets { + if err := action(ctx, store, secrets[i]); err != nil { + return err + } + } + + return nil +} diff --git a/internal/nightwatch/watcher/user/fsm.go b/internal/nightwatch/watcher/user/fsm.go new file mode 100644 index 00000000000..787adb8b9b3 --- /dev/null +++ b/internal/nightwatch/watcher/user/fsm.go @@ -0,0 +1,55 @@ +package user + +import ( + "github.com/looplab/fsm" + + known "github.com/superproj/onex/internal/pkg/known/usercenter" +) + +// NewFSM creates a new finite state machine (FSM) for managing user states. +// The function takes an initial user status and a user watcher as input parameters. +// The FSM is configured with the following events and callbacks: +// +// Events: +// - UserStatusRegistered -> UserStatusActived +// - UserStatusBlacklisted -> UserStatusDisabled +// - UserStatusDisabled -> UserStatusDeleted +// +// Callbacks: +// - UserStatusActived: Calls the NewActiveUserCallback function to handle the "active user" event. +// - UserStatusDisabled: Calls the NewDisableUserCallback function to handle the "disable user" event. +// - UserStatusDeleted: Calls the NewDeleteUserCallback function to handle the "delete user" event. +// - UserEventAfterEvent: Calls the NewUserEventAfterEvent function after any user-related event is handled. +// +// The function returns the newly created FSM. +func NewFSM(initial string, w *userWatcher) *fsm.FSM { + return fsm.NewFSM( + initial, + fsm.Events{ + // Define status events. + {Name: known.UserStatusRegistered, Src: []string{known.UserStatusRegistered}, Dst: known.UserStatusActived}, + {Name: known.UserStatusBlacklisted, Src: []string{known.UserStatusBlacklisted}, Dst: known.UserStatusDisabled}, + // Define need events. + {Name: known.UserStatusNeedActive, Src: []string{known.UserStatusNeedActive}, Dst: known.UserStatusActived}, + {Name: known.UserStatusNeedDisable, Src: []string{known.UserStatusNeedDisable}, Dst: known.UserStatusDisabled}, + {Name: known.UserStatusDisabled, Src: []string{known.UserStatusDisabled}, Dst: known.UserStatusDeleted}, + }, + fsm.Callbacks{ + known.UserStatusActived: NewActiveUserCallback(w.store), + known.UserStatusDisabled: NewDisableUserCallback(w.store), + known.UserStatusDeleted: NewDeleteUserCallback(w.store), + // log, alert, save to stoer, etc for all events. + // Alert the status of each step of the operation. + UserEventAfterEvent: NewUserEventAfterEvent(w.store), + }, + ) +} + +func filterFSMError(err error) error { + switch err.(type) { + case fsm.NoTransitionError: + return nil + default: + return err + } +} diff --git a/internal/nightwatch/watcher/user/watcher.go b/internal/nightwatch/watcher/user/watcher.go new file mode 100644 index 00000000000..d486dc2b2a5 --- /dev/null +++ b/internal/nightwatch/watcher/user/watcher.go @@ -0,0 +1,96 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +// Package user is a watcher implement. +package user + +import ( + "context" + + "github.com/gammazero/workerpool" + "github.com/looplab/fsm" + + "github.com/superproj/onex/internal/nightwatch/watcher" + "github.com/superproj/onex/internal/pkg/client/store" + known "github.com/superproj/onex/internal/pkg/known/usercenter" + "github.com/superproj/onex/internal/pkg/onexx" + "github.com/superproj/onex/internal/usercenter/model" + "github.com/superproj/onex/pkg/log" + stringsutil "github.com/superproj/onex/pkg/util/strings" + "github.com/superproj/onex/pkg/watch" +) + +var _ watch.Watcher = (*userWatcher)(nil) + +// watcher implement. +type userWatcher struct { + store store.Interface + maxWorkers int64 +} + +// UserStateMachine is a struct that represents a user finite state machine. +type UserStateMachine struct { + UserM *model.UserM + FSM *fsm.FSM +} + +// Run runs the watcher. +func (w *userWatcher) Run() { + _, users, err := w.store.UserCenter().Users().List(context.Background()) + if err != nil { + log.Errorw(err, "Failed to list users") + return + } + + allowOperations := []string{ + // Need active user. + known.UserStatusRegistered, + // Need disable user. + known.UserStatusBlacklisted, + known.UserStatusNeedActive, + known.UserStatusNeedDisable, + // After disabling the user, they can be deleted, and the FSM will automatically transition to the next deleted state. + // I have decided not to delete the user in the code, so the state transition here is commented out. + // known.UserStatusDisabled, + } + + wp := workerpool.New(int(w.maxWorkers)) + for _, user := range users { + if !stringsutil.StringIn(user.Status, allowOperations) { + continue + } + + wp.Submit(func() { + ctx := onexx.NewUserM(context.Background(), user) + + usm := &UserStateMachine{UserM: user, FSM: NewFSM(user.Status, w)} + if err := usm.FSM.Event(ctx, user.Status); err != nil { + log.Errorw(err, "Failed to event user", "username", user.Username, "status", user.Status) + return + } + + // When the entire state machine reaches the final state, print a message and send a notification. + if usm.FSM.Current() == known.UserStatusDeleted { + // We can add some lark card here in the future. + log.Infow("Finish to handle user", "username", usm.UserM.Username) + } + + return + }) + } + + wp.StopWait() +} + +// SetAggregateConfig initializes the watcher for later execution. +func (w *userWatcher) SetAggregateConfig(config *watcher.AggregateConfig) { + w.store = config.Store + w.maxWorkers = config.UserWatcherMaxWorkers +} + +func init() { + watch.Register("user", &userWatcher{}) +} diff --git a/internal/onexctl/cmd/helper.go b/internal/onexctl/cmd/helper.go index 20086fa4845..4a56e4b0cda 100644 --- a/internal/onexctl/cmd/helper.go +++ b/internal/onexctl/cmd/helper.go @@ -54,7 +54,7 @@ func initConfig(cfgFile string) { viper.SetEnvPrefix("ONEX") // 以下 2 行,将 viper.Get(key) key 字符串中 '.' 和 '-' 替换为 '_' - replacer := strings.NewReplacer(".", "_") + replacer := strings.NewReplacer(".", "_", "-", "_") viper.SetEnvKeyReplacer(replacer) // 读取配置文件。如果指定了配置文件名,则使用指定的配置文件,否则在注册的搜索路径中搜索 diff --git a/internal/onexctl/util/options/server_options.go b/internal/onexctl/util/options/server_options.go index 793728b0b56..40c981f1ca1 100644 --- a/internal/onexctl/util/options/server_options.go +++ b/internal/onexctl/util/options/server_options.go @@ -36,19 +36,19 @@ func (o *ServerOptions) Validate() []error { } // AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet. -func (o *ServerOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { - fs.BoolVar(&o.Insecure, join(prefixs...)+"insecure-skip-tls-verify", o.Insecure, ""+ +func (o *ServerOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { + fs.BoolVar(&o.Insecure, join(prefixes...)+"insecure-skip-tls-verify", o.Insecure, ""+ "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure") - fs.StringVar(&o.CAFile, join(prefixs...)+"certificate-authority", o.CAFile, "Path to a cert file for the certificate authority") - fs.StringVar(&o.Addr, join(prefixs...)+"address", o.Addr, "The address and port of the OneX API server") - fs.DurationVar(&o.Timeout, join(prefixs...)+"timeout", o.Timeout, "The length of time to wait before giving up on a single "+ + fs.StringVar(&o.CAFile, join(prefixes...)+"certificate-authority", o.CAFile, "Path to a cert file for the certificate authority") + fs.StringVar(&o.Addr, join(prefixes...)+"address", o.Addr, "The address and port of the OneX API server") + fs.DurationVar(&o.Timeout, join(prefixes...)+"timeout", o.Timeout, "The length of time to wait before giving up on a single "+ "server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.") - fs.IntVar(&o.MaxRetries, join(prefixs...)+"max-retries", o.MaxRetries, "Maximum number of retries.") - fs.DurationVar(&o.RetryInterval, join(prefixs...)+"retry-interval", o.RetryInterval, "The interval time between each attempt.") + fs.IntVar(&o.MaxRetries, join(prefixes...)+"max-retries", o.MaxRetries, "Maximum number of retries.") + fs.DurationVar(&o.RetryInterval, join(prefixes...)+"retry-interval", o.RetryInterval, "The interval time between each attempt.") } -func join(prefixs ...string) string { - joined := strings.Join(prefixs, ".") +func join(prefixes ...string) string { + joined := strings.Join(prefixes, ".") if joined != "" { joined += "." } diff --git a/internal/pkg/client/usercenter/options.go b/internal/pkg/client/usercenter/options.go index eccb95588be..0d98400d320 100644 --- a/internal/pkg/client/usercenter/options.go +++ b/internal/pkg/client/usercenter/options.go @@ -43,7 +43,7 @@ func (o *UserCenterOptions) Validate() []error { } // AddFlags adds flags for a specific APIServer to the specified FlagSet. -func (o *UserCenterOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *UserCenterOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { if o == nil { return } diff --git a/internal/pkg/known/usercenter/status.go b/internal/pkg/known/usercenter/status.go new file mode 100644 index 00000000000..dca26093d04 --- /dev/null +++ b/internal/pkg/known/usercenter/status.go @@ -0,0 +1,40 @@ +package usercenter + +// Define user status. +const ( + // User has submitted registration information, the account is in a pending. + // The user needs to complete email/phone number verification steps to transition to an active state. + // The OneX project does not currently use this. + UserStatusRegistered = "registered" + // The user has registered and been verified, and can use the system normally. + // Most user operations are performed in this state. + UserStatusActived = "actived" + // The user has entered the incorrect password too many times, and the account has been locked by the system. + // The user needs to recover the password or contact the administrator to unlock the account. + UserStatusLocked = "locked" + // The user has been added to the system blacklist due to serious misconduct. + // Blacklisted users cannot register new accounts or use the system. + UserStatusBlacklisted = "blacklisted" + // The administrator has manually disabled the user account, and the user cannot log in after being disabled. + // This may be due to user misconduct or other reasons. + UserStatusDisabled = "disabled" + // The user has actively deleted their own account, or the administrator has deleted the user account. + // The deleted account can be chosen to be soft-deleted (with some data retained) or completely deleted. + UserStatusDeleted = "deleted" +) + +// Define need status. +// We can directly update the database to the "Need" state to inform onex-nightwatch of what needs to be done. +// These statuses are only used for operation and maintenance purposes. +const ( + // UserStatusNeedActive informs onex-nightwatch that the user needs to be activated. + UserStatusNeedActive = "need_active" + // UserStatusNeedDisable informs onex-nightwatch that the user needs to be disabled. + UserStatusNeedDisable = "need_disable" +) + +// Define secret status. +const ( + SecretStatusDisabled = iota // Status used for disabling a secret. + SecretStatusNormal // Status used for enabling a secret. +) diff --git a/internal/pkg/onexx/onexx.go b/internal/pkg/onexx/onexx.go index 8dd87bca7fd..5ac022f0456 100644 --- a/internal/pkg/onexx/onexx.go +++ b/internal/pkg/onexx/onexx.go @@ -11,6 +11,8 @@ import ( "context" "github.com/golang-jwt/jwt/v4" + + "github.com/superproj/onex/internal/usercenter/model" ) // 定义全局上下文中的键. @@ -25,6 +27,7 @@ type ( type ( authKey struct{} userKey struct{} + userMKey struct{} accessTokenKey struct{} ) @@ -60,3 +63,14 @@ func FromAccessToken(ctx context.Context) string { accessToken, _ := ctx.Value(accessTokenKey{}).(string) return accessToken } + +// NewUserM put *UserM into context. +func NewUserM(ctx context.Context, user *model.UserM) context.Context { + return context.WithValue(ctx, userMKey{}, user) +} + +// FromUserM extract *UserM from extract. +func FromUserM(ctx context.Context) *model.UserM { + user, _ := ctx.Value(userMKey{}).(*model.UserM) + return user +} diff --git a/internal/pkg/options/recommended.go b/internal/pkg/options/recommended.go index f98e1074ec9..b3ba996d8f9 100644 --- a/internal/pkg/options/recommended.go +++ b/internal/pkg/options/recommended.go @@ -17,6 +17,8 @@ import ( genericapiserver "k8s.io/apiserver/pkg/server" "k8s.io/apiserver/pkg/server/dynamiccertificates" genericoptions "k8s.io/apiserver/pkg/server/options" + "k8s.io/client-go/dynamic" + "k8s.io/client-go/kubernetes" openapicommon "k8s.io/kube-openapi/pkg/common" ) @@ -27,10 +29,13 @@ var configScheme = runtime.NewScheme() // Each of them can be nil to leave the feature unconfigured on ApplyTo. type RecommendedOptions struct { *genericoptions.RecommendedOptions + + // Custom options for onex project. + ExternalAdmissionInitializers func(c *genericapiserver.RecommendedConfig) ([]admission.PluginInitializer, error) } func NewRecommendedOptions(prefix string, codec runtime.Codec) *RecommendedOptions { - return &RecommendedOptions{genericoptions.NewRecommendedOptions(prefix, codec)} + return &RecommendedOptions{RecommendedOptions: genericoptions.NewRecommendedOptions(prefix, codec)} } // ApplyTo adds RecommendedOptions to the server configuration. @@ -48,6 +53,14 @@ func (o *RecommendedOptions) ApplyTo(config *genericapiserver.RecommendedConfig) if err := o.SecureServing.ApplyTo(&config.Config.SecureServing, &config.Config.LoopbackClientConfig); err != nil { return err } + /* UPDATEME: When add authentication and authorization features. + if err := o.Authentication.ApplyTo(&config.Config.Authentication, config.SecureServing, config.OpenAPIConfig); err != nil { + return err + } + if err := o.Authorization.ApplyTo(&config.Config.Authorization); err != nil { + return err + } + */ if err := authenticationApplyTo(o.Authentication, &config.Config.Authentication, config.SecureServing, config.OpenAPIConfig); err != nil { return err } @@ -60,32 +73,43 @@ func (o *RecommendedOptions) ApplyTo(config *genericapiserver.RecommendedConfig) if err := o.CoreAPI.ApplyTo(config); err != nil { return err } - // OneX does not depend on any package of k8s - /* - kubeClient, err := kubernetes.NewForConfig(config.ClientConfig) + + var kubeClient *kubernetes.Clientset + var dynamicClient *dynamic.DynamicClient + if config.ClientConfig != nil { + var err error + kubeClient, err = kubernetes.NewForConfig(config.ClientConfig) if err != nil { return err } - if err := o.Features.ApplyTo(&config.Config, nil, config.SharedInformerFactory); err != nil { + dynamicClient, err = dynamic.NewForConfig(config.ClientConfig) + if err != nil { return err } - */ + } + if err := o.Features.ApplyTo(&config.Config, kubeClient, config.SharedInformerFactory); err != nil { + return err + } initializers, err := o.ExtraAdmissionInitializers(config) if err != nil { return err } - // OneX does not depend on any package of k8s - /* - dynamicClient, err := dynamic.NewForConfig(config.ClientConfig) + + if o.ExternalAdmissionInitializers != nil { + externalInitializers, err := o.ExternalAdmissionInitializers(config) if err != nil { return err } - */ + initializers = append(initializers, externalInitializers...) + } + // NOTICE: Add custom initializers - if err := admissionOptionsApplyTo(o.Admission, &config.Config, initializers...); err != nil { + if err := o.Admission.ApplyTo(&config.Config, config.SharedInformerFactory, kubeClient, dynamicClient, o.FeatureGate, + initializers...); err != nil { return err } + return nil } diff --git a/internal/pkg/printers/internalversion/printers.go b/internal/pkg/printers/internalversion/printers.go index ad661579d91..b38dc61f22b 100644 --- a/internal/pkg/printers/internalversion/printers.go +++ b/internal/pkg/printers/internalversion/printers.go @@ -10,17 +10,17 @@ import ( "fmt" "strings" + coordinationv1 "k8s.io/api/coordination/v1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/kubernetes/pkg/apis/coordination" api "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/printers" printersutil "github.com/superproj/onex/internal/pkg/util/printers" "github.com/superproj/onex/pkg/apis/apps" "github.com/superproj/onex/pkg/apis/apps/v1beta1" - "github.com/superproj/onex/pkg/apis/coordination" - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" ) // AddHandlers adds print handlers for default OneX types dealing with internal versions. diff --git a/internal/pkg/util/miner/miner.go b/internal/pkg/util/miner/miner.go index 7e220c488c5..9332f0ed9d0 100644 --- a/internal/pkg/util/miner/miner.go +++ b/internal/pkg/util/miner/miner.go @@ -91,7 +91,7 @@ func IsMinerReady(m *v1beta1.Miner) bool { } func ChainDNSServiceNameFromMiner(namespace, name string) string { - return fmt.Sprintf("%s.%s.svc.onex.io", name, namespace) + return fmt.Sprintf("%s.%s.svc.superproj.com", name, namespace) } func GenesisDNSServiceNameFromMiner(name string) string { diff --git a/internal/registry/coordination/rest/storage_coordination.go b/internal/registry/coordination/rest/storage_coordination.go index d021d255660..34871b2ff3b 100644 --- a/internal/registry/coordination/rest/storage_coordination.go +++ b/internal/registry/coordination/rest/storage_coordination.go @@ -7,18 +7,17 @@ package rest import ( + coordinationv1 "k8s.io/api/coordination/v1" "k8s.io/apiserver/pkg/registry/generic" "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" serverstorage "k8s.io/apiserver/pkg/server/storage" "k8s.io/kubernetes/pkg/api/legacyscheme" + "k8s.io/kubernetes/pkg/apis/coordination" leasestore "k8s.io/kubernetes/pkg/registry/coordination/lease/storage" + "github.com/superproj/onex/internal/controlplane/storage" serializerutil "github.com/superproj/onex/internal/pkg/util/serializer" - - "github.com/superproj/onex/internal/apiserver/storage" - "github.com/superproj/onex/pkg/apis/coordination" - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" // leasestore "github.com/superproj/onex/internal/registry/coordination/lease/storage". ) diff --git a/internal/registry/core/rest/storage_core.go b/internal/registry/core/rest/storage_core.go index bc4b6c224a0..261d5b54b1f 100644 --- a/internal/registry/core/rest/storage_core.go +++ b/internal/registry/core/rest/storage_core.go @@ -9,17 +9,18 @@ package rest import ( "time" + apiv1 "k8s.io/api/core/v1" "k8s.io/apiserver/pkg/registry/generic" "k8s.io/apiserver/pkg/registry/rest" genericapiserver "k8s.io/apiserver/pkg/server" "k8s.io/kubernetes/pkg/api/legacyscheme" + api "k8s.io/kubernetes/pkg/apis/core" configmapstore "k8s.io/kubernetes/pkg/registry/core/configmap/storage" + endpointsstore "k8s.io/kubernetes/pkg/registry/core/endpoint/storage" eventstore "k8s.io/kubernetes/pkg/registry/core/event/storage" namespacestore "k8s.io/kubernetes/pkg/registry/core/namespace/storage" secretstore "k8s.io/kubernetes/pkg/registry/core/secret/storage" - - api "github.com/superproj/onex/pkg/apis/core" - apiv1 "github.com/superproj/onex/pkg/apis/core/v1" + servicestore "k8s.io/kubernetes/pkg/registry/core/service/storage" // configmapstore "github.com/superproj/onex/internal/registry/core/configmap/storage" // eventstore "github.com/superproj/onex/internal/registry/core/event/storage" @@ -58,6 +59,16 @@ func (p LegacyRESTStorageProvider) NewLegacyRESTStorage(restOptionsGetter generi return genericapiserver.APIGroupInfo{}, err } + endpointsStorage, err := endpointsstore.NewREST(restOptionsGetter) + if err != nil { + return genericapiserver.APIGroupInfo{}, err + } + + serviceRESTStorage, serviceStatusStorage, serviceRESTProxy, err := servicestore.NewREST(restOptionsGetter, "", nil, nil, endpointsStorage, nil, nil) + if err != nil { + return genericapiserver.APIGroupInfo{}, err + } + restStorageMap := map[string]rest.Storage{ "namespaces": namespaceStorage, "namespaces/status": namespaceStatusStorage, @@ -67,6 +78,11 @@ func (p LegacyRESTStorageProvider) NewLegacyRESTStorage(restOptionsGetter generi "configmaps": configMapStorage, "secrets": secretStorage, + + "endpoints": endpointsStorage, + "services": serviceRESTStorage, + "services/proxy": serviceRESTProxy, + "services/status": serviceStatusStorage, } apiGroupInfo.VersionedResourcesStorageMap[apiv1.SchemeGroupVersion.Version] = restStorageMap diff --git a/internal/registry/flowcontrol/ensurer/flowschema.go b/internal/registry/flowcontrol/ensurer/flowschema.go new file mode 100644 index 00000000000..a8f00ccd9a1 --- /dev/null +++ b/internal/registry/flowcontrol/ensurer/flowschema.go @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 ensurer + +import ( + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + "k8s.io/apimachinery/pkg/api/equality" + flowcontrolapisv1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1" + + flowcontrolclient "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1" + flowcontrollisters "github.com/superproj/onex/pkg/generated/listers/flowcontrol/v1" +) + +func NewFlowSchemaOps(client flowcontrolclient.FlowSchemaInterface, cache flowcontrollisters.FlowSchemaLister) ObjectOps[*flowcontrolv1.FlowSchema] { + return NewObjectOps[*flowcontrolv1.FlowSchema](client, cache, (*flowcontrolv1.FlowSchema).DeepCopy, flowSchemaReplaceSpec, flowSchemaSpecEqual) +} + +func flowSchemaReplaceSpec(into, from *flowcontrolv1.FlowSchema) *flowcontrolv1.FlowSchema { + copy := into.DeepCopy() + copy.Spec = *from.Spec.DeepCopy() + return copy +} + +func flowSchemaSpecEqual(expected, actual *flowcontrolv1.FlowSchema) bool { + copiedExpectedSpec := expected.Spec.DeepCopy() + flowcontrolapisv1.SetDefaults_FlowSchemaSpec(copiedExpectedSpec) + return equality.Semantic.DeepEqual(copiedExpectedSpec, &actual.Spec) +} diff --git a/internal/registry/flowcontrol/ensurer/prioritylevelconfiguration.go b/internal/registry/flowcontrol/ensurer/prioritylevelconfiguration.go new file mode 100644 index 00000000000..8e407daba91 --- /dev/null +++ b/internal/registry/flowcontrol/ensurer/prioritylevelconfiguration.go @@ -0,0 +1,50 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 ensurer + +import ( + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + "k8s.io/apimachinery/pkg/api/equality" + flowcontrolapisv1 "k8s.io/kubernetes/pkg/apis/flowcontrol/v1" + + flowcontrolclient "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1" + flowcontrollisters "github.com/superproj/onex/pkg/generated/listers/flowcontrol/v1" +) + +func NewPriorityLevelConfigurationOps(client flowcontrolclient.PriorityLevelConfigurationInterface, lister flowcontrollisters.PriorityLevelConfigurationLister) ObjectOps[*flowcontrolv1.PriorityLevelConfiguration] { + return NewObjectOps[*flowcontrolv1.PriorityLevelConfiguration](client, lister, (*flowcontrolv1.PriorityLevelConfiguration).DeepCopy, + plcReplaceSpec, plcSpecEqualish) +} + +func plcReplaceSpec(into, from *flowcontrolv1.PriorityLevelConfiguration) *flowcontrolv1.PriorityLevelConfiguration { + copy := into.DeepCopy() + copy.Spec = *from.Spec.DeepCopy() + return copy +} + +func plcSpecEqualish(expected, actual *flowcontrolv1.PriorityLevelConfiguration) bool { + copiedExpected := expected.DeepCopy() + flowcontrolapisv1.SetObjectDefaults_PriorityLevelConfiguration(copiedExpected) + if expected.Name == flowcontrolv1.PriorityLevelConfigurationNameExempt { + if actual.Spec.Exempt == nil { + return false + } + copiedExpected.Spec.Exempt.NominalConcurrencyShares = actual.Spec.Exempt.NominalConcurrencyShares + copiedExpected.Spec.Exempt.LendablePercent = actual.Spec.Exempt.LendablePercent + } + return equality.Semantic.DeepEqual(copiedExpected.Spec, actual.Spec) +} diff --git a/internal/registry/flowcontrol/ensurer/strategy.go b/internal/registry/flowcontrol/ensurer/strategy.go new file mode 100644 index 00000000000..89a2c6f74ad --- /dev/null +++ b/internal/registry/flowcontrol/ensurer/strategy.go @@ -0,0 +1,362 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 ensurer + +import ( + "context" + "fmt" + "strconv" + + "github.com/google/go-cmp/cmp" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/klog/v2" +) + +const ( + fieldManager = "api-priority-and-fairness-config-producer-v1" +) + +// EnsureStrategy provides a maintenance strategy for APF configuration objects. +// We have two types of strategy, corresponding to the two types of config objetcs: +// +// - mandatory: the mandatory configurationWrapper objects are about ensuring that the P&F +// system itself won't crash; we have to be sure there's 'catch-all' place for +// everything to go. Any changes made by the cluster operators to these +// configurationWrapper objects will be stomped by the apiserver. +// +// - suggested: additional configurationWrapper objects for initial behavior. +// the cluster operators have an option to edit or delete these configurationWrapper objects. +type EnsureStrategy[ObjectType configurationObjectType] interface { + // Name of the strategy, for now we have two: 'mandatory' and 'suggested'. + // This comes handy in logging. + Name() string + + // ReviseIfNeeded accepts a pair of the current and the bootstrap configuration, determines + // whether an update is necessary, and returns a (revised if appropriate) copy of the object. + // current is the existing in-cluster configuration object. + // bootstrap is the configuration the kube-apiserver maintains in-memory. + // + // revised: the new object represents the new configuration to be stored in-cluster. + // ok: true if auto update is required, otherwise false + // err: err is set when the function runs into an error and can not + // determine if auto update is needed. + ReviseIfNeeded(objectOps objectLocalOps[ObjectType], current, bootstrap ObjectType) (revised ObjectType, ok bool, err error) +} + +// objectLocalOps is the needed operations on an individual configurationObject +type objectLocalOps[ObjectType configurationObject] interface { + DeepCopy(ObjectType) ObjectType + + // replaceSpec returns a deep copy of `into` except that the spec is a deep copy of `from` + ReplaceSpec(into, from ObjectType) ObjectType + + // SpecEqualish says whether applying defaulting to `expected` + // makes its spec more or less equal (as appropriate for the + // object at hand) that of `actual`. + SpecEqualish(expected, actual ObjectType) bool +} + +// ObjectOps is the needed operations, both as a receiver from a server and server-independent, on configurationObjects +type ObjectOps[ObjectType configurationObject] interface { + client[ObjectType] + cache[ObjectType] + objectLocalOps[ObjectType] +} + +// Client is the needed fragment of the typed generated client stubs for the given object type +type client[ObjectType configurationObject] interface { + Create(ctx context.Context, obj ObjectType, opts metav1.CreateOptions) (ObjectType, error) + Update(ctx context.Context, obj ObjectType, opts metav1.UpdateOptions) (ObjectType, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error +} + +// cache is the needed fragment of the typed generated access ("lister") to an informer's local cache +type cache[ObjectType configurationObject] interface { + List(labels.Selector) ([]ObjectType, error) + Get(name string) (ObjectType, error) +} + +// configurationObject is the relevant interfaces that each API object type implements +type configurationObject interface { + metav1.Object + runtime.Object +} + +// configurationObjectType adds the type constraint `comparable` and is thus +// only usable as a type constraint. +type configurationObjectType interface { + comparable + configurationObject +} + +type objectOps[ObjectType configurationObjectType] struct { + client[ObjectType] + cache[ObjectType] + deepCopy func(ObjectType) ObjectType + replaceSpec func(ObjectType, ObjectType) ObjectType + specEqualish func(expected, actual ObjectType) bool +} + +func NewObjectOps[ObjectType configurationObjectType](client client[ObjectType], cache cache[ObjectType], + deepCopy func(ObjectType) ObjectType, + replaceSpec func(ObjectType, ObjectType) ObjectType, + specEqualish func(expected, actual ObjectType) bool, +) ObjectOps[ObjectType] { + return objectOps[ObjectType]{client: client, + cache: cache, + deepCopy: deepCopy, + replaceSpec: replaceSpec, + specEqualish: specEqualish} +} + +func (oo objectOps[ObjectType]) DeepCopy(obj ObjectType) ObjectType { return oo.deepCopy(obj) } + +func (oo objectOps[ObjectType]) ReplaceSpec(into, from ObjectType) ObjectType { + return oo.replaceSpec(into, from) +} + +func (oo objectOps[ObjectType]) SpecEqualish(expected, actual ObjectType) bool { + return oo.specEqualish(expected, actual) +} + +// NewSuggestedEnsureStrategy returns an EnsureStrategy for suggested config objects +func NewSuggestedEnsureStrategy[ObjectType configurationObjectType]() EnsureStrategy[ObjectType] { + return &strategy[ObjectType]{ + alwaysAutoUpdateSpec: false, + name: "suggested", + } +} + +// NewMandatoryEnsureStrategy returns an EnsureStrategy for mandatory config objects +func NewMandatoryEnsureStrategy[ObjectType configurationObjectType]() EnsureStrategy[ObjectType] { + return &strategy[ObjectType]{ + alwaysAutoUpdateSpec: true, + name: "mandatory", + } +} + +// auto-update strategy for the configuration objects +type strategy[ObjectType configurationObjectType] struct { + alwaysAutoUpdateSpec bool + name string +} + +func (s *strategy[ObjectType]) Name() string { + return s.name +} + +func (s *strategy[ObjectType]) ReviseIfNeeded(objectOps objectLocalOps[ObjectType], current, bootstrap ObjectType) (ObjectType, bool, error) { + var zero ObjectType + if current == zero { + return zero, false, nil + } + + autoUpdateSpec := s.alwaysAutoUpdateSpec + if !autoUpdateSpec { + autoUpdateSpec = shouldUpdateSpec(current) + } + updateAnnotation := shouldUpdateAnnotation(current, autoUpdateSpec) + + specChanged := autoUpdateSpec && !objectOps.SpecEqualish(bootstrap, current) + + if !(updateAnnotation || specChanged) { + // the annotation key is up to date and the spec has not changed, no update is necessary + return zero, false, nil + } + + var revised ObjectType + if specChanged { + revised = objectOps.ReplaceSpec(current, bootstrap) + } else { + revised = objectOps.DeepCopy(current) + } + if updateAnnotation { + setAutoUpdateAnnotation(revised, autoUpdateSpec) + } + + return revised, true, nil +} + +// shouldUpdateSpec inspects the auto-update annotation key and generation field to determine +// whether the config object should be auto-updated. +func shouldUpdateSpec(accessor metav1.Object) bool { + value := accessor.GetAnnotations()[flowcontrolv1.AutoUpdateAnnotationKey] + if autoUpdate, err := strconv.ParseBool(value); err == nil { + return autoUpdate + } + + // We are here because of either a or b: + // a. the annotation key is missing. + // b. the annotation key is present but the value does not represent a boolean. + // In either case, if the operator hasn't changed the spec, we can safely auto update. + // Please note that we can't protect the changes made by the operator in the following scenario: + // - The operator deletes and recreates the same object with a variant spec (generation resets to 1). + if accessor.GetGeneration() == 1 { + return true + } + return false +} + +// shouldUpdateAnnotation determines whether the current value of the auto-update annotation +// key matches the desired value. +func shouldUpdateAnnotation(accessor metav1.Object, desired bool) bool { + if value, ok := accessor.GetAnnotations()[flowcontrolv1.AutoUpdateAnnotationKey]; ok { + if current, err := strconv.ParseBool(value); err == nil && current == desired { + return false + } + } + + return true +} + +// setAutoUpdateAnnotation sets the auto-update annotation key to the specified value. +func setAutoUpdateAnnotation(accessor metav1.Object, autoUpdate bool) { + if accessor.GetAnnotations() == nil { + accessor.SetAnnotations(map[string]string{}) + } + + accessor.GetAnnotations()[flowcontrolv1.AutoUpdateAnnotationKey] = strconv.FormatBool(autoUpdate) +} + +// EnsureConfigurations applies the given maintenance strategy to the given objects. +// At the first error, if any, it stops and returns that error. +func EnsureConfigurations[ObjectType configurationObjectType](ctx context.Context, ops ObjectOps[ObjectType], boots []ObjectType, strategy EnsureStrategy[ObjectType]) error { + for _, bo := range boots { + err := EnsureConfiguration(ctx, ops, bo, strategy) + if err != nil { + return err + } + } + return nil +} + +// EnsureConfiguration applies the given maintenance strategy to the given object. +func EnsureConfiguration[ObjectType configurationObjectType](ctx context.Context, ops ObjectOps[ObjectType], bootstrap ObjectType, strategy EnsureStrategy[ObjectType]) error { + name := bootstrap.GetName() + configurationType := strategy.Name() + + var current ObjectType + var err error + for { + current, err = ops.Get(name) + if err == nil { + break + } + if !apierrors.IsNotFound(err) { + return fmt.Errorf("failed to retrieve %s type=%s name=%q error=%w", bootstrap.GetObjectKind().GroupVersionKind().Kind, configurationType, name, err) + } + + // we always re-create a missing configuration object + if _, err = ops.Create(ctx, ops.DeepCopy(bootstrap), metav1.CreateOptions{FieldManager: fieldManager}); err == nil { + klog.V(2).InfoS(fmt.Sprintf("Successfully created %s", bootstrap.GetObjectKind().GroupVersionKind().Kind), "type", configurationType, "name", name) + return nil + } + + if !apierrors.IsAlreadyExists(err) { + return fmt.Errorf("cannot create %s type=%s name=%q error=%w", bootstrap.GetObjectKind().GroupVersionKind().Kind, configurationType, name, err) + } + klog.V(5).InfoS(fmt.Sprintf("Something created the %s concurrently", bootstrap.GetObjectKind().GroupVersionKind().Kind), "type", configurationType, "name", name) + } + + klog.V(5).InfoS(fmt.Sprintf("The %s already exists, checking whether it is up to date", bootstrap.GetObjectKind().GroupVersionKind().Kind), "type", configurationType, "name", name) + newObject, update, err := strategy.ReviseIfNeeded(ops, current, bootstrap) + if err != nil { + return fmt.Errorf("failed to determine whether auto-update is required for %s type=%s name=%q error=%w", bootstrap.GetObjectKind().GroupVersionKind().Kind, configurationType, name, err) + } + if !update { + if klogV := klog.V(5); klogV.Enabled() { + klogV.InfoS("No update required", "wrapper", bootstrap.GetObjectKind().GroupVersionKind().Kind, "type", configurationType, "name", name, + "diff", cmp.Diff(current, bootstrap)) + } + return nil + } + + if _, err = ops.Update(ctx, newObject, metav1.UpdateOptions{FieldManager: fieldManager}); err == nil { + klog.V(2).Infof("Updated the %s type=%s name=%q diff: %s", bootstrap.GetObjectKind().GroupVersionKind().Kind, configurationType, name, cmp.Diff(current, bootstrap)) + return nil + } + + if apierrors.IsConflict(err) { + klog.V(2).InfoS(fmt.Sprintf("Something updated the %s concurrently, I will check its spec later", bootstrap.GetObjectKind().GroupVersionKind().Kind), "type", configurationType, "name", name) + return nil + } + + return fmt.Errorf("failed to update the %s, will retry later type=%s name=%q error=%w", bootstrap.GetObjectKind().GroupVersionKind().Kind, configurationType, name, err) +} + +// RemoveUnwantedObjects attempts to delete the configuration objects +// that exist, are annotated `apf.kubernetes.io/autoupdate-spec=true`, and do not +// have a name in the given set. A refusal due to concurrent update is logged +// and not considered an error; the object will be reconsidered later. +func RemoveUnwantedObjects[ObjectType configurationObjectType](ctx context.Context, objectOps ObjectOps[ObjectType], boots []ObjectType) error { + current, err := objectOps.List(labels.Everything()) + if err != nil { + return err + } + wantedNames := namesOfBootstrapObjects(boots) + for _, object := range current { + name := object.GetName() + if wantedNames.Has(name) { + continue + } + var value string + var ok, autoUpdate bool + var err error + if value, ok = object.GetAnnotations()[flowcontrolv1.AutoUpdateAnnotationKey]; !ok { + // the configuration object does not have the annotation key, + // it's probably a user defined configuration object, + // so we can skip it. + klog.V(5).InfoS("Skipping deletion of APF object with no "+flowcontrolv1.AutoUpdateAnnotationKey+" annotation", "name", name) + continue + } + autoUpdate, err = strconv.ParseBool(value) + if err != nil { + // Log this because it is not an expected situation. + klog.V(4).InfoS("Skipping deletion of APF object with malformed "+flowcontrolv1.AutoUpdateAnnotationKey+" annotation", "name", name, "annotationValue", value, "parseError", err) + continue + } + if !autoUpdate { + klog.V(5).InfoS("Skipping deletion of APF object with "+flowcontrolv1.AutoUpdateAnnotationKey+"=false annotation", "name", name) + continue + } + // TODO: expectedResourceVersion := object.GetResourceVersion() + err = objectOps.Delete(ctx, object.GetName(), metav1.DeleteOptions{ /* TODO: expectedResourceVersion */ }) + if err == nil { + klog.V(2).InfoS(fmt.Sprintf("Successfully deleted the unwanted %s", object.GetObjectKind().GroupVersionKind().Kind), "name", name) + continue + } + if apierrors.IsNotFound(err) { + klog.V(5).InfoS("Unwanted APF object was concurrently deleted", "name", name) + } else { + return fmt.Errorf("failed to delete unwatned APF object %q - %w", name, err) + } + } + return nil +} + +func namesOfBootstrapObjects[ObjectType configurationObjectType](bos []ObjectType) sets.String { + names := sets.NewString() + for _, bo := range bos { + names.Insert(bo.GetName()) + } + return names +} diff --git a/internal/registry/apps/rest/doc.go b/internal/registry/flowcontrol/rest/doc.go similarity index 93% rename from internal/registry/apps/rest/doc.go rename to internal/registry/flowcontrol/rest/doc.go index 67fcc71bf9d..6ffba5043ce 100644 --- a/internal/registry/apps/rest/doc.go +++ b/internal/registry/flowcontrol/rest/doc.go @@ -4,4 +4,4 @@ // this file is https://github.com/superproj/onex. // -package rest // import "github.com/superproj/onex/internal/registry/apps/rest" +package rest // import "github.com/superproj/onex/internal/registry/flowcontrol/rest" diff --git a/internal/registry/flowcontrol/rest/storage_flowcontrol.go b/internal/registry/flowcontrol/rest/storage_flowcontrol.go new file mode 100644 index 00000000000..067c43521f3 --- /dev/null +++ b/internal/registry/flowcontrol/rest/storage_flowcontrol.go @@ -0,0 +1,235 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package rest + +import ( + "context" + "fmt" + "time" + + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + "k8s.io/apimachinery/pkg/util/wait" + flowcontrolbootstrap "k8s.io/apiserver/pkg/apis/flowcontrol/bootstrap" + "k8s.io/apiserver/pkg/registry/generic" + "k8s.io/apiserver/pkg/registry/rest" + genericapiserver "k8s.io/apiserver/pkg/server" + serverstorage "k8s.io/apiserver/pkg/server/storage" + "k8s.io/client-go/tools/cache" + "k8s.io/klog/v2" + "k8s.io/kubernetes/pkg/api/legacyscheme" + "k8s.io/kubernetes/pkg/apis/flowcontrol" + flowschemastore "k8s.io/kubernetes/pkg/registry/flowcontrol/flowschema/storage" + prioritylevelconfigurationstore "k8s.io/kubernetes/pkg/registry/flowcontrol/prioritylevelconfiguration/storage" + + serializerutil "github.com/superproj/onex/internal/pkg/util/serializer" + "github.com/superproj/onex/internal/registry/flowcontrol/ensurer" + flowcontrolclient "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1" + "github.com/superproj/onex/pkg/generated/informers" + flowcontrollisters "github.com/superproj/onex/pkg/generated/listers/flowcontrol/v1" +) + +var _ genericapiserver.PostStartHookProvider = RESTStorageProvider{} + +// RESTStorageProvider is a provider of REST storage +type RESTStorageProvider struct { + InformerFactory informers.SharedInformerFactory +} + +// PostStartHookName is the name of the post-start-hook provided by flow-control storage +const PostStartHookName = "priority-and-fairness-config-producer" + +// NewRESTStorage creates a new rest storage for flow-control api models. +func (p RESTStorageProvider) NewRESTStorage(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter) (genericapiserver.APIGroupInfo, error) { + apiGroupInfo := genericapiserver.NewDefaultAPIGroupInfo(flowcontrol.GroupName, legacyscheme.Scheme, legacyscheme.ParameterCodec, legacyscheme.Codecs) + apiGroupInfo.NegotiatedSerializer = serializerutil.NewProtocolShieldSerializers(&legacyscheme.Codecs) + + flowSchemaStorage, flowSchemaStatusStorage, err := flowschemastore.NewREST(restOptionsGetter) + if err != nil { + return genericapiserver.APIGroupInfo{}, err + } + + priorityLevelConfigurationStorage, priorityLevelConfigurationStatusStorage, err := prioritylevelconfigurationstore.NewREST(restOptionsGetter) + if err != nil { + return genericapiserver.APIGroupInfo{}, err + } + + restStorageMap := map[string]rest.Storage{ + "flowschemas": flowSchemaStorage, + "flowschemas/status": flowSchemaStatusStorage, + + "prioritylevelconfigurations": priorityLevelConfigurationStorage, + "prioritylevelconfigurations/status": priorityLevelConfigurationStatusStorage, + } + + apiGroupInfo.VersionedResourcesStorageMap[flowcontrolv1.SchemeGroupVersion.Version] = restStorageMap + + return apiGroupInfo, nil +} + +// GroupName return the api group name. +func (p RESTStorageProvider) GroupName() string { + return flowcontrol.GroupName +} + +// PostStartHook returns the hook func that launches the config provider +func (p RESTStorageProvider) PostStartHook() (string, genericapiserver.PostStartHookFunc, error) { + bce := &bootstrapConfigurationEnsurer{ + informersSynced: []cache.InformerSynced{ + p.InformerFactory.Flowcontrol().V1().PriorityLevelConfigurations().Informer().HasSynced, + p.InformerFactory.Flowcontrol().V1().FlowSchemas().Informer().HasSynced, + }, + fsLister: p.InformerFactory.Flowcontrol().V1().FlowSchemas().Lister(), + plcLister: p.InformerFactory.Flowcontrol().V1().PriorityLevelConfigurations().Lister(), + } + return PostStartHookName, bce.ensureAPFBootstrapConfiguration, nil +} + +type bootstrapConfigurationEnsurer struct { + informersSynced []cache.InformerSynced + fsLister flowcontrollisters.FlowSchemaLister + plcLister flowcontrollisters.PriorityLevelConfigurationLister +} + +func (bce *bootstrapConfigurationEnsurer) ensureAPFBootstrapConfiguration(hookContext genericapiserver.PostStartHookContext) error { + clientset, err := flowcontrolclient.NewForConfig(hookContext.LoopbackClientConfig) + if err != nil { + return fmt.Errorf("failed to initialize clientset for APF - %w", err) + } + + err = func() error { + // get a derived context that gets cancelled after 5m or + // when the StopCh gets closed, whichever happens first. + ctx, cancel := contextFromChannelAndMaxWaitDuration(hookContext.StopCh, 5*time.Minute) + defer cancel() + + if !cache.WaitForCacheSync(ctx.Done(), bce.informersSynced...) { + return fmt.Errorf("APF bootstrap ensurer timed out waiting for cache sync") + } + + err = wait.PollImmediateUntilWithContext( + ctx, + time.Second, + func(context.Context) (bool, error) { + if err := ensure(ctx, clientset, bce.fsLister, bce.plcLister); err != nil { + klog.ErrorS(err, "APF bootstrap ensurer ran into error, will retry later") + return false, nil + } + return true, nil + }) + if err != nil { + return fmt.Errorf("unable to initialize APF bootstrap configuration: %w", err) + } + return nil + }() + if err != nil { + return err + } + + // we have successfully initialized the bootstrap configuration, now we + // spin up a goroutine which reconciles the bootstrap configuration periodically. + go func() { + ctx := wait.ContextForChannel(hookContext.StopCh) + wait.PollImmediateUntil( + time.Minute, + func() (bool, error) { + if err := ensure(ctx, clientset, bce.fsLister, bce.plcLister); err != nil { + klog.ErrorS(err, "APF bootstrap ensurer ran into error, will retry later") + } + // always auto update both suggested and mandatory configuration + return false, nil + }, hookContext.StopCh) + klog.Info("APF bootstrap ensurer is exiting") + }() + + return nil +} + +func ensure(ctx context.Context, clientset flowcontrolclient.FlowcontrolV1Interface, fsLister flowcontrollisters.FlowSchemaLister, plcLister flowcontrollisters.PriorityLevelConfigurationLister) error { + + if err := ensureSuggestedConfiguration(ctx, clientset, fsLister, plcLister); err != nil { + // We should not attempt creation of mandatory objects if ensuring the suggested + // configuration resulted in an error. + // This only happens when the stop channel is closed. + return fmt.Errorf("failed ensuring suggested settings - %w", err) + } + + if err := ensureMandatoryConfiguration(ctx, clientset, fsLister, plcLister); err != nil { + return fmt.Errorf("failed ensuring mandatory settings - %w", err) + } + + if err := removeDanglingBootstrapConfiguration(ctx, clientset, fsLister, plcLister); err != nil { + return fmt.Errorf("failed to delete removed settings - %w", err) + } + + return nil +} + +func ensureSuggestedConfiguration(ctx context.Context, clientset flowcontrolclient.FlowcontrolV1Interface, fsLister flowcontrollisters.FlowSchemaLister, plcLister flowcontrollisters.PriorityLevelConfigurationLister) error { + plcOps := ensurer.NewPriorityLevelConfigurationOps(clientset.PriorityLevelConfigurations(), plcLister) + if err := ensurer.EnsureConfigurations(ctx, plcOps, flowcontrolbootstrap.SuggestedPriorityLevelConfigurations, ensurer.NewSuggestedEnsureStrategy[*flowcontrolv1.PriorityLevelConfiguration]()); err != nil { + return err + } + + fsOps := ensurer.NewFlowSchemaOps(clientset.FlowSchemas(), fsLister) + return ensurer.EnsureConfigurations(ctx, fsOps, flowcontrolbootstrap.SuggestedFlowSchemas, ensurer.NewSuggestedEnsureStrategy[*flowcontrolv1.FlowSchema]()) +} + +func ensureMandatoryConfiguration(ctx context.Context, clientset flowcontrolclient.FlowcontrolV1Interface, fsLister flowcontrollisters.FlowSchemaLister, plcLister flowcontrollisters.PriorityLevelConfigurationLister) error { + plcOps := ensurer.NewPriorityLevelConfigurationOps(clientset.PriorityLevelConfigurations(), plcLister) + if err := ensurer.EnsureConfigurations(ctx, plcOps, flowcontrolbootstrap.MandatoryPriorityLevelConfigurations, ensurer.NewMandatoryEnsureStrategy[*flowcontrolv1.PriorityLevelConfiguration]()); err != nil { + return err + } + + fsOps := ensurer.NewFlowSchemaOps(clientset.FlowSchemas(), fsLister) + return ensurer.EnsureConfigurations(ctx, fsOps, flowcontrolbootstrap.MandatoryFlowSchemas, ensurer.NewMandatoryEnsureStrategy[*flowcontrolv1.FlowSchema]()) +} + +func removeDanglingBootstrapConfiguration(ctx context.Context, clientset flowcontrolclient.FlowcontrolV1Interface, fsLister flowcontrollisters.FlowSchemaLister, plcLister flowcontrollisters.PriorityLevelConfigurationLister) error { + if err := removeDanglingBootstrapFlowSchema(ctx, clientset, fsLister); err != nil { + return err + } + + return removeDanglingBootstrapPriorityLevel(ctx, clientset, plcLister) +} + +func removeDanglingBootstrapFlowSchema(ctx context.Context, clientset flowcontrolclient.FlowcontrolV1Interface, fsLister flowcontrollisters.FlowSchemaLister) error { + bootstrap := append(flowcontrolbootstrap.MandatoryFlowSchemas, flowcontrolbootstrap.SuggestedFlowSchemas...) + fsOps := ensurer.NewFlowSchemaOps(clientset.FlowSchemas(), fsLister) + return ensurer.RemoveUnwantedObjects(ctx, fsOps, bootstrap) +} + +func removeDanglingBootstrapPriorityLevel(ctx context.Context, clientset flowcontrolclient.FlowcontrolV1Interface, plcLister flowcontrollisters.PriorityLevelConfigurationLister) error { + bootstrap := append(flowcontrolbootstrap.MandatoryPriorityLevelConfigurations, flowcontrolbootstrap.SuggestedPriorityLevelConfigurations...) + plcOps := ensurer.NewPriorityLevelConfigurationOps(clientset.PriorityLevelConfigurations(), plcLister) + return ensurer.RemoveUnwantedObjects(ctx, plcOps, bootstrap) +} + +// contextFromChannelAndMaxWaitDuration returns a Context that is bound to the +// specified channel and the wait duration. The derived context will be +// cancelled when the specified channel stopCh is closed or the maximum wait +// duration specified in maxWait elapses, whichever happens first. +// +// Note the caller must *always* call the CancelFunc, otherwise resources may be leaked. +func contextFromChannelAndMaxWaitDuration(stopCh <-chan struct{}, maxWait time.Duration) (context.Context, context.CancelFunc) { + ctx, cancel := context.WithCancel(context.Background()) + + go func() { + defer cancel() + + select { + case <-stopCh: + case <-time.After(maxWait): + + // the caller can explicitly cancel the context which is an + // indication to us to exit the goroutine immediately. + // Note that we are calling cancel more than once when we are here, + // CancelFunc is idempotent and we expect no ripple effects here. + case <-ctx.Done(): + } + }() + return ctx, cancel +} diff --git a/internal/usercenter/auth/authn.go b/internal/usercenter/auth/authn.go index 82eac1c0063..c8ef088c9be 100644 --- a/internal/usercenter/auth/authn.go +++ b/internal/usercenter/auth/authn.go @@ -119,7 +119,7 @@ func (a *authnImpl) Verify(accessToken string) (string, error) { return "", err } - if secret.Status == model.StatusSecretDisabled { + if secret.Status == known.SecretStatusDisabled { return "", ErrSecretDisabled } diff --git a/internal/usercenter/biz/user/list.go b/internal/usercenter/biz/user/list.go index c306ddb048d..98cb5925570 100644 --- a/internal/usercenter/biz/user/list.go +++ b/internal/usercenter/biz/user/list.go @@ -19,6 +19,10 @@ import ( "github.com/superproj/onex/pkg/log" ) +const ( + defaultMaxWorkers = 100 +) + // List retrieves a list of all users from the database. func (b *userBiz) List(ctx context.Context, rq *v1.ListUserRequest) (*v1.ListUserResponse, error) { count, list, err := b.ds.Users().List(ctx, meta.WithOffset(rq.Offset), meta.WithLimit(rq.Limit)) @@ -34,7 +38,7 @@ func (b *userBiz) List(ctx context.Context, rq *v1.ListUserRequest) (*v1.ListUse eg.Go(func() error { select { case <-ctx.Done(): - return nil + return ctx.Err() default: count, _, err := b.ds.Secrets().List(ctx, user.UserID) if err != nil { diff --git a/internal/usercenter/biz/user/user.go b/internal/usercenter/biz/user/user.go index 883402f0aaf..7c772f0b981 100644 --- a/internal/usercenter/biz/user/user.go +++ b/internal/usercenter/biz/user/user.go @@ -15,7 +15,7 @@ import ( v1 "github.com/superproj/onex/pkg/api/usercenter/v1" ) -// UserBiz defines methods used to handle user rquest. +// UserBiz defines methods used to handle user request. type UserBiz interface { Create(ctx context.Context, rq *v1.CreateUserRequest) (*v1.UserReply, error) List(ctx context.Context, rq *v1.ListUserRequest) (*v1.ListUserResponse, error) diff --git a/internal/usercenter/model/hook.go b/internal/usercenter/model/hook.go index 4c2a36adb27..ec0fd93a2c2 100644 --- a/internal/usercenter/model/hook.go +++ b/internal/usercenter/model/hook.go @@ -10,22 +10,11 @@ import ( "github.com/google/uuid" "gorm.io/gorm" + known "github.com/superproj/onex/internal/pkg/known/usercenter" "github.com/superproj/onex/internal/pkg/zid" "github.com/superproj/onex/pkg/authn" ) -// User status constants. -const ( - StatusUserDisabled = iota // Status used for disabling a user. - StatusUserNormal // Status used for enabling a user. -) - -// Secret status constants. -const ( - StatusSecretDisabled = iota // Status used for disabling a secret. - StatusSecretNormal // Status used for enabling a secret. -) - // BeforeCreate runs before creating a SecretM database record and initializes various fields. func (s *SecretM) BeforeCreate(tx *gorm.DB) (err error) { // Supports custom SecretKey, but users need to ensure the uniqueness of the SecretKey themselves. @@ -39,7 +28,7 @@ func (s *SecretM) BeforeCreate(tx *gorm.DB) (err error) { s.SecretKey = uuid.New().String() // Set the default status for the secret as normal. - s.Status = StatusSecretNormal + s.Status = known.SecretStatusNormal return nil } @@ -58,7 +47,7 @@ func (u *UserM) BeforeCreate(tx *gorm.DB) (err error) { return err // Return error if there's a problem with encryption. } - u.Status = StatusUserNormal // Set the default status for the user as normal. + u.Status = known.UserStatusActived // Set the default status for the user as active. return nil } diff --git a/internal/usercenter/model/uc_user.gen.go b/internal/usercenter/model/uc_user.gen.go index 4d17541ae02..25fda7aa5e0 100644 --- a/internal/usercenter/model/uc_user.gen.go +++ b/internal/usercenter/model/uc_user.gen.go @@ -21,7 +21,7 @@ type UserM struct { ID int64 `gorm:"column:id;type:bigint(20) unsigned;primaryKey;autoIncrement:true;comment:主键 ID" json:"id"` // 主键 ID UserID string `gorm:"column:user_id;type:varchar(253);not null;uniqueIndex:idx_user_id,priority:1;comment:用户 ID" json:"user_id"` // 用户 ID Username string `gorm:"column:username;type:varchar(253);not null;uniqueIndex:idx_username,priority:1;comment:用户名称" json:"username"` // 用户名称 - Status int32 `gorm:"column:status;type:tinyint(3) unsigned;not null;default:1;comment:用户状态,0-禁用;1-启用" json:"status"` // 用户状态,0-禁用;1-启用 + Status string `gorm:"column:status;type:tinyint(3) unsigned;not null;default:1;comment:用户状态,0-禁用;1-启用" json:"status"` // 用户状态,0-禁用;1-启用 Nickname string `gorm:"column:nickname;type:varchar(253);not null;comment:用户昵称" json:"nickname"` // 用户昵称 Password string `gorm:"column:password;type:varchar(64);not null;comment:用户加密后的密码" json:"password"` // 用户加密后的密码 Email string `gorm:"column:email;type:varchar(253);not null;comment:用户电子邮箱" json:"email"` // 用户电子邮箱 diff --git a/internal/usercenter/store/secret.go b/internal/usercenter/store/secret.go index 95eb817eef3..f102fcaaa15 100644 --- a/internal/usercenter/store/secret.go +++ b/internal/usercenter/store/secret.go @@ -90,7 +90,7 @@ func (d *secretStore) List(ctx context.Context, userID string, opts ...meta.List Not("name", known.TemporaryKeyName). Where(o.Filters). Offset(o.Offset). - Limit(defaultLimit(o.Limit)). + Limit(o.Limit). Order("id desc"). Find(&ret). Offset(-1). diff --git a/internal/usercenter/store/user.go b/internal/usercenter/store/user.go index 7067fb5ff01..52f976a5ed8 100644 --- a/internal/usercenter/store/user.go +++ b/internal/usercenter/store/user.go @@ -65,7 +65,7 @@ func (d *userStore) List(ctx context.Context, opts ...meta.ListOption) (count in ans := d.db(ctx). Where(o.Filters). Offset(o.Offset). - Limit(defaultLimit(o.Limit)). + Limit(o.Limit). Order("id desc"). Find(&ret). Offset(-1). diff --git a/manifests/env.k8s b/manifests/env.k8s index a134ad93f11..acda63c4717 100644 --- a/manifests/env.k8s +++ b/manifests/env.k8s @@ -2,12 +2,16 @@ ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -export ONEX_MYSQL_HOST=mariadb.infra.svc.onex.io -export ONEX_REDIS_HOST=redis.infra.svc.onex.io -export ONEX_ETCD_HOST=etcd.infra.svc.onex.io -export ONEX_MONGO_HOST=mongo.infra.svc.onex.io -export ONEX_KAFKA_HOST=onex-kafka.infra.svc.onex.io -export ONEX_JAEGER_HOST=jaeger.infra.svc.onex.io +# If deployed in a kubernetes cluster with cluster domain as +# cluster.local, please set KUBERNETES_CLUSTER_DOMAIN to cluster.local. +export KUBERNETES_CLUSTER_DOMAIN=${KUBERNETES_CLUSTER_DOMAIN:-superproj.com} + +export ONEX_MYSQL_HOST=mariadb.infra.svc.${KUBERNETES_CLUSTER_DOMAIN} +export ONEX_REDIS_HOST=redis.infra.svc.${KUBERNETES_CLUSTER_DOMAIN} +export ONEX_ETCD_HOST=etcd.infra.svc.${KUBERNETES_CLUSTER_DOMAIN} +export ONEX_MONGO_HOST=mongo.infra.svc.${KUBERNETES_CLUSTER_DOMAIN} +export ONEX_KAFKA_HOST=onex-kafka.infra.svc.${KUBERNETES_CLUSTER_DOMAIN} +export ONEX_JAEGER_HOST=jaeger.infra.svc.${KUBERNETES_CLUSTER_DOMAIN} # 将组件的访问地址改为 Kubernetes 服务名 export ONEX_USERCENTER_HOST=onex-usercenter diff --git a/manifests/installation/bare/onex/onex-apiserver/deployment.yaml b/manifests/installation/bare/onex/onex-apiserver/deployment.yaml index e94aa227a11..1dc953e2e9d 100644 --- a/manifests/installation/bare/onex/onex-apiserver/deployment.yaml +++ b/manifests/installation/bare/onex/onex-apiserver/deployment.yaml @@ -41,7 +41,7 @@ spec: - args: - --secure-port=52443 - --bind-address=0.0.0.0 - - --etcd-servers=etcd.infra.svc.onex.io:2379 + - --etcd-servers=etcd.infra.svc.superproj.com:2379 - --client-ca-file=/opt/onex/etc/cert/ca.pem - --tls-cert-file=/opt/onex/etc/cert/onex-apiserver.pem - --tls-private-key-file=/opt/onex/etc/cert/onex-apiserver-key.pem diff --git a/manifests/installation/bare/onex/onex-apiserver/ingressroute.yaml b/manifests/installation/bare/onex/onex-apiserver/ingressroute.yaml index 3a0f7e4ac8b..165451f2cdf 100644 --- a/manifests/installation/bare/onex/onex-apiserver/ingressroute.yaml +++ b/manifests/installation/bare/onex/onex-apiserver/ingressroute.yaml @@ -4,6 +4,16 @@ # this file is https://github.com/superproj/onex. # +apiVersion: traefik.io/v1alpha1 +kind: ServersTransport +metadata: + name: onex-apiserver-transport +spec: + serverName: onex.apiserver.superproj.com + insecureSkipVerify: false + rootCAsSecrets: + - root-ca-secret +--- apiVersion: traefik.io/v1alpha1 kind: IngressRoute metadata: @@ -18,5 +28,6 @@ spec: - kind: Service name: onex-apiserver port: 52443 + serversTransport: onex-apiserver-transport tls: secretName: onex-apiserver diff --git a/manifests/installation/kubeflow/images-ccr.list b/manifests/installation/kubeflow/images-ccr.list new file mode 100644 index 00000000000..3ac41221b13 --- /dev/null +++ b/manifests/installation/kubeflow/images-ccr.list @@ -0,0 +1,79 @@ +docker.io/istio/pilot:1.17.5 +docker.io/istio/proxyv2:1.17.5 +docker.io/kubeflowkatib/earlystopping-medianstop:v0.16.0 +docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v0.16.0 +docker.io/kubeflowkatib/file-metrics-collector:v0.16.0 +docker.io/kubeflowkatib/katib-controller:v0.16.0 +docker.io/kubeflowkatib/katib-db-manager:v0.16.0 +docker.io/kubeflowkatib/katib-ui:v0.16.0 +docker.io/kubeflowkatib/mxnet-mnist:v0.16.0 +docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.16.0 +docker.io/kubeflowkatib/suggestion-darts:v0.16.0 +docker.io/kubeflowkatib/suggestion-enas:v0.16.0 +docker.io/kubeflowkatib/suggestion-goptuna:v0.16.0 +docker.io/kubeflowkatib/suggestion-hyperband:v0.16.0 +docker.io/kubeflowkatib/suggestion-hyperopt:v0.16.0 +docker.io/kubeflowkatib/suggestion-optuna:v0.16.0 +docker.io/kubeflowkatib/suggestion-pbt:v0.16.0 +docker.io/kubeflowkatib/suggestion-skopt:v0.16.0 +docker.io/kubeflowkatib/tfevent-metrics-collector:v0.16.0 +docker.io/kubeflowmanifestswg/oidc-authservice:e236439 +docker.io/kubeflownotebookswg/centraldashboard:v1.8.0 +docker.io/kubeflownotebookswg/jupyter-web-app:v1.8.0 +docker.io/kubeflownotebookswg/kfam:v1.8.0 +docker.io/kubeflownotebookswg/notebook-controller:v1.8.0 +docker.io/kubeflownotebookswg/poddefaults-webhook:v1.8.0 +docker.io/kubeflownotebookswg/profile-controller:v1.8.0 +docker.io/kubeflownotebookswg/pvcviewer-controller:v1.8.0 +docker.io/kubeflownotebookswg/tensorboard-controller:v1.8.0 +docker.io/kubeflownotebookswg/tensorboards-web-app:v1.8.0 +docker.io/kubeflownotebookswg/volumes-web-app:v1.8.0 +docker.io/metacontrollerio/metacontroller:v2.0.4 +docker.io/seldonio/mlserver:1.3.2 +gcr.io/knative-releases/knative.dev/eventing/cmd/controller@sha256:92967bab4ad8f7d55ce3a77ba8868f3f2ce173c010958c28b9a690964ad6ee9b +gcr.io/knative-releases/knative.dev/eventing/cmd/mtping@sha256:6d35cc98baa098fc0c5b4290859e363a8350a9dadc31d1191b0b5c9796958223 +gcr.io/knative-releases/knative.dev/eventing/cmd/webhook@sha256:ebf93652f0254ac56600bedf4a7d81611b3e1e7f6526c6998da5dd24cdc67ee1 +gcr.io/knative-releases/knative.dev/net-istio/cmd/controller@sha256:421aa67057240fa0c56ebf2c6e5b482a12842005805c46e067129402d1751220 +gcr.io/knative-releases/knative.dev/net-istio/cmd/webhook@sha256:bfa1dfea77aff6dfa7959f4822d8e61c4f7933053874cd3f27352323e6ecd985 +gcr.io/knative-releases/knative.dev/serving/cmd/activator@sha256:c2994c2b6c2c7f38ad1b85c71789bf1753cc8979926423c83231e62258837cb9 +gcr.io/knative-releases/knative.dev/serving/cmd/autoscaler@sha256:8319aa662b4912e8175018bd7cc90c63838562a27515197b803bdcd5634c7007 +gcr.io/knative-releases/knative.dev/serving/cmd/controller@sha256:98a2cc7fd62ee95e137116504e7166c32c65efef42c3d1454630780410abf943 +gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping@sha256:f66c41ad7a73f5d4f4bdfec4294d5459c477f09f3ce52934d1a215e32316b59b +gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping-webhook@sha256:7368aaddf2be8d8784dc7195f5bc272ecfe49d429697f48de0ddc44f278167aa +gcr.io/knative-releases/knative.dev/serving/cmd/queue@sha256:dabaecec38860ca4c972e6821d5dc825549faf50c6feb8feb4c04802f2338b8a +gcr.io/knative-releases/knative.dev/serving/cmd/webhook@sha256:4305209ce498caf783f39c8f3e85dfa635ece6947033bf50b0b627983fd65953 +gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 +gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 +gcr.io/ml-pipeline/api-server:2.0.3 +gcr.io/ml-pipeline/cache-server:2.0.3 +gcr.io/ml-pipeline/frontend +gcr.io/ml-pipeline/frontend:2.0.3 +gcr.io/ml-pipeline/metadata-writer:2.0.3 +gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance +gcr.io/ml-pipeline/mysql:8.0.26 +gcr.io/ml-pipeline/persistenceagent:2.0.3 +gcr.io/ml-pipeline/scheduledworkflow:2.0.3 +gcr.io/ml-pipeline/viewer-crd-controller:2.0.3 +gcr.io/ml-pipeline/visualization-server +gcr.io/ml-pipeline/workflow-controller:v3.3.10-license-compliance +gcr.io/tfx-oss-public/ml_metadata_store_server:1.14.0 +gcr.io/ml-pipeline/metadata-envoy:2.0.3 +gcr.io/ml-pipeline/argoexec:v3.3.10-license-compliance +gcr.io/ml-pipeline/kfp-driver@sha256:8e60086b04d92b657898a310ca9757631d58547e76bbbb8bfc376d654bef1707 +ghcr.io/dexidp/dex:v2.36.0 +kserve/kserve-controller:v0.11.1 +kserve/lgbserver:v0.11.1 +kserve/models-web-app:v0.10.0 +kserve/paddleserver:v0.11.1 +kserve/pmmlserver:v0.11.1 +kserve/sklearnserver:v0.11.1 +kserve/xgbserver:v0.11.1 +kubeflow/training-operator:v1-855e096 +mysql:8.0.29 +nvcr.io/nvidia/tritonserver:23.05-py3 +python:3.7 +pytorch/torchserve-kfs:0.8.2 +quay.io/jetstack/cert-manager-cainjector:v1.12.2 +quay.io/jetstack/cert-manager-controller:v1.12.2 +quay.io/jetstack/cert-manager-webhook:v1.12.2 +tensorflow/serving:2.6.2 diff --git a/manifests/installation/kubeflow/images-origin.list b/manifests/installation/kubeflow/images-origin.list new file mode 100644 index 00000000000..3ac41221b13 --- /dev/null +++ b/manifests/installation/kubeflow/images-origin.list @@ -0,0 +1,79 @@ +docker.io/istio/pilot:1.17.5 +docker.io/istio/proxyv2:1.17.5 +docker.io/kubeflowkatib/earlystopping-medianstop:v0.16.0 +docker.io/kubeflowkatib/enas-cnn-cifar10-cpu:v0.16.0 +docker.io/kubeflowkatib/file-metrics-collector:v0.16.0 +docker.io/kubeflowkatib/katib-controller:v0.16.0 +docker.io/kubeflowkatib/katib-db-manager:v0.16.0 +docker.io/kubeflowkatib/katib-ui:v0.16.0 +docker.io/kubeflowkatib/mxnet-mnist:v0.16.0 +docker.io/kubeflowkatib/pytorch-mnist-cpu:v0.16.0 +docker.io/kubeflowkatib/suggestion-darts:v0.16.0 +docker.io/kubeflowkatib/suggestion-enas:v0.16.0 +docker.io/kubeflowkatib/suggestion-goptuna:v0.16.0 +docker.io/kubeflowkatib/suggestion-hyperband:v0.16.0 +docker.io/kubeflowkatib/suggestion-hyperopt:v0.16.0 +docker.io/kubeflowkatib/suggestion-optuna:v0.16.0 +docker.io/kubeflowkatib/suggestion-pbt:v0.16.0 +docker.io/kubeflowkatib/suggestion-skopt:v0.16.0 +docker.io/kubeflowkatib/tfevent-metrics-collector:v0.16.0 +docker.io/kubeflowmanifestswg/oidc-authservice:e236439 +docker.io/kubeflownotebookswg/centraldashboard:v1.8.0 +docker.io/kubeflownotebookswg/jupyter-web-app:v1.8.0 +docker.io/kubeflownotebookswg/kfam:v1.8.0 +docker.io/kubeflownotebookswg/notebook-controller:v1.8.0 +docker.io/kubeflownotebookswg/poddefaults-webhook:v1.8.0 +docker.io/kubeflownotebookswg/profile-controller:v1.8.0 +docker.io/kubeflownotebookswg/pvcviewer-controller:v1.8.0 +docker.io/kubeflownotebookswg/tensorboard-controller:v1.8.0 +docker.io/kubeflownotebookswg/tensorboards-web-app:v1.8.0 +docker.io/kubeflownotebookswg/volumes-web-app:v1.8.0 +docker.io/metacontrollerio/metacontroller:v2.0.4 +docker.io/seldonio/mlserver:1.3.2 +gcr.io/knative-releases/knative.dev/eventing/cmd/controller@sha256:92967bab4ad8f7d55ce3a77ba8868f3f2ce173c010958c28b9a690964ad6ee9b +gcr.io/knative-releases/knative.dev/eventing/cmd/mtping@sha256:6d35cc98baa098fc0c5b4290859e363a8350a9dadc31d1191b0b5c9796958223 +gcr.io/knative-releases/knative.dev/eventing/cmd/webhook@sha256:ebf93652f0254ac56600bedf4a7d81611b3e1e7f6526c6998da5dd24cdc67ee1 +gcr.io/knative-releases/knative.dev/net-istio/cmd/controller@sha256:421aa67057240fa0c56ebf2c6e5b482a12842005805c46e067129402d1751220 +gcr.io/knative-releases/knative.dev/net-istio/cmd/webhook@sha256:bfa1dfea77aff6dfa7959f4822d8e61c4f7933053874cd3f27352323e6ecd985 +gcr.io/knative-releases/knative.dev/serving/cmd/activator@sha256:c2994c2b6c2c7f38ad1b85c71789bf1753cc8979926423c83231e62258837cb9 +gcr.io/knative-releases/knative.dev/serving/cmd/autoscaler@sha256:8319aa662b4912e8175018bd7cc90c63838562a27515197b803bdcd5634c7007 +gcr.io/knative-releases/knative.dev/serving/cmd/controller@sha256:98a2cc7fd62ee95e137116504e7166c32c65efef42c3d1454630780410abf943 +gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping@sha256:f66c41ad7a73f5d4f4bdfec4294d5459c477f09f3ce52934d1a215e32316b59b +gcr.io/knative-releases/knative.dev/serving/cmd/domain-mapping-webhook@sha256:7368aaddf2be8d8784dc7195f5bc272ecfe49d429697f48de0ddc44f278167aa +gcr.io/knative-releases/knative.dev/serving/cmd/queue@sha256:dabaecec38860ca4c972e6821d5dc825549faf50c6feb8feb4c04802f2338b8a +gcr.io/knative-releases/knative.dev/serving/cmd/webhook@sha256:4305209ce498caf783f39c8f3e85dfa635ece6947033bf50b0b627983fd65953 +gcr.io/kubebuilder/kube-rbac-proxy:v0.13.1 +gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0 +gcr.io/ml-pipeline/api-server:2.0.3 +gcr.io/ml-pipeline/cache-server:2.0.3 +gcr.io/ml-pipeline/frontend +gcr.io/ml-pipeline/frontend:2.0.3 +gcr.io/ml-pipeline/metadata-writer:2.0.3 +gcr.io/ml-pipeline/minio:RELEASE.2019-08-14T20-37-41Z-license-compliance +gcr.io/ml-pipeline/mysql:8.0.26 +gcr.io/ml-pipeline/persistenceagent:2.0.3 +gcr.io/ml-pipeline/scheduledworkflow:2.0.3 +gcr.io/ml-pipeline/viewer-crd-controller:2.0.3 +gcr.io/ml-pipeline/visualization-server +gcr.io/ml-pipeline/workflow-controller:v3.3.10-license-compliance +gcr.io/tfx-oss-public/ml_metadata_store_server:1.14.0 +gcr.io/ml-pipeline/metadata-envoy:2.0.3 +gcr.io/ml-pipeline/argoexec:v3.3.10-license-compliance +gcr.io/ml-pipeline/kfp-driver@sha256:8e60086b04d92b657898a310ca9757631d58547e76bbbb8bfc376d654bef1707 +ghcr.io/dexidp/dex:v2.36.0 +kserve/kserve-controller:v0.11.1 +kserve/lgbserver:v0.11.1 +kserve/models-web-app:v0.10.0 +kserve/paddleserver:v0.11.1 +kserve/pmmlserver:v0.11.1 +kserve/sklearnserver:v0.11.1 +kserve/xgbserver:v0.11.1 +kubeflow/training-operator:v1-855e096 +mysql:8.0.29 +nvcr.io/nvidia/tritonserver:23.05-py3 +python:3.7 +pytorch/torchserve-kfs:0.8.2 +quay.io/jetstack/cert-manager-cainjector:v1.12.2 +quay.io/jetstack/cert-manager-controller:v1.12.2 +quay.io/jetstack/cert-manager-webhook:v1.12.2 +tensorflow/serving:2.6.2 diff --git a/manifests/installation/kubeflow/scripts/pull_images.sh b/manifests/installation/kubeflow/scripts/pull_images.sh new file mode 100755 index 00000000000..84cf916d5e9 --- /dev/null +++ b/manifests/installation/kubeflow/scripts/pull_images.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +registry_prefix="m.daocloud.io" + +# Usage: +# ./pull_images.sh images-origin.list + +image_list="$1" + +# 读取镜像列表 +while IFS= read -r image; do + # 拼接完整的镜像路径 + full_image="${registry_prefix}/${image}" + + # 执行 Docker 拉取命令 + docker pull "$full_image" |tee -a /tmp/pull_images.log + + # 如果你还需要其他操作,可以在这里添加 +done < ${image_list} + + diff --git a/manifests/installation/kubernetes/kind-onex.yaml b/manifests/installation/kubernetes/kind-onex.yaml index 356b9189e66..21576b65404 100644 --- a/manifests/installation/kubernetes/kind-onex.yaml +++ b/manifests/installation/kubernetes/kind-onex.yaml @@ -42,7 +42,7 @@ kubeadmConfigPatches: - | kind: ClusterConfiguration networking: - dnsDomain: "onex.io" + dnsDomain: "superproj.com" - | apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration diff --git a/manifests/installation/middleware/jaeger/statefulset.yaml b/manifests/installation/middleware/jaeger/statefulset.yaml index e3d8569c85d..ce9fb14268b 100644 --- a/manifests/installation/middleware/jaeger/statefulset.yaml +++ b/manifests/installation/middleware/jaeger/statefulset.yaml @@ -7,6 +7,7 @@ spec: selector: matchLabels: app: jaeger + serviceName: jaeger template: metadata: labels: diff --git a/manifests/installation/middleware/kafka/statefulset.yaml b/manifests/installation/middleware/kafka/statefulset.yaml index cbf7ba0e8df..13f6dcea113 100644 --- a/manifests/installation/middleware/kafka/statefulset.yaml +++ b/manifests/installation/middleware/kafka/statefulset.yaml @@ -7,6 +7,7 @@ spec: selector: matchLabels: app: kafka + serviceName: onex-kafka template: metadata: labels: diff --git a/manifests/installation/storage/etcd/statefulset.yaml b/manifests/installation/storage/etcd/statefulset.yaml index 12d1017bdd7..5266a32c9e8 100644 --- a/manifests/installation/storage/etcd/statefulset.yaml +++ b/manifests/installation/storage/etcd/statefulset.yaml @@ -7,6 +7,7 @@ spec: selector: matchLabels: app: etcd + serviceName: etcd template: metadata: labels: diff --git a/manifests/installation/storage/mariadb/statefulset.yaml b/manifests/installation/storage/mariadb/statefulset.yaml index aabdf01ce08..01346c3a0d5 100644 --- a/manifests/installation/storage/mariadb/statefulset.yaml +++ b/manifests/installation/storage/mariadb/statefulset.yaml @@ -17,6 +17,8 @@ spec: selector: matchLabels: app: mariadb + # 指定了Pod关联的Service名称 + serviceName: mariadb # 指定了要创建的Pod的模板信息 template: # 指定了Pod的元数据信息,包括标签等 @@ -56,6 +58,9 @@ spec: # 指定了存储卷的规格信息,包括访问模式和资源请求等 spec: # 指定了存储卷的访问模式为"ReadWriteOnce",表示可以被单个节点挂载为读写模式 + # ReadWriteOnce: PV 能以 read-write 模式 mount 到单个节点 + # ReadOnlyMany: PV 能以 read-only 模式 mount 到多个节点 + # ReadWriteMany: PV 能以 read-write 模式 mount 到多个节点 accessModes: [ "ReadWriteOnce" ] # 指定了存储卷的资源请求信息 resources: diff --git a/manifests/installation/storage/mongo/statefulset.yaml b/manifests/installation/storage/mongo/statefulset.yaml index e283457c32b..6a05d87773c 100644 --- a/manifests/installation/storage/mongo/statefulset.yaml +++ b/manifests/installation/storage/mongo/statefulset.yaml @@ -7,6 +7,7 @@ spec: selector: matchLabels: app: mongo + serviceName: mongo template: metadata: labels: diff --git a/manifests/installation/storage/redis/statefulset.yaml b/manifests/installation/storage/redis/statefulset.yaml index 3d1fda9592c..11ea1f7c2b3 100644 --- a/manifests/installation/storage/redis/statefulset.yaml +++ b/manifests/installation/storage/redis/statefulset.yaml @@ -7,6 +7,7 @@ spec: selector: matchLabels: app: redis + serviceName: redis template: metadata: labels: diff --git a/manifests/installation/storage/values.yaml b/manifests/installation/storage/values.yaml index 708061bcf7e..c66008cb337 100644 --- a/manifests/installation/storage/values.yaml +++ b/manifests/installation/storage/values.yaml @@ -1,5 +1,5 @@ # 设置集群的域名 -clusterDomain: onex.io +clusterDomain: superproj.com # 镜像相关配置 image: # 镜像仓库的地址 diff --git a/manifests/template/command-demo.yaml b/manifests/sample/k8s/busybox-deployment.yaml similarity index 80% rename from manifests/template/command-demo.yaml rename to manifests/sample/k8s/busybox-deployment.yaml index b3bb5df7dce..6a98cf00826 100644 --- a/manifests/template/command-demo.yaml +++ b/manifests/sample/k8s/busybox-deployment.yaml @@ -4,25 +4,26 @@ # this file is https://github.com/superproj/onex. # +# 有:wget, telnet, ping apiVersion: apps/v1 kind: Deployment metadata: - name: command-demo + name: busybox spec: replicas: 1 selector: matchLabels: - app: command-demo + app: busybox template: metadata: labels: - app: command-demo + app: busybox spec: restartPolicy: Always containers: - - name: my-container + - name: busybox image: busybox - command: ["sh", "-c", "sleep 3000"] + command: ["sleep", "infinity"] readinessProbe: exec: command: ["false"] diff --git a/manifests/sample/k8s/centos8.yaml b/manifests/sample/k8s/centos8-deployment.yaml similarity index 100% rename from manifests/sample/k8s/centos8.yaml rename to manifests/sample/k8s/centos8-deployment.yaml diff --git a/manifests/sample/k8s/debian12-deployment.yaml b/manifests/sample/k8s/debian12-deployment.yaml new file mode 100644 index 00000000000..95ca6168ceb --- /dev/null +++ b/manifests/sample/k8s/debian12-deployment.yaml @@ -0,0 +1,34 @@ +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +apiVersion: apps/v1 +kind: Deployment +metadata: + name: debian12-deployment + labels: + app: debian12 +spec: + replicas: 1 + selector: + matchLabels: + app: debian12 + template: + metadata: + labels: + app: debian12 + spec: + containers: + - name: debian12 + image: debian:12 + command: ["sleep", "infinity"] + args: ["while true; do sleep 30; done;"] + resources: + limits: + memory: "256Mi" + cpu: "500m" + requests: + memory: "128Mi" + cpu: "250m" diff --git a/manifests/sample/k8s/dnsutils-ds.yml b/manifests/sample/k8s/dnsutils-ds.yml new file mode 100644 index 00000000000..054c943612b --- /dev/null +++ b/manifests/sample/k8s/dnsutils-ds.yml @@ -0,0 +1,38 @@ +apiVersion: v1 +kind: Service +metadata: + name: dnsutils-ds + labels: + app: dnsutils-ds +spec: + type: NodePort + selector: + app: dnsutils-ds + ports: + - name: http + port: 80 + targetPort: 80 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: dnsutils-ds + labels: + addonmanager.kubernetes.io/mode: Reconcile +spec: + selector: + matchLabels: + app: dnsutils-ds + template: + metadata: + labels: + app: dnsutils-ds + spec: + containers: + - name: my-dnsutils + image: tutum/dnsutils:latest + command: + - sleep + - "3600" + ports: + - containerPort: 80 diff --git a/manifests/sample/k8s/deployment.json b/manifests/sample/k8s/nginx-deployment.json similarity index 100% rename from manifests/sample/k8s/deployment.json rename to manifests/sample/k8s/nginx-deployment.json diff --git a/manifests/sample/k8s/deployment.yaml b/manifests/sample/k8s/nginx-deployment.yaml similarity index 100% rename from manifests/sample/k8s/deployment.yaml rename to manifests/sample/k8s/nginx-deployment.yaml diff --git a/manifests/sample/k8s/nginx-ds.yml b/manifests/sample/k8s/nginx-ds.yml new file mode 100644 index 00000000000..a448a49eaf3 --- /dev/null +++ b/manifests/sample/k8s/nginx-ds.yml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: Service +metadata: + name: nginx-ds + labels: + app: nginx-ds +spec: + type: NodePort + selector: + app: nginx-ds + ports: + - name: http + port: 80 + targetPort: 80 +--- +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: nginx-ds + labels: + addonmanager.kubernetes.io/mode: Reconcile +spec: + selector: + matchLabels: + app: nginx-ds + template: + metadata: + labels: + app: nginx-ds + spec: + containers: + - name: my-nginx + image: nginx + ports: + - containerPort: 80 diff --git a/manifests/sample/k8s/pod.yaml b/manifests/sample/k8s/nginx-pod.yaml similarity index 100% rename from manifests/sample/k8s/pod.yaml rename to manifests/sample/k8s/nginx-pod.yaml diff --git a/manifests/sample/k8s/job.yaml b/manifests/sample/k8s/pi-job.yaml similarity index 100% rename from manifests/sample/k8s/job.yaml rename to manifests/sample/k8s/pi-job.yaml diff --git a/manifests/sample/k8s/webhook/mutating-webhook.yaml b/manifests/sample/k8s/webhook/mutating-webhook.yaml new file mode 100644 index 00000000000..01ff4cc73bc --- /dev/null +++ b/manifests/sample/k8s/webhook/mutating-webhook.yaml @@ -0,0 +1,29 @@ +apiVersion: admissionregistration.k8s.io/v1 +kind: MutatingWebhookConfiguration +metadata: + name: mutating-webhook-example # 配置的名称,用于唯一标识这个 webhook 配置 +webhooks: + - name: mutate.example.com # Webhook 的名称,必须是唯一的 + clientConfig: # 配置 webhook 服务的连接信息 + service: + name: mutating-webhook-service # Webhook 服务的名称 + namespace: default # Webhook 服务所在的命名空间 + path: "/mutate" # Webhook 服务的路径 + # caBundle 这里应该是 Base64 编码的 CA 证书,用于校验 webhook 服务的 TLS 证书 + caBundle: "YOUR_CA_BUNDLE" + rules: # 定义 webhook 应用的规则 + - operations: ["CREATE", "UPDATE"] # Webhook 触发的操作类型,如 CREATE、UPDATE。还有一个 DELETE 操作类型 + apiGroups: [""] # 目标资源所在的 API 组 + apiVersions: ["v1"] # 目标资源的 API 版本 + resources: ["pods"] # 目标资源类型,如 pods + failurePolicy: Fail # Webhook 服务失败时的策略,Fail 或 Ignore + matchPolicy: Exact # 资源匹配策略,Exact 或 Equivalent + namespaceSelector: # 基于命名空间标签选择应用于哪些命名空间 + matchLabels: + webhook: enabled + objectSelector: # 基于资源标签选择应用于哪些资源 + matchLabels: + apply-webhook: "true" + sideEffects: None # Webhook 的副作用,None、Some 或 Unknown + timeoutSeconds: 10 # Webhook 请求的超时时间(秒) + admissionReviewVersions: ["v1", "v1beta1"] # 支持的 AdmissionReview 版本 diff --git a/manifests/sample/k8s/webhook/validating-webhook.yaml b/manifests/sample/k8s/webhook/validating-webhook.yaml new file mode 100644 index 00000000000..20696785a1e --- /dev/null +++ b/manifests/sample/k8s/webhook/validating-webhook.yaml @@ -0,0 +1,29 @@ +apiVersion: admissionregistration.k8s.io/v1 +kind: ValidatingWebhookConfiguration +metadata: + name: validating-webhook-example # 配置的名称,用于唯一标识这个 webhook 配置 +webhooks: + - name: validate.example.com # Webhook 的名称,必须是唯一的 + clientConfig: # 配置 webhook 服务的连接信息 + service: + name: validating-webhook-service # Webhook 服务的名称 + namespace: default # Webhook 服务所在的命名空间 + path: "/validate" # Webhook 服务的路径 + # caBundle 这里应该是 Base64 编码的 CA 证书,用于校验 webhook 服务的 TLS 证书 + caBundle: "YOUR_CA_BUNDLE" + rules: # 定义 webhook 应用的规则 + - operations: ["CREATE", "UPDATE"] # Webhook 触发的操作类型,如 CREATE、UPDATE。还有一个类型:DELETE + apiGroups: [""] # 目标资源所在的 API 组 + apiVersions: ["v1"] # 目标资源的 API 版本 + resources: ["pods"] # 目标资源类型,如 pods + failurePolicy: Fail # Webhook 服务失败时的策略,Fail 或 Ignore + matchPolicy: Equivalent # 资源匹配策略,Exact 或 Equivalent + namespaceSelector: # 基于命名空间标签选择应用于哪些命名空间 + matchLabels: + webhook: enabled + objectSelector: # 基于资源标签选择应用于哪些资源 + matchLabels: + apply-webhook: "true" + sideEffects: None # Webhook 的副作用,None、Some 或 Unknown + timeoutSeconds: 5 # Webhook 请求的超时时间(秒) + admissionReviewVersions: ["v1", "v1beta1"] # 支持的 AdmissionReview 版本 diff --git a/manifests/sample/onex/crd/mycustomresources-cr.yaml b/manifests/sample/onex/crd/mycustomresources-cr.yaml new file mode 100644 index 00000000000..4917cbe93fa --- /dev/null +++ b/manifests/sample/onex/crd/mycustomresources-cr.yaml @@ -0,0 +1,8 @@ +apiVersion: example.com/v1 +kind: MyCustomResource +metadata: + name: my-custom-resource + namespace: default +spec: + name: my-app + image: myregistry.azurecr.io/my-app:v1.0 diff --git a/manifests/sample/onex/crd/mycustomresources-crd.yaml b/manifests/sample/onex/crd/mycustomresources-crd.yaml new file mode 100644 index 00000000000..e0e77262dc5 --- /dev/null +++ b/manifests/sample/onex/crd/mycustomresources-crd.yaml @@ -0,0 +1,35 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: mycustomresources.example.com +spec: + group: example.com + versions: + - name: v1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + # 在这里定义您的自定义资源的属性 + name: + type: string + image: + type: string + status: + type: object + properties: + # 在这里定义您的自定义资源的状态 + phase: + type: string + scope: Namespaced + names: + plural: mycustomresources + singular: mycustomresource + kind: MyCustomResource + shortNames: + - mcr diff --git a/manifests/sample/onex/endpoints.yaml b/manifests/sample/onex/endpoints.yaml new file mode 100644 index 00000000000..c54ec4fc6a0 --- /dev/null +++ b/manifests/sample/onex/endpoints.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Endpoints +metadata: + name: my-service +subsets: +- addresses: + - ip: 192.168.1.100 + - ip: 192.168.1.101 + ports: + - port: 80 + - port: 8080 diff --git a/pkg/api/cacheserver/v1/cacheserver.pb.go b/pkg/api/cacheserver/v1/cacheserver.pb.go index fc164e78aad..44e06455ad8 100644 --- a/pkg/api/cacheserver/v1/cacheserver.pb.go +++ b/pkg/api/cacheserver/v1/cacheserver.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: cacheserver/v1/cacheserver.proto @@ -667,7 +667,7 @@ func file_cacheserver_v1_cacheserver_proto_rawDescGZIP() []byte { } var file_cacheserver_v1_cacheserver_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_cacheserver_v1_cacheserver_proto_goTypes = []any{ +var file_cacheserver_v1_cacheserver_proto_goTypes = []interface{}{ (*SetRequest)(nil), // 0: cacheserver.v1.SetRequest (*GetRequest)(nil), // 1: cacheserver.v1.GetRequest (*GetResponse)(nil), // 2: cacheserver.v1.GetResponse @@ -714,7 +714,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_cacheserver_v1_cacheserver_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetRequest); i { case 0: return &v.state @@ -726,7 +726,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetRequest); i { case 0: return &v.state @@ -738,7 +738,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetResponse); i { case 0: return &v.state @@ -750,7 +750,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DelRequest); i { case 0: return &v.state @@ -762,7 +762,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SetSecretRequest); i { case 0: return &v.state @@ -774,7 +774,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSecretRequest); i { case 0: return &v.state @@ -786,7 +786,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DelSecretRequest); i { case 0: return &v.state @@ -798,7 +798,7 @@ func file_cacheserver_v1_cacheserver_proto_init() { return nil } } - file_cacheserver_v1_cacheserver_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_cacheserver_v1_cacheserver_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSecretResponse); i { case 0: return &v.state @@ -811,8 +811,8 @@ func file_cacheserver_v1_cacheserver_proto_init() { } } } - file_cacheserver_v1_cacheserver_proto_msgTypes[0].OneofWrappers = []any{} - file_cacheserver_v1_cacheserver_proto_msgTypes[4].OneofWrappers = []any{} + file_cacheserver_v1_cacheserver_proto_msgTypes[0].OneofWrappers = []interface{}{} + file_cacheserver_v1_cacheserver_proto_msgTypes[4].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/api/cacheserver/v1/cacheserver.pb.validate.go b/pkg/api/cacheserver/v1/cacheserver.pb.validate.go index 6fd22c7c8d3..5584f70c80c 100644 --- a/pkg/api/cacheserver/v1/cacheserver.pb.validate.go +++ b/pkg/api/cacheserver/v1/cacheserver.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: cacheserver/v1/cacheserver.proto @@ -68,7 +62,7 @@ func (m *SetRequest) validate(all bool) error { // no validation rules for Key if all { - switch v := any(m.GetValue()).(type) { + switch v := interface{}(m.GetValue()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SetRequestValidationError{ @@ -86,7 +80,7 @@ func (m *SetRequest) validate(all bool) error { }) } } - } else if v, ok := any(m.GetValue()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SetRequestValidationError{ field: "Value", @@ -99,7 +93,7 @@ func (m *SetRequest) validate(all bool) error { if m.Expire != nil { if all { - switch v := any(m.GetExpire()).(type) { + switch v := interface{}(m.GetExpire()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SetRequestValidationError{ @@ -117,7 +111,7 @@ func (m *SetRequest) validate(all bool) error { }) } } - } else if v, ok := any(m.GetExpire()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetExpire()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SetRequestValidationError{ field: "Expire", @@ -332,7 +326,7 @@ func (m *GetResponse) validate(all bool) error { var errors []error if all { - switch v := any(m.GetValue()).(type) { + switch v := interface{}(m.GetValue()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetResponseValidationError{ @@ -350,7 +344,7 @@ func (m *GetResponse) validate(all bool) error { }) } } - } else if v, ok := any(m.GetValue()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetValue()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetResponseValidationError{ field: "Value", @@ -361,7 +355,7 @@ func (m *GetResponse) validate(all bool) error { } if all { - switch v := any(m.GetExpire()).(type) { + switch v := interface{}(m.GetExpire()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetResponseValidationError{ @@ -379,7 +373,7 @@ func (m *GetResponse) validate(all bool) error { }) } } - } else if v, ok := any(m.GetExpire()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetExpire()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetResponseValidationError{ field: "Expire", @@ -618,7 +612,7 @@ func (m *SetSecretRequest) validate(all bool) error { if m.Expire != nil { if all { - switch v := any(m.GetExpire()).(type) { + switch v := interface{}(m.GetExpire()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SetSecretRequestValidationError{ @@ -636,7 +630,7 @@ func (m *SetSecretRequest) validate(all bool) error { }) } } - } else if v, ok := any(m.GetExpire()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetExpire()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SetSecretRequestValidationError{ field: "Expire", @@ -967,7 +961,7 @@ func (m *GetSecretResponse) validate(all bool) error { // no validation rules for Description if all { - switch v := any(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetSecretResponseValidationError{ @@ -985,7 +979,7 @@ func (m *GetSecretResponse) validate(all bool) error { }) } } - } else if v, ok := any(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetSecretResponseValidationError{ field: "CreatedAt", @@ -996,7 +990,7 @@ func (m *GetSecretResponse) validate(all bool) error { } if all { - switch v := any(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, GetSecretResponseValidationError{ @@ -1014,7 +1008,7 @@ func (m *GetSecretResponse) validate(all bool) error { }) } } - } else if v, ok := any(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GetSecretResponseValidationError{ field: "UpdatedAt", diff --git a/pkg/api/cacheserver/v1/cacheserver_grpc.pb.go b/pkg/api/cacheserver/v1/cacheserver_grpc.pb.go index 146499f8e31..ffb54c6a00d 100644 --- a/pkg/api/cacheserver/v1/cacheserver_grpc.pb.go +++ b/pkg/api/cacheserver/v1/cacheserver_grpc.pb.go @@ -156,7 +156,7 @@ func RegisterCacheServerServer(s grpc.ServiceRegistrar, srv CacheServerServer) { s.RegisterService(&CacheServer_ServiceDesc, srv) } -func _CacheServer_Set_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _CacheServer_Set_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetRequest) if err := dec(in); err != nil { return nil, err @@ -168,13 +168,13 @@ func _CacheServer_Set_Handler(srv any, ctx context.Context, dec func(any) error, Server: srv, FullMethod: CacheServer_Set_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CacheServerServer).Set(ctx, req.(*SetRequest)) } return interceptor(ctx, in, info, handler) } -func _CacheServer_Get_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _CacheServer_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetRequest) if err := dec(in); err != nil { return nil, err @@ -186,13 +186,13 @@ func _CacheServer_Get_Handler(srv any, ctx context.Context, dec func(any) error, Server: srv, FullMethod: CacheServer_Get_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CacheServerServer).Get(ctx, req.(*GetRequest)) } return interceptor(ctx, in, info, handler) } -func _CacheServer_Del_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _CacheServer_Del_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DelRequest) if err := dec(in); err != nil { return nil, err @@ -204,13 +204,13 @@ func _CacheServer_Del_Handler(srv any, ctx context.Context, dec func(any) error, Server: srv, FullMethod: CacheServer_Del_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CacheServerServer).Del(ctx, req.(*DelRequest)) } return interceptor(ctx, in, info, handler) } -func _CacheServer_SetSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _CacheServer_SetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetSecretRequest) if err := dec(in); err != nil { return nil, err @@ -222,13 +222,13 @@ func _CacheServer_SetSecret_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: CacheServer_SetSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CacheServerServer).SetSecret(ctx, req.(*SetSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _CacheServer_GetSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _CacheServer_GetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetSecretRequest) if err := dec(in); err != nil { return nil, err @@ -240,13 +240,13 @@ func _CacheServer_GetSecret_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: CacheServer_GetSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CacheServerServer).GetSecret(ctx, req.(*GetSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _CacheServer_DelSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _CacheServer_DelSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DelSecretRequest) if err := dec(in); err != nil { return nil, err @@ -258,7 +258,7 @@ func _CacheServer_DelSecret_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: CacheServer_DelSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(CacheServerServer).DelSecret(ctx, req.(*DelSecretRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/api/cacheserver/v1/errors.pb.go b/pkg/api/cacheserver/v1/errors.pb.go index 6d72f3708bd..27a8fdffaa7 100644 --- a/pkg/api/cacheserver/v1/errors.pb.go +++ b/pkg/api/cacheserver/v1/errors.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: cacheserver/v1/errors.proto @@ -112,7 +112,7 @@ func file_cacheserver_v1_errors_proto_rawDescGZIP() []byte { } var file_cacheserver_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_cacheserver_v1_errors_proto_goTypes = []any{ +var file_cacheserver_v1_errors_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: cacheserver.v1.ErrorReason } var file_cacheserver_v1_errors_proto_depIdxs = []int32{ diff --git a/pkg/api/cacheserver/v1/errors.pb.validate.go b/pkg/api/cacheserver/v1/errors.pb.validate.go index febb50660b9..970d2a2d69b 100644 --- a/pkg/api/cacheserver/v1/errors.pb.validate.go +++ b/pkg/api/cacheserver/v1/errors.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: cacheserver/v1/errors.proto diff --git a/pkg/api/cacheserver/v1/errors_errors.pb.go b/pkg/api/cacheserver/v1/errors_errors.pb.go index 6b19c39ee4d..7dc573944f0 100644 --- a/pkg/api/cacheserver/v1/errors_errors.pb.go +++ b/pkg/api/cacheserver/v1/errors_errors.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 @@ -27,7 +21,7 @@ func IsOrderNotFound(err error) bool { } // 订单找不到 ,可能是订单不存在或输入的订单标识有误 -func ErrorOrderNotFound(format string, args ...any) *errors.Error { +func ErrorOrderNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_OrderNotFound.String(), fmt.Sprintf(format, args...)) } @@ -41,7 +35,7 @@ func IsOrderAlreadyExists(err error) bool { } // 订单已存在,无法创建用户 -func ErrorOrderAlreadyExists(format string, args ...any) *errors.Error { +func ErrorOrderAlreadyExists(format string, args ...interface{}) *errors.Error { return errors.New(409, ErrorReason_OrderAlreadyExists.String(), fmt.Sprintf(format, args...)) } @@ -55,6 +49,6 @@ func IsOrderCreateFailed(err error) bool { } // 创建订单失败,可能是由于服务器或其他问题导致的创建过程中的错误 -func ErrorOrderCreateFailed(format string, args ...any) *errors.Error { +func ErrorOrderCreateFailed(format string, args ...interface{}) *errors.Error { return errors.New(541, ErrorReason_OrderCreateFailed.String(), fmt.Sprintf(format, args...)) } diff --git a/pkg/api/fakeserver/v1/errors.pb.go b/pkg/api/fakeserver/v1/errors.pb.go index 4c47d9f34b8..114420a1db6 100644 --- a/pkg/api/fakeserver/v1/errors.pb.go +++ b/pkg/api/fakeserver/v1/errors.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: fakeserver/v1/errors.proto @@ -112,7 +112,7 @@ func file_fakeserver_v1_errors_proto_rawDescGZIP() []byte { } var file_fakeserver_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_fakeserver_v1_errors_proto_goTypes = []any{ +var file_fakeserver_v1_errors_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: fakeserver.v1.ErrorReason } var file_fakeserver_v1_errors_proto_depIdxs = []int32{ diff --git a/pkg/api/fakeserver/v1/errors.pb.validate.go b/pkg/api/fakeserver/v1/errors.pb.validate.go index 8a4f19da26c..75210bd7288 100644 --- a/pkg/api/fakeserver/v1/errors.pb.validate.go +++ b/pkg/api/fakeserver/v1/errors.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: fakeserver/v1/errors.proto diff --git a/pkg/api/fakeserver/v1/errors_errors.pb.go b/pkg/api/fakeserver/v1/errors_errors.pb.go index 6b19c39ee4d..7dc573944f0 100644 --- a/pkg/api/fakeserver/v1/errors_errors.pb.go +++ b/pkg/api/fakeserver/v1/errors_errors.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 @@ -27,7 +21,7 @@ func IsOrderNotFound(err error) bool { } // 订单找不到 ,可能是订单不存在或输入的订单标识有误 -func ErrorOrderNotFound(format string, args ...any) *errors.Error { +func ErrorOrderNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_OrderNotFound.String(), fmt.Sprintf(format, args...)) } @@ -41,7 +35,7 @@ func IsOrderAlreadyExists(err error) bool { } // 订单已存在,无法创建用户 -func ErrorOrderAlreadyExists(format string, args ...any) *errors.Error { +func ErrorOrderAlreadyExists(format string, args ...interface{}) *errors.Error { return errors.New(409, ErrorReason_OrderAlreadyExists.String(), fmt.Sprintf(format, args...)) } @@ -55,6 +49,6 @@ func IsOrderCreateFailed(err error) bool { } // 创建订单失败,可能是由于服务器或其他问题导致的创建过程中的错误 -func ErrorOrderCreateFailed(format string, args ...any) *errors.Error { +func ErrorOrderCreateFailed(format string, args ...interface{}) *errors.Error { return errors.New(541, ErrorReason_OrderCreateFailed.String(), fmt.Sprintf(format, args...)) } diff --git a/pkg/api/fakeserver/v1/fakeserver.pb.go b/pkg/api/fakeserver/v1/fakeserver.pb.go index c39d5ab965c..d611cdfb94c 100644 --- a/pkg/api/fakeserver/v1/fakeserver.pb.go +++ b/pkg/api/fakeserver/v1/fakeserver.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: fakeserver/v1/fakeserver.proto @@ -618,7 +618,7 @@ func file_fakeserver_v1_fakeserver_proto_rawDescGZIP() []byte { } var file_fakeserver_v1_fakeserver_proto_msgTypes = make([]protoimpl.MessageInfo, 8) -var file_fakeserver_v1_fakeserver_proto_goTypes = []any{ +var file_fakeserver_v1_fakeserver_proto_goTypes = []interface{}{ (*CreateOrderRequest)(nil), // 0: fakeserver.v1.CreateOrderRequest (*CreateOrderResponse)(nil), // 1: fakeserver.v1.CreateOrderResponse (*OrderReply)(nil), // 2: fakeserver.v1.OrderReply @@ -657,7 +657,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_fakeserver_v1_fakeserver_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateOrderRequest); i { case 0: return &v.state @@ -669,7 +669,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateOrderResponse); i { case 0: return &v.state @@ -681,7 +681,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*OrderReply); i { case 0: return &v.state @@ -693,7 +693,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteOrderRequest); i { case 0: return &v.state @@ -705,7 +705,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateOrderRequest); i { case 0: return &v.state @@ -717,7 +717,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListOrderRequest); i { case 0: return &v.state @@ -729,7 +729,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListOrderResponse); i { case 0: return &v.state @@ -741,7 +741,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { return nil } } - file_fakeserver_v1_fakeserver_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_fakeserver_v1_fakeserver_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetOrderRequest); i { case 0: return &v.state @@ -754,7 +754,7 @@ func file_fakeserver_v1_fakeserver_proto_init() { } } } - file_fakeserver_v1_fakeserver_proto_msgTypes[4].OneofWrappers = []any{} + file_fakeserver_v1_fakeserver_proto_msgTypes[4].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/api/fakeserver/v1/fakeserver.pb.gw.go b/pkg/api/fakeserver/v1/fakeserver.pb.gw.go index 4f0e061cdc2..f08d817987b 100644 --- a/pkg/api/fakeserver/v1/fakeserver.pb.gw.go +++ b/pkg/api/fakeserver/v1/fakeserver.pb.gw.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. // source: fakeserver/v1/fakeserver.proto diff --git a/pkg/api/fakeserver/v1/fakeserver.pb.validate.go b/pkg/api/fakeserver/v1/fakeserver.pb.validate.go index 39d507ae335..55d83ed3fa8 100644 --- a/pkg/api/fakeserver/v1/fakeserver.pb.validate.go +++ b/pkg/api/fakeserver/v1/fakeserver.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: fakeserver/v1/fakeserver.proto @@ -284,7 +278,7 @@ func (m *OrderReply) validate(all bool) error { // no validation rules for Quantity if all { - switch v := any(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, OrderReplyValidationError{ @@ -302,7 +296,7 @@ func (m *OrderReply) validate(all bool) error { }) } } - } else if v, ok := any(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return OrderReplyValidationError{ field: "CreatedAt", @@ -313,7 +307,7 @@ func (m *OrderReply) validate(all bool) error { } if all { - switch v := any(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, OrderReplyValidationError{ @@ -331,7 +325,7 @@ func (m *OrderReply) validate(all bool) error { }) } } - } else if v, ok := any(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return OrderReplyValidationError{ field: "UpdatedAt", @@ -770,7 +764,7 @@ func (m *ListOrderResponse) validate(all bool) error { _, _ = idx, item if all { - switch v := any(item).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListOrderResponseValidationError{ @@ -788,7 +782,7 @@ func (m *ListOrderResponse) validate(all bool) error { }) } } - } else if v, ok := any(item).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListOrderResponseValidationError{ field: fmt.Sprintf("Orders[%v]", idx), diff --git a/pkg/api/fakeserver/v1/fakeserver_grpc.pb.go b/pkg/api/fakeserver/v1/fakeserver_grpc.pb.go index f1328e9d966..7495e321dde 100644 --- a/pkg/api/fakeserver/v1/fakeserver_grpc.pb.go +++ b/pkg/api/fakeserver/v1/fakeserver_grpc.pb.go @@ -141,7 +141,7 @@ func RegisterFakeServerServer(s grpc.ServiceRegistrar, srv FakeServerServer) { s.RegisterService(&FakeServer_ServiceDesc, srv) } -func _FakeServer_CreateOrder_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _FakeServer_CreateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateOrderRequest) if err := dec(in); err != nil { return nil, err @@ -153,13 +153,13 @@ func _FakeServer_CreateOrder_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: FakeServer_CreateOrder_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FakeServerServer).CreateOrder(ctx, req.(*CreateOrderRequest)) } return interceptor(ctx, in, info, handler) } -func _FakeServer_ListOrder_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _FakeServer_ListOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListOrderRequest) if err := dec(in); err != nil { return nil, err @@ -171,13 +171,13 @@ func _FakeServer_ListOrder_Handler(srv any, ctx context.Context, dec func(any) e Server: srv, FullMethod: FakeServer_ListOrder_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FakeServerServer).ListOrder(ctx, req.(*ListOrderRequest)) } return interceptor(ctx, in, info, handler) } -func _FakeServer_GetOrder_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _FakeServer_GetOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetOrderRequest) if err := dec(in); err != nil { return nil, err @@ -189,13 +189,13 @@ func _FakeServer_GetOrder_Handler(srv any, ctx context.Context, dec func(any) er Server: srv, FullMethod: FakeServer_GetOrder_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FakeServerServer).GetOrder(ctx, req.(*GetOrderRequest)) } return interceptor(ctx, in, info, handler) } -func _FakeServer_UpdateOrder_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _FakeServer_UpdateOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateOrderRequest) if err := dec(in); err != nil { return nil, err @@ -207,13 +207,13 @@ func _FakeServer_UpdateOrder_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: FakeServer_UpdateOrder_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FakeServerServer).UpdateOrder(ctx, req.(*UpdateOrderRequest)) } return interceptor(ctx, in, info, handler) } -func _FakeServer_DeleteOrder_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _FakeServer_DeleteOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteOrderRequest) if err := dec(in); err != nil { return nil, err @@ -225,7 +225,7 @@ func _FakeServer_DeleteOrder_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: FakeServer_DeleteOrder_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(FakeServerServer).DeleteOrder(ctx, req.(*DeleteOrderRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/api/fakeserver/v1/fakeserver_http.pb.go b/pkg/api/fakeserver/v1/fakeserver_http.pb.go index e71b9dcefae..f8a77a2b319 100644 --- a/pkg/api/fakeserver/v1/fakeserver_http.pb.go +++ b/pkg/api/fakeserver/v1/fakeserver_http.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // - protoc-gen-go-http v2.7.0 @@ -59,7 +53,7 @@ func _FakeServer_CreateOrder0_HTTP_Handler(srv FakeServerHTTPServer) func(ctx ht return err } http.SetOperation(ctx, OperationFakeServerCreateOrder) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateOrder(ctx, req.(*CreateOrderRequest)) }) out, err := h(ctx, &in) @@ -78,7 +72,7 @@ func _FakeServer_ListOrder0_HTTP_Handler(srv FakeServerHTTPServer) func(ctx http return err } http.SetOperation(ctx, OperationFakeServerListOrder) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.ListOrder(ctx, req.(*ListOrderRequest)) }) out, err := h(ctx, &in) @@ -100,7 +94,7 @@ func _FakeServer_GetOrder0_HTTP_Handler(srv FakeServerHTTPServer) func(ctx http. return err } http.SetOperation(ctx, OperationFakeServerGetOrder) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetOrder(ctx, req.(*GetOrderRequest)) }) out, err := h(ctx, &in) @@ -125,7 +119,7 @@ func _FakeServer_UpdateOrder0_HTTP_Handler(srv FakeServerHTTPServer) func(ctx ht return err } http.SetOperation(ctx, OperationFakeServerUpdateOrder) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateOrder(ctx, req.(*UpdateOrderRequest)) }) out, err := h(ctx, &in) @@ -147,7 +141,7 @@ func _FakeServer_DeleteOrder0_HTTP_Handler(srv FakeServerHTTPServer) func(ctx ht return err } http.SetOperation(ctx, OperationFakeServerDeleteOrder) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteOrder(ctx, req.(*DeleteOrderRequest)) }) out, err := h(ctx, &in) diff --git a/pkg/api/gateway/v1/errors.pb.go b/pkg/api/gateway/v1/errors.pb.go index 9fd558d3a9f..6d1b5526879 100644 --- a/pkg/api/gateway/v1/errors.pb.go +++ b/pkg/api/gateway/v1/errors.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: gateway/v1/errors.proto @@ -117,7 +117,7 @@ func file_gateway_v1_errors_proto_rawDescGZIP() []byte { } var file_gateway_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_gateway_v1_errors_proto_goTypes = []any{ +var file_gateway_v1_errors_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: gateway.v1.ErrorReason } var file_gateway_v1_errors_proto_depIdxs = []int32{ diff --git a/pkg/api/gateway/v1/errors.pb.validate.go b/pkg/api/gateway/v1/errors.pb.validate.go index 5b1d684be15..8505ff3825a 100644 --- a/pkg/api/gateway/v1/errors.pb.validate.go +++ b/pkg/api/gateway/v1/errors.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: gateway/v1/errors.proto diff --git a/pkg/api/gateway/v1/errors_errors.pb.go b/pkg/api/gateway/v1/errors_errors.pb.go index 8392851cb4f..7bfe56c6f85 100644 --- a/pkg/api/gateway/v1/errors_errors.pb.go +++ b/pkg/api/gateway/v1/errors_errors.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 @@ -27,7 +21,7 @@ func IsUserLoginFailed(err error) bool { } // 用户登录失败,可能是用户名或密码不对 -func ErrorUserLoginFailed(format string, args ...any) *errors.Error { +func ErrorUserLoginFailed(format string, args ...interface{}) *errors.Error { return errors.New(401, ErrorReason_UserLoginFailed.String(), fmt.Sprintf(format, args...)) } @@ -41,7 +35,7 @@ func IsUserAlreadyExists(err error) bool { } // 用户已存在错误 -func ErrorUserAlreadyExists(format string, args ...any) *errors.Error { +func ErrorUserAlreadyExists(format string, args ...interface{}) *errors.Error { return errors.New(409, ErrorReason_UserAlreadyExists.String(), fmt.Sprintf(format, args...)) } @@ -55,7 +49,7 @@ func IsUserNotFound(err error) bool { } // 用户未找到错误 -func ErrorUserNotFound(format string, args ...any) *errors.Error { +func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_UserNotFound.String(), fmt.Sprintf(format, args...)) } @@ -69,6 +63,6 @@ func IsUserCreateFailed(err error) bool { } // 创建用户失败错误 -func ErrorUserCreateFailed(format string, args ...any) *errors.Error { +func ErrorUserCreateFailed(format string, args ...interface{}) *errors.Error { return errors.New(541, ErrorReason_UserCreateFailed.String(), fmt.Sprintf(format, args...)) } diff --git a/pkg/api/gateway/v1/gateway.pb.go b/pkg/api/gateway/v1/gateway.pb.go index bab51ce062b..95b729b919d 100644 --- a/pkg/api/gateway/v1/gateway.pb.go +++ b/pkg/api/gateway/v1/gateway.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: gateway/v1/gateway.proto @@ -1426,7 +1426,7 @@ func file_gateway_v1_gateway_proto_rawDescGZIP() []byte { } var file_gateway_v1_gateway_proto_msgTypes = make([]protoimpl.MessageInfo, 18) -var file_gateway_v1_gateway_proto_goTypes = []any{ +var file_gateway_v1_gateway_proto_goTypes = []interface{}{ (*IdempotentResponse)(nil), // 0: gateway.v1.IdempotentResponse (*GetVersionResponse)(nil), // 1: gateway.v1.GetVersionResponse (*MinerSet)(nil), // 2: gateway.v1.MinerSet @@ -1498,7 +1498,7 @@ func file_gateway_v1_gateway_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_gateway_v1_gateway_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*IdempotentResponse); i { case 0: return &v.state @@ -1510,7 +1510,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetVersionResponse); i { case 0: return &v.state @@ -1522,7 +1522,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MinerSet); i { case 0: return &v.state @@ -1534,7 +1534,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MinerTemplate); i { case 0: return &v.state @@ -1546,7 +1546,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateMinerSetRequest); i { case 0: return &v.state @@ -1558,7 +1558,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListMinerSetRequest); i { case 0: return &v.state @@ -1570,7 +1570,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListMinerSetResponse); i { case 0: return &v.state @@ -1582,7 +1582,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetMinerSetRequest); i { case 0: return &v.state @@ -1594,7 +1594,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateMinerSetRequest); i { case 0: return &v.state @@ -1606,7 +1606,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteMinerSetRequest); i { case 0: return &v.state @@ -1618,7 +1618,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ScaleMinerSetRequest); i { case 0: return &v.state @@ -1630,7 +1630,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Miner); i { case 0: return &v.state @@ -1642,7 +1642,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateMinerRequest); i { case 0: return &v.state @@ -1654,7 +1654,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListMinerRequest); i { case 0: return &v.state @@ -1666,7 +1666,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[14].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListMinerResponse); i { case 0: return &v.state @@ -1678,7 +1678,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[15].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetMinerRequest); i { case 0: return &v.state @@ -1690,7 +1690,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[16].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateMinerRequest); i { case 0: return &v.state @@ -1702,7 +1702,7 @@ func file_gateway_v1_gateway_proto_init() { return nil } } - file_gateway_v1_gateway_proto_msgTypes[17].Exporter = func(v any, i int) any { + file_gateway_v1_gateway_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteMinerRequest); i { case 0: return &v.state @@ -1715,8 +1715,8 @@ func file_gateway_v1_gateway_proto_init() { } } } - file_gateway_v1_gateway_proto_msgTypes[8].OneofWrappers = []any{} - file_gateway_v1_gateway_proto_msgTypes[16].OneofWrappers = []any{} + file_gateway_v1_gateway_proto_msgTypes[8].OneofWrappers = []interface{}{} + file_gateway_v1_gateway_proto_msgTypes[16].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/api/gateway/v1/gateway.pb.validate.go b/pkg/api/gateway/v1/gateway.pb.validate.go index 772b977de66..bf227c8b8c0 100644 --- a/pkg/api/gateway/v1/gateway.pb.validate.go +++ b/pkg/api/gateway/v1/gateway.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: gateway/v1/gateway.proto @@ -292,7 +286,7 @@ func (m *MinerSet) validate(all bool) error { // no validation rules for DeletePolicy if all { - switch v := any(m.GetMinerTemplate()).(type) { + switch v := interface{}(m.GetMinerTemplate()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, MinerSetValidationError{ @@ -310,7 +304,7 @@ func (m *MinerSet) validate(all bool) error { }) } } - } else if v, ok := any(m.GetMinerTemplate()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetMinerTemplate()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MinerSetValidationError{ field: "MinerTemplate", @@ -321,7 +315,7 @@ func (m *MinerSet) validate(all bool) error { } if all { - switch v := any(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, MinerSetValidationError{ @@ -339,7 +333,7 @@ func (m *MinerSet) validate(all bool) error { }) } } - } else if v, ok := any(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MinerSetValidationError{ field: "CreatedAt", @@ -350,7 +344,7 @@ func (m *MinerSet) validate(all bool) error { } if all { - switch v := any(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, MinerSetValidationError{ @@ -368,7 +362,7 @@ func (m *MinerSet) validate(all bool) error { }) } } - } else if v, ok := any(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MinerSetValidationError{ field: "UpdatedAt", @@ -590,7 +584,7 @@ func (m *CreateMinerSetRequest) validate(all bool) error { // no validation rules for DeletePolicy if all { - switch v := any(m.GetMinerTemplate()).(type) { + switch v := interface{}(m.GetMinerTemplate()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, CreateMinerSetRequestValidationError{ @@ -608,7 +602,7 @@ func (m *CreateMinerSetRequest) validate(all bool) error { }) } } - } else if v, ok := any(m.GetMinerTemplate()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetMinerTemplate()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CreateMinerSetRequestValidationError{ field: "MinerTemplate", @@ -832,7 +826,7 @@ func (m *ListMinerSetResponse) validate(all bool) error { _, _ = idx, item if all { - switch v := any(item).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListMinerSetResponseValidationError{ @@ -850,7 +844,7 @@ func (m *ListMinerSetResponse) validate(all bool) error { }) } } - } else if v, ok := any(item).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListMinerSetResponseValidationError{ field: fmt.Sprintf("MinerSets[%v]", idx), @@ -1402,7 +1396,7 @@ func (m *Miner) validate(all bool) error { // no validation rules for Status if all { - switch v := any(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, MinerValidationError{ @@ -1420,7 +1414,7 @@ func (m *Miner) validate(all bool) error { }) } } - } else if v, ok := any(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MinerValidationError{ field: "CreatedAt", @@ -1431,7 +1425,7 @@ func (m *Miner) validate(all bool) error { } if all { - switch v := any(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, MinerValidationError{ @@ -1449,7 +1443,7 @@ func (m *Miner) validate(all bool) error { }) } } - } else if v, ok := any(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MinerValidationError{ field: "UpdatedAt", @@ -1778,7 +1772,7 @@ func (m *ListMinerResponse) validate(all bool) error { _, _ = idx, item if all { - switch v := any(item).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListMinerResponseValidationError{ @@ -1796,7 +1790,7 @@ func (m *ListMinerResponse) validate(all bool) error { }) } } - } else if v, ok := any(item).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListMinerResponseValidationError{ field: fmt.Sprintf("Miners[%v]", idx), diff --git a/pkg/api/gateway/v1/gateway_grpc.pb.go b/pkg/api/gateway/v1/gateway_grpc.pb.go index 5f86718b96c..679bf61fbe1 100644 --- a/pkg/api/gateway/v1/gateway_grpc.pb.go +++ b/pkg/api/gateway/v1/gateway_grpc.pb.go @@ -288,7 +288,7 @@ func RegisterGatewayServer(s grpc.ServiceRegistrar, srv GatewayServer) { s.RegisterService(&Gateway_ServiceDesc, srv) } -func _Gateway_GetVersion_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err @@ -300,13 +300,13 @@ func _Gateway_GetVersion_Handler(srv any, ctx context.Context, dec func(any) err Server: srv, FullMethod: Gateway_GetVersion_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).GetVersion(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } -func _Gateway_GetIdempotentToken_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_GetIdempotentToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(emptypb.Empty) if err := dec(in); err != nil { return nil, err @@ -318,13 +318,13 @@ func _Gateway_GetIdempotentToken_Handler(srv any, ctx context.Context, dec func( Server: srv, FullMethod: Gateway_GetIdempotentToken_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).GetIdempotentToken(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } -func _Gateway_CreateMinerSet_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_CreateMinerSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(v1beta1.MinerSet) if err := dec(in); err != nil { return nil, err @@ -336,13 +336,13 @@ func _Gateway_CreateMinerSet_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: Gateway_CreateMinerSet_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).CreateMinerSet(ctx, req.(*v1beta1.MinerSet)) } return interceptor(ctx, in, info, handler) } -func _Gateway_ListMinerSet_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_ListMinerSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListMinerSetRequest) if err := dec(in); err != nil { return nil, err @@ -354,13 +354,13 @@ func _Gateway_ListMinerSet_Handler(srv any, ctx context.Context, dec func(any) e Server: srv, FullMethod: Gateway_ListMinerSet_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).ListMinerSet(ctx, req.(*ListMinerSetRequest)) } return interceptor(ctx, in, info, handler) } -func _Gateway_GetMinerSet_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_GetMinerSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetMinerSetRequest) if err := dec(in); err != nil { return nil, err @@ -372,13 +372,13 @@ func _Gateway_GetMinerSet_Handler(srv any, ctx context.Context, dec func(any) er Server: srv, FullMethod: Gateway_GetMinerSet_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).GetMinerSet(ctx, req.(*GetMinerSetRequest)) } return interceptor(ctx, in, info, handler) } -func _Gateway_UpdateMinerSet_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_UpdateMinerSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(v1beta1.MinerSet) if err := dec(in); err != nil { return nil, err @@ -390,13 +390,13 @@ func _Gateway_UpdateMinerSet_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: Gateway_UpdateMinerSet_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).UpdateMinerSet(ctx, req.(*v1beta1.MinerSet)) } return interceptor(ctx, in, info, handler) } -func _Gateway_DeleteMinerSet_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_DeleteMinerSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteMinerSetRequest) if err := dec(in); err != nil { return nil, err @@ -408,13 +408,13 @@ func _Gateway_DeleteMinerSet_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: Gateway_DeleteMinerSet_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).DeleteMinerSet(ctx, req.(*DeleteMinerSetRequest)) } return interceptor(ctx, in, info, handler) } -func _Gateway_ScaleMinerSet_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_ScaleMinerSet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ScaleMinerSetRequest) if err := dec(in); err != nil { return nil, err @@ -426,13 +426,13 @@ func _Gateway_ScaleMinerSet_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: Gateway_ScaleMinerSet_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).ScaleMinerSet(ctx, req.(*ScaleMinerSetRequest)) } return interceptor(ctx, in, info, handler) } -func _Gateway_CreateMiner_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_CreateMiner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(v1beta1.Miner) if err := dec(in); err != nil { return nil, err @@ -444,13 +444,13 @@ func _Gateway_CreateMiner_Handler(srv any, ctx context.Context, dec func(any) er Server: srv, FullMethod: Gateway_CreateMiner_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).CreateMiner(ctx, req.(*v1beta1.Miner)) } return interceptor(ctx, in, info, handler) } -func _Gateway_ListMiner_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_ListMiner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListMinerRequest) if err := dec(in); err != nil { return nil, err @@ -462,13 +462,13 @@ func _Gateway_ListMiner_Handler(srv any, ctx context.Context, dec func(any) erro Server: srv, FullMethod: Gateway_ListMiner_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).ListMiner(ctx, req.(*ListMinerRequest)) } return interceptor(ctx, in, info, handler) } -func _Gateway_GetMiner_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_GetMiner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetMinerRequest) if err := dec(in); err != nil { return nil, err @@ -480,13 +480,13 @@ func _Gateway_GetMiner_Handler(srv any, ctx context.Context, dec func(any) error Server: srv, FullMethod: Gateway_GetMiner_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).GetMiner(ctx, req.(*GetMinerRequest)) } return interceptor(ctx, in, info, handler) } -func _Gateway_UpdateMiner_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_UpdateMiner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(v1beta1.Miner) if err := dec(in); err != nil { return nil, err @@ -498,13 +498,13 @@ func _Gateway_UpdateMiner_Handler(srv any, ctx context.Context, dec func(any) er Server: srv, FullMethod: Gateway_UpdateMiner_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).UpdateMiner(ctx, req.(*v1beta1.Miner)) } return interceptor(ctx, in, info, handler) } -func _Gateway_DeleteMiner_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _Gateway_DeleteMiner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteMinerRequest) if err := dec(in); err != nil { return nil, err @@ -516,7 +516,7 @@ func _Gateway_DeleteMiner_Handler(srv any, ctx context.Context, dec func(any) er Server: srv, FullMethod: Gateway_DeleteMiner_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(GatewayServer).DeleteMiner(ctx, req.(*DeleteMinerRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/api/gateway/v1/gateway_http.pb.go b/pkg/api/gateway/v1/gateway_http.pb.go index a887f9b9c52..635f6c96a96 100644 --- a/pkg/api/gateway/v1/gateway_http.pb.go +++ b/pkg/api/gateway/v1/gateway_http.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // - protoc-gen-go-http v2.7.0 @@ -94,7 +88,7 @@ func _Gateway_GetVersion0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Cont return err } http.SetOperation(ctx, OperationGatewayGetVersion) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetVersion(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) @@ -113,7 +107,7 @@ func _Gateway_GetIdempotentToken0_HTTP_Handler(srv GatewayHTTPServer) func(ctx h return err } http.SetOperation(ctx, OperationGatewayGetIdempotentToken) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetIdempotentToken(ctx, req.(*emptypb.Empty)) }) out, err := h(ctx, &in) @@ -135,7 +129,7 @@ func _Gateway_CreateMinerSet0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http. return err } http.SetOperation(ctx, OperationGatewayCreateMinerSet) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateMinerSet(ctx, req.(*v1beta1.MinerSet)) }) out, err := h(ctx, &in) @@ -154,7 +148,7 @@ func _Gateway_ListMinerSet0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Co return err } http.SetOperation(ctx, OperationGatewayListMinerSet) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.ListMinerSet(ctx, req.(*ListMinerSetRequest)) }) out, err := h(ctx, &in) @@ -176,7 +170,7 @@ func _Gateway_GetMinerSet0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Con return err } http.SetOperation(ctx, OperationGatewayGetMinerSet) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetMinerSet(ctx, req.(*GetMinerSetRequest)) }) out, err := h(ctx, &in) @@ -198,7 +192,7 @@ func _Gateway_UpdateMinerSet0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http. return err } http.SetOperation(ctx, OperationGatewayUpdateMinerSet) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateMinerSet(ctx, req.(*v1beta1.MinerSet)) }) out, err := h(ctx, &in) @@ -220,7 +214,7 @@ func _Gateway_DeleteMinerSet0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http. return err } http.SetOperation(ctx, OperationGatewayDeleteMinerSet) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteMinerSet(ctx, req.(*DeleteMinerSetRequest)) }) out, err := h(ctx, &in) @@ -245,7 +239,7 @@ func _Gateway_ScaleMinerSet0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.C return err } http.SetOperation(ctx, OperationGatewayScaleMinerSet) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.ScaleMinerSet(ctx, req.(*ScaleMinerSetRequest)) }) out, err := h(ctx, &in) @@ -267,7 +261,7 @@ func _Gateway_CreateMiner0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Con return err } http.SetOperation(ctx, OperationGatewayCreateMiner) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateMiner(ctx, req.(*v1beta1.Miner)) }) out, err := h(ctx, &in) @@ -286,7 +280,7 @@ func _Gateway_ListMiner0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Conte return err } http.SetOperation(ctx, OperationGatewayListMiner) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.ListMiner(ctx, req.(*ListMinerRequest)) }) out, err := h(ctx, &in) @@ -308,7 +302,7 @@ func _Gateway_GetMiner0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Contex return err } http.SetOperation(ctx, OperationGatewayGetMiner) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetMiner(ctx, req.(*GetMinerRequest)) }) out, err := h(ctx, &in) @@ -330,7 +324,7 @@ func _Gateway_UpdateMiner0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Con return err } http.SetOperation(ctx, OperationGatewayUpdateMiner) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateMiner(ctx, req.(*v1beta1.Miner)) }) out, err := h(ctx, &in) @@ -352,7 +346,7 @@ func _Gateway_DeleteMiner0_HTTP_Handler(srv GatewayHTTPServer) func(ctx http.Con return err } http.SetOperation(ctx, OperationGatewayDeleteMiner) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteMiner(ctx, req.(*DeleteMinerRequest)) }) out, err := h(ctx, &in) diff --git a/pkg/api/toyblc/v1/errors.pb.go b/pkg/api/toyblc/v1/errors.pb.go index 2130e266852..08029bfea99 100644 --- a/pkg/api/toyblc/v1/errors.pb.go +++ b/pkg/api/toyblc/v1/errors.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: toyblc/v1/errors.proto @@ -99,7 +99,7 @@ func file_toyblc_v1_errors_proto_rawDescGZIP() []byte { } var file_toyblc_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_toyblc_v1_errors_proto_goTypes = []any{ +var file_toyblc_v1_errors_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: toyblc.v1.ErrorReason } var file_toyblc_v1_errors_proto_depIdxs = []int32{ diff --git a/pkg/api/toyblc/v1/errors.pb.validate.go b/pkg/api/toyblc/v1/errors.pb.validate.go index 06053012ea8..54019d88336 100644 --- a/pkg/api/toyblc/v1/errors.pb.validate.go +++ b/pkg/api/toyblc/v1/errors.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: toyblc/v1/errors.proto diff --git a/pkg/api/toyblc/v1/errors_errors.pb.go b/pkg/api/toyblc/v1/errors_errors.pb.go index 0eaa4d6aed7..1b91afb8937 100644 --- a/pkg/api/toyblc/v1/errors_errors.pb.go +++ b/pkg/api/toyblc/v1/errors_errors.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 @@ -27,6 +21,6 @@ func IsPageNotFound(err error) bool { } // 页面未找到错误,请求的页面不存在 -func ErrorPageNotFound(format string, args ...any) *errors.Error { +func ErrorPageNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_PageNotFound.String(), fmt.Sprintf(format, args...)) } diff --git a/pkg/api/toyblc/v1/toyblc.pb.go b/pkg/api/toyblc/v1/toyblc.pb.go index 367af09e2a4..c575d86054d 100644 --- a/pkg/api/toyblc/v1/toyblc.pb.go +++ b/pkg/api/toyblc/v1/toyblc.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: toyblc/v1/toyblc.proto @@ -150,7 +150,7 @@ func file_toyblc_v1_toyblc_proto_rawDescGZIP() []byte { } var file_toyblc_v1_toyblc_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_toyblc_v1_toyblc_proto_goTypes = []any{ +var file_toyblc_v1_toyblc_proto_goTypes = []interface{}{ (*CreateBlockRequest)(nil), // 0: usercenter.v1.CreateBlockRequest (*CreatePeerRequest)(nil), // 1: usercenter.v1.CreatePeerRequest } @@ -168,7 +168,7 @@ func file_toyblc_v1_toyblc_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_toyblc_v1_toyblc_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_toyblc_v1_toyblc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateBlockRequest); i { case 0: return &v.state @@ -180,7 +180,7 @@ func file_toyblc_v1_toyblc_proto_init() { return nil } } - file_toyblc_v1_toyblc_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_toyblc_v1_toyblc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatePeerRequest); i { case 0: return &v.state diff --git a/pkg/api/toyblc/v1/toyblc.pb.validate.go b/pkg/api/toyblc/v1/toyblc.pb.validate.go index f2f557bd32f..686b4de0aac 100644 --- a/pkg/api/toyblc/v1/toyblc.pb.validate.go +++ b/pkg/api/toyblc/v1/toyblc.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: toyblc/v1/toyblc.proto diff --git a/pkg/api/usercenter/v1/errors.pb.go b/pkg/api/usercenter/v1/errors.pb.go index f6073bbf3b1..77e22619481 100644 --- a/pkg/api/usercenter/v1/errors.pb.go +++ b/pkg/api/usercenter/v1/errors.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: usercenter/v1/errors.proto @@ -141,7 +141,7 @@ func file_usercenter_v1_errors_proto_rawDescGZIP() []byte { } var file_usercenter_v1_errors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_usercenter_v1_errors_proto_goTypes = []any{ +var file_usercenter_v1_errors_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: usercenter.v1.ErrorReason } var file_usercenter_v1_errors_proto_depIdxs = []int32{ diff --git a/pkg/api/usercenter/v1/errors.pb.validate.go b/pkg/api/usercenter/v1/errors.pb.validate.go index 82024e4cae5..ac27492768f 100644 --- a/pkg/api/usercenter/v1/errors.pb.validate.go +++ b/pkg/api/usercenter/v1/errors.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: usercenter/v1/errors.proto diff --git a/pkg/api/usercenter/v1/errors_errors.pb.go b/pkg/api/usercenter/v1/errors_errors.pb.go index 7bf035e4e34..e6dcb972255 100644 --- a/pkg/api/usercenter/v1/errors_errors.pb.go +++ b/pkg/api/usercenter/v1/errors_errors.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-errors. DO NOT EDIT. package v1 @@ -27,7 +21,7 @@ func IsUserLoginFailed(err error) bool { } // 用户登录失败,身份验证未通过 -func ErrorUserLoginFailed(format string, args ...any) *errors.Error { +func ErrorUserLoginFailed(format string, args ...interface{}) *errors.Error { return errors.New(401, ErrorReason_UserLoginFailed.String(), fmt.Sprintf(format, args...)) } @@ -41,7 +35,7 @@ func IsUserAlreadyExists(err error) bool { } // 用户已存在,无法创建用户 -func ErrorUserAlreadyExists(format string, args ...any) *errors.Error { +func ErrorUserAlreadyExists(format string, args ...interface{}) *errors.Error { return errors.New(409, ErrorReason_UserAlreadyExists.String(), fmt.Sprintf(format, args...)) } @@ -55,7 +49,7 @@ func IsUserNotFound(err error) bool { } // 用户未找到,可能是用户不存在或输入的用户标识有误 -func ErrorUserNotFound(format string, args ...any) *errors.Error { +func ErrorUserNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_UserNotFound.String(), fmt.Sprintf(format, args...)) } @@ -69,7 +63,7 @@ func IsUserCreateFailed(err error) bool { } // 创建用户失败,可能是由于服务器或其他问题导致的创建过程中的错误 -func ErrorUserCreateFailed(format string, args ...any) *errors.Error { +func ErrorUserCreateFailed(format string, args ...interface{}) *errors.Error { return errors.New(541, ErrorReason_UserCreateFailed.String(), fmt.Sprintf(format, args...)) } @@ -83,7 +77,7 @@ func IsUserOperationForbidden(err error) bool { } // 用户操作被禁止,可能是由于权限不足或其他安全限制导致的 -func ErrorUserOperationForbidden(format string, args ...any) *errors.Error { +func ErrorUserOperationForbidden(format string, args ...interface{}) *errors.Error { return errors.New(403, ErrorReason_UserOperationForbidden.String(), fmt.Sprintf(format, args...)) } @@ -97,7 +91,7 @@ func IsSecretReachMaxCount(err error) bool { } // 密钥达到最大数量限制,无法继续创建新密钥 -func ErrorSecretReachMaxCount(format string, args ...any) *errors.Error { +func ErrorSecretReachMaxCount(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_SecretReachMaxCount.String(), fmt.Sprintf(format, args...)) } @@ -111,7 +105,7 @@ func IsSecretNotFound(err error) bool { } // 密钥未找到,可能是由于密钥不存在或输入的密钥标识有误 -func ErrorSecretNotFound(format string, args ...any) *errors.Error { +func ErrorSecretNotFound(format string, args ...interface{}) *errors.Error { return errors.New(404, ErrorReason_SecretNotFound.String(), fmt.Sprintf(format, args...)) } @@ -125,6 +119,6 @@ func IsSecretCreateFailed(err error) bool { } // 创建密钥失败,可能是由于服务器或其他问题导致的创建过程中的错误 -func ErrorSecretCreateFailed(format string, args ...any) *errors.Error { +func ErrorSecretCreateFailed(format string, args ...interface{}) *errors.Error { return errors.New(541, ErrorReason_SecretCreateFailed.String(), fmt.Sprintf(format, args...)) } diff --git a/pkg/api/usercenter/v1/usercenter.pb.go b/pkg/api/usercenter/v1/usercenter.pb.go index cc983292cc7..2bb3ba08504 100644 --- a/pkg/api/usercenter/v1/usercenter.pb.go +++ b/pkg/api/usercenter/v1/usercenter.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: usercenter/v1/usercenter.proto @@ -1836,7 +1836,7 @@ func file_usercenter_v1_usercenter_proto_rawDescGZIP() []byte { } var file_usercenter_v1_usercenter_proto_msgTypes = make([]protoimpl.MessageInfo, 25) -var file_usercenter_v1_usercenter_proto_goTypes = []any{ +var file_usercenter_v1_usercenter_proto_goTypes = []interface{}{ (*UserReply)(nil), // 0: usercenter.v1.UserReply (*LoginRequest)(nil), // 1: usercenter.v1.LoginRequest (*LoginReply)(nil), // 2: usercenter.v1.LoginReply @@ -1919,7 +1919,7 @@ func file_usercenter_v1_usercenter_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_usercenter_v1_usercenter_proto_msgTypes[0].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserReply); i { case 0: return &v.state @@ -1931,7 +1931,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[1].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginRequest); i { case 0: return &v.state @@ -1943,7 +1943,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[2].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LoginReply); i { case 0: return &v.state @@ -1955,7 +1955,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[3].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*LogoutRequest); i { case 0: return &v.state @@ -1967,7 +1967,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[4].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RefreshTokenRequest); i { case 0: return &v.state @@ -1979,7 +1979,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[5].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetUserRequest); i { case 0: return &v.state @@ -1991,7 +1991,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[6].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteUserRequest); i { case 0: return &v.state @@ -2003,7 +2003,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[7].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateUserRequest); i { case 0: return &v.state @@ -2015,7 +2015,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[8].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListUserRequest); i { case 0: return &v.state @@ -2027,7 +2027,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[9].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListUserResponse); i { case 0: return &v.state @@ -2039,7 +2039,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[10].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateUserRequest); i { case 0: return &v.state @@ -2051,7 +2051,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[11].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePasswordRequest); i { case 0: return &v.state @@ -2063,7 +2063,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[12].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SecretReply); i { case 0: return &v.state @@ -2075,7 +2075,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[13].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSecretRequest); i { case 0: return &v.state @@ -2087,7 +2087,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[14].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteSecretRequest); i { case 0: return &v.state @@ -2099,7 +2099,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[15].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdateSecretRequest); i { case 0: return &v.state @@ -2111,7 +2111,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[16].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListSecretRequest); i { case 0: return &v.state @@ -2123,7 +2123,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[17].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ListSecretResponse); i { case 0: return &v.state @@ -2135,7 +2135,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[18].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateSecretRequest); i { case 0: return &v.state @@ -2147,7 +2147,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[19].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthenticateRequest); i { case 0: return &v.state @@ -2159,7 +2159,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[20].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthenticateResponse); i { case 0: return &v.state @@ -2171,7 +2171,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[21].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthorizeRequest); i { case 0: return &v.state @@ -2183,7 +2183,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[22].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthorizeResponse); i { case 0: return &v.state @@ -2195,7 +2195,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[23].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthRequest); i { case 0: return &v.state @@ -2207,7 +2207,7 @@ func file_usercenter_v1_usercenter_proto_init() { return nil } } - file_usercenter_v1_usercenter_proto_msgTypes[24].Exporter = func(v any, i int) any { + file_usercenter_v1_usercenter_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*AuthResponse); i { case 0: return &v.state @@ -2220,8 +2220,8 @@ func file_usercenter_v1_usercenter_proto_init() { } } } - file_usercenter_v1_usercenter_proto_msgTypes[7].OneofWrappers = []any{} - file_usercenter_v1_usercenter_proto_msgTypes[15].OneofWrappers = []any{} + file_usercenter_v1_usercenter_proto_msgTypes[7].OneofWrappers = []interface{}{} + file_usercenter_v1_usercenter_proto_msgTypes[15].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ diff --git a/pkg/api/usercenter/v1/usercenter.pb.validate.go b/pkg/api/usercenter/v1/usercenter.pb.validate.go index 03fcbbe54e9..661fdbe43b0 100644 --- a/pkg/api/usercenter/v1/usercenter.pb.validate.go +++ b/pkg/api/usercenter/v1/usercenter.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: usercenter/v1/usercenter.proto @@ -78,7 +72,7 @@ func (m *UserReply) validate(all bool) error { // no validation rules for Secrets if all { - switch v := any(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UserReplyValidationError{ @@ -96,7 +90,7 @@ func (m *UserReply) validate(all bool) error { }) } } - } else if v, ok := any(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UserReplyValidationError{ field: "CreatedAt", @@ -107,7 +101,7 @@ func (m *UserReply) validate(all bool) error { } if all { - switch v := any(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, UserReplyValidationError{ @@ -125,7 +119,7 @@ func (m *UserReply) validate(all bool) error { }) } } - } else if v, ok := any(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UserReplyValidationError{ field: "UpdatedAt", @@ -1078,7 +1072,7 @@ func (m *ListUserResponse) validate(all bool) error { _, _ = idx, item if all { - switch v := any(item).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListUserResponseValidationError{ @@ -1096,7 +1090,7 @@ func (m *ListUserResponse) validate(all bool) error { }) } } - } else if v, ok := any(item).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListUserResponseValidationError{ field: fmt.Sprintf("Users[%v]", idx), @@ -1540,7 +1534,7 @@ func (m *SecretReply) validate(all bool) error { // no validation rules for Description if all { - switch v := any(m.GetCreatedAt()).(type) { + switch v := interface{}(m.GetCreatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SecretReplyValidationError{ @@ -1558,7 +1552,7 @@ func (m *SecretReply) validate(all bool) error { }) } } - } else if v, ok := any(m.GetCreatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetCreatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretReplyValidationError{ field: "CreatedAt", @@ -1569,7 +1563,7 @@ func (m *SecretReply) validate(all bool) error { } if all { - switch v := any(m.GetUpdatedAt()).(type) { + switch v := interface{}(m.GetUpdatedAt()).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, SecretReplyValidationError{ @@ -1587,7 +1581,7 @@ func (m *SecretReply) validate(all bool) error { }) } } - } else if v, ok := any(m.GetUpdatedAt()).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(m.GetUpdatedAt()).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretReplyValidationError{ field: "UpdatedAt", @@ -2157,7 +2151,7 @@ func (m *ListSecretResponse) validate(all bool) error { _, _ = idx, item if all { - switch v := any(item).(type) { + switch v := interface{}(item).(type) { case interface{ ValidateAll() error }: if err := v.ValidateAll(); err != nil { errors = append(errors, ListSecretResponseValidationError{ @@ -2175,7 +2169,7 @@ func (m *ListSecretResponse) validate(all bool) error { }) } } - } else if v, ok := any(item).(interface{ Validate() error }); ok { + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListSecretResponseValidationError{ field: fmt.Sprintf("Secrets[%v]", idx), diff --git a/pkg/api/usercenter/v1/usercenter_grpc.pb.go b/pkg/api/usercenter/v1/usercenter_grpc.pb.go index 17bb5a6eac5..2064057fd30 100644 --- a/pkg/api/usercenter/v1/usercenter_grpc.pb.go +++ b/pkg/api/usercenter/v1/usercenter_grpc.pb.go @@ -355,7 +355,7 @@ func RegisterUserCenterServer(s grpc.ServiceRegistrar, srv UserCenterServer) { s.RegisterService(&UserCenter_ServiceDesc, srv) } -func _UserCenter_Login_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LoginRequest) if err := dec(in); err != nil { return nil, err @@ -367,13 +367,13 @@ func _UserCenter_Login_Handler(srv any, ctx context.Context, dec func(any) error Server: srv, FullMethod: UserCenter_Login_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).Login(ctx, req.(*LoginRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_Logout_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(LogoutRequest) if err := dec(in); err != nil { return nil, err @@ -385,13 +385,13 @@ func _UserCenter_Logout_Handler(srv any, ctx context.Context, dec func(any) erro Server: srv, FullMethod: UserCenter_Logout_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).Logout(ctx, req.(*LogoutRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_RefreshToken_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_RefreshToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(RefreshTokenRequest) if err := dec(in); err != nil { return nil, err @@ -403,13 +403,13 @@ func _UserCenter_RefreshToken_Handler(srv any, ctx context.Context, dec func(any Server: srv, FullMethod: UserCenter_RefreshToken_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).RefreshToken(ctx, req.(*RefreshTokenRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_Authenticate_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthenticateRequest) if err := dec(in); err != nil { return nil, err @@ -421,13 +421,13 @@ func _UserCenter_Authenticate_Handler(srv any, ctx context.Context, dec func(any Server: srv, FullMethod: UserCenter_Authenticate_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).Authenticate(ctx, req.(*AuthenticateRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_Authorize_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthorizeRequest) if err := dec(in); err != nil { return nil, err @@ -439,13 +439,13 @@ func _UserCenter_Authorize_Handler(srv any, ctx context.Context, dec func(any) e Server: srv, FullMethod: UserCenter_Authorize_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).Authorize(ctx, req.(*AuthorizeRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_Auth_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_Auth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AuthRequest) if err := dec(in); err != nil { return nil, err @@ -457,13 +457,13 @@ func _UserCenter_Auth_Handler(srv any, ctx context.Context, dec func(any) error, Server: srv, FullMethod: UserCenter_Auth_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).Auth(ctx, req.(*AuthRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_CreateUser_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateUserRequest) if err := dec(in); err != nil { return nil, err @@ -475,13 +475,13 @@ func _UserCenter_CreateUser_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: UserCenter_CreateUser_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).CreateUser(ctx, req.(*CreateUserRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_ListUser_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_ListUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListUserRequest) if err := dec(in); err != nil { return nil, err @@ -493,13 +493,13 @@ func _UserCenter_ListUser_Handler(srv any, ctx context.Context, dec func(any) er Server: srv, FullMethod: UserCenter_ListUser_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).ListUser(ctx, req.(*ListUserRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_GetUser_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetUserRequest) if err := dec(in); err != nil { return nil, err @@ -511,13 +511,13 @@ func _UserCenter_GetUser_Handler(srv any, ctx context.Context, dec func(any) err Server: srv, FullMethod: UserCenter_GetUser_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).GetUser(ctx, req.(*GetUserRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_UpdateUser_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateUserRequest) if err := dec(in); err != nil { return nil, err @@ -529,13 +529,13 @@ func _UserCenter_UpdateUser_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: UserCenter_UpdateUser_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).UpdateUser(ctx, req.(*UpdateUserRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_DeleteUser_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteUserRequest) if err := dec(in); err != nil { return nil, err @@ -547,13 +547,13 @@ func _UserCenter_DeleteUser_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: UserCenter_DeleteUser_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).DeleteUser(ctx, req.(*DeleteUserRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_UpdatePassword_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_UpdatePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdatePasswordRequest) if err := dec(in); err != nil { return nil, err @@ -565,13 +565,13 @@ func _UserCenter_UpdatePassword_Handler(srv any, ctx context.Context, dec func(a Server: srv, FullMethod: UserCenter_UpdatePassword_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).UpdatePassword(ctx, req.(*UpdatePasswordRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_CreateSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_CreateSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CreateSecretRequest) if err := dec(in); err != nil { return nil, err @@ -583,13 +583,13 @@ func _UserCenter_CreateSecret_Handler(srv any, ctx context.Context, dec func(any Server: srv, FullMethod: UserCenter_CreateSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).CreateSecret(ctx, req.(*CreateSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_ListSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_ListSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ListSecretRequest) if err := dec(in); err != nil { return nil, err @@ -601,13 +601,13 @@ func _UserCenter_ListSecret_Handler(srv any, ctx context.Context, dec func(any) Server: srv, FullMethod: UserCenter_ListSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).ListSecret(ctx, req.(*ListSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_GetSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_GetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetSecretRequest) if err := dec(in); err != nil { return nil, err @@ -619,13 +619,13 @@ func _UserCenter_GetSecret_Handler(srv any, ctx context.Context, dec func(any) e Server: srv, FullMethod: UserCenter_GetSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).GetSecret(ctx, req.(*GetSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_UpdateSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_UpdateSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(UpdateSecretRequest) if err := dec(in); err != nil { return nil, err @@ -637,13 +637,13 @@ func _UserCenter_UpdateSecret_Handler(srv any, ctx context.Context, dec func(any Server: srv, FullMethod: UserCenter_UpdateSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).UpdateSecret(ctx, req.(*UpdateSecretRequest)) } return interceptor(ctx, in, info, handler) } -func _UserCenter_DeleteSecret_Handler(srv any, ctx context.Context, dec func(any) error, interceptor grpc.UnaryServerInterceptor) (any, error) { +func _UserCenter_DeleteSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(DeleteSecretRequest) if err := dec(in); err != nil { return nil, err @@ -655,7 +655,7 @@ func _UserCenter_DeleteSecret_Handler(srv any, ctx context.Context, dec func(any Server: srv, FullMethod: UserCenter_DeleteSecret_FullMethodName, } - handler := func(ctx context.Context, req any) (any, error) { + handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(UserCenterServer).DeleteSecret(ctx, req.(*DeleteSecretRequest)) } return interceptor(ctx, in, info, handler) diff --git a/pkg/api/usercenter/v1/usercenter_http.pb.go b/pkg/api/usercenter/v1/usercenter_http.pb.go index 510cfdc4255..9ba5eb6b96f 100644 --- a/pkg/api/usercenter/v1/usercenter_http.pb.go +++ b/pkg/api/usercenter/v1/usercenter_http.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-http. DO NOT EDIT. // versions: // - protoc-gen-go-http v2.7.0 @@ -112,7 +106,7 @@ func _UserCenter_Login0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http.Con return err } http.SetOperation(ctx, OperationUserCenterLogin) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Login(ctx, req.(*LoginRequest)) }) out, err := h(ctx, &in) @@ -134,7 +128,7 @@ func _UserCenter_Logout0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http.Co return err } http.SetOperation(ctx, OperationUserCenterLogout) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Logout(ctx, req.(*LogoutRequest)) }) out, err := h(ctx, &in) @@ -156,7 +150,7 @@ func _UserCenter_RefreshToken0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx h return err } http.SetOperation(ctx, OperationUserCenterRefreshToken) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.RefreshToken(ctx, req.(*RefreshTokenRequest)) }) out, err := h(ctx, &in) @@ -178,7 +172,7 @@ func _UserCenter_Authenticate0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx h return err } http.SetOperation(ctx, OperationUserCenterAuthenticate) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Authenticate(ctx, req.(*AuthenticateRequest)) }) out, err := h(ctx, &in) @@ -200,7 +194,7 @@ func _UserCenter_Authorize0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http return err } http.SetOperation(ctx, OperationUserCenterAuthorize) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Authorize(ctx, req.(*AuthorizeRequest)) }) out, err := h(ctx, &in) @@ -222,7 +216,7 @@ func _UserCenter_Auth0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http.Cont return err } http.SetOperation(ctx, OperationUserCenterAuth) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.Auth(ctx, req.(*AuthRequest)) }) out, err := h(ctx, &in) @@ -244,7 +238,7 @@ func _UserCenter_CreateUser0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx htt return err } http.SetOperation(ctx, OperationUserCenterCreateUser) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateUser(ctx, req.(*CreateUserRequest)) }) out, err := h(ctx, &in) @@ -263,7 +257,7 @@ func _UserCenter_ListUser0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http. return err } http.SetOperation(ctx, OperationUserCenterListUser) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.ListUser(ctx, req.(*ListUserRequest)) }) out, err := h(ctx, &in) @@ -285,7 +279,7 @@ func _UserCenter_GetUser0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http.C return err } http.SetOperation(ctx, OperationUserCenterGetUser) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetUser(ctx, req.(*GetUserRequest)) }) out, err := h(ctx, &in) @@ -310,7 +304,7 @@ func _UserCenter_UpdateUser0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx htt return err } http.SetOperation(ctx, OperationUserCenterUpdateUser) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateUser(ctx, req.(*UpdateUserRequest)) }) out, err := h(ctx, &in) @@ -332,7 +326,7 @@ func _UserCenter_DeleteUser0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx htt return err } http.SetOperation(ctx, OperationUserCenterDeleteUser) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteUser(ctx, req.(*DeleteUserRequest)) }) out, err := h(ctx, &in) @@ -357,7 +351,7 @@ func _UserCenter_UpdatePassword0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx return err } http.SetOperation(ctx, OperationUserCenterUpdatePassword) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdatePassword(ctx, req.(*UpdatePasswordRequest)) }) out, err := h(ctx, &in) @@ -379,7 +373,7 @@ func _UserCenter_CreateSecret0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx h return err } http.SetOperation(ctx, OperationUserCenterCreateSecret) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.CreateSecret(ctx, req.(*CreateSecretRequest)) }) out, err := h(ctx, &in) @@ -398,7 +392,7 @@ func _UserCenter_ListSecret0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx htt return err } http.SetOperation(ctx, OperationUserCenterListSecret) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.ListSecret(ctx, req.(*ListSecretRequest)) }) out, err := h(ctx, &in) @@ -420,7 +414,7 @@ func _UserCenter_GetSecret0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx http return err } http.SetOperation(ctx, OperationUserCenterGetSecret) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.GetSecret(ctx, req.(*GetSecretRequest)) }) out, err := h(ctx, &in) @@ -445,7 +439,7 @@ func _UserCenter_UpdateSecret0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx h return err } http.SetOperation(ctx, OperationUserCenterUpdateSecret) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.UpdateSecret(ctx, req.(*UpdateSecretRequest)) }) out, err := h(ctx, &in) @@ -467,7 +461,7 @@ func _UserCenter_DeleteSecret0_HTTP_Handler(srv UserCenterHTTPServer) func(ctx h return err } http.SetOperation(ctx, OperationUserCenterDeleteSecret) - h := ctx.Middleware(func(ctx context.Context, req any) (any, error) { + h := ctx.Middleware(func(ctx context.Context, req interface{}) (interface{}, error) { return srv.DeleteSecret(ctx, req.(*DeleteSecretRequest)) }) out, err := h(ctx, &in) diff --git a/pkg/api/zerrors/zerrors.pb.go b/pkg/api/zerrors/zerrors.pb.go index fd4726d68a8..719e1f76d4b 100644 --- a/pkg/api/zerrors/zerrors.pb.go +++ b/pkg/api/zerrors/zerrors.pb.go @@ -6,7 +6,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.33.0 // protoc v4.23.4 // source: zerrors/zerrors.proto @@ -133,7 +133,7 @@ func file_zerrors_zerrors_proto_rawDescGZIP() []byte { } var file_zerrors_zerrors_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_zerrors_zerrors_proto_goTypes = []any{ +var file_zerrors_zerrors_proto_goTypes = []interface{}{ (ErrorReason)(0), // 0: zerrors.ErrorReason } var file_zerrors_zerrors_proto_depIdxs = []int32{ diff --git a/pkg/api/zerrors/zerrors.pb.validate.go b/pkg/api/zerrors/zerrors.pb.validate.go index 6e0aa5e3655..679d7aa75d8 100644 --- a/pkg/api/zerrors/zerrors.pb.validate.go +++ b/pkg/api/zerrors/zerrors.pb.validate.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-validate. DO NOT EDIT. // source: zerrors/zerrors.proto diff --git a/pkg/api/zerrors/zerrors_errors.pb.go b/pkg/api/zerrors/zerrors_errors.pb.go index 5859deb6d39..dd85a56998b 100644 --- a/pkg/api/zerrors/zerrors_errors.pb.go +++ b/pkg/api/zerrors/zerrors_errors.pb.go @@ -1,9 +1,3 @@ -// Copyright 2024 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - // Code generated by protoc-gen-go-errors. DO NOT EDIT. package zerrors @@ -27,7 +21,7 @@ func IsUnknown(err error) bool { } // 未知错误,服务器内部错误 -func ErrorUnknown(format string, args ...any) *errors.Error { +func ErrorUnknown(format string, args ...interface{}) *errors.Error { return errors.New(500, ErrorReason_Unknown.String(), fmt.Sprintf(format, args...)) } @@ -41,7 +35,7 @@ func IsInvalidParameter(err error) bool { } // 无效参数错误 -func ErrorInvalidParameter(format string, args ...any) *errors.Error { +func ErrorInvalidParameter(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_InvalidParameter.String(), fmt.Sprintf(format, args...)) } @@ -55,7 +49,7 @@ func IsNotFound(err error) bool { } // 未找到错误 -func ErrorNotFound(format string, args ...any) *errors.Error { +func ErrorNotFound(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_NotFound.String(), fmt.Sprintf(format, args...)) } @@ -69,7 +63,7 @@ func IsUnauthorized(err error) bool { } // 未经授权错误 -func ErrorUnauthorized(format string, args ...any) *errors.Error { +func ErrorUnauthorized(format string, args ...interface{}) *errors.Error { return errors.New(401, ErrorReason_Unauthorized.String(), fmt.Sprintf(format, args...)) } @@ -83,7 +77,7 @@ func IsForbidden(err error) bool { } // 禁止访问错误 -func ErrorForbidden(format string, args ...any) *errors.Error { +func ErrorForbidden(format string, args ...interface{}) *errors.Error { return errors.New(403, ErrorReason_Forbidden.String(), fmt.Sprintf(format, args...)) } @@ -97,7 +91,7 @@ func IsIdempotentMissingToken(err error) bool { } // 缺少幂等性令牌错误 -func ErrorIdempotentMissingToken(format string, args ...any) *errors.Error { +func ErrorIdempotentMissingToken(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_IdempotentMissingToken.String(), fmt.Sprintf(format, args...)) } @@ -111,6 +105,6 @@ func IsIdempotentTokenExpired(err error) bool { } // 幂等性令牌已过期错误 -func ErrorIdempotentTokenExpired(format string, args ...any) *errors.Error { +func ErrorIdempotentTokenExpired(format string, args ...interface{}) *errors.Error { return errors.New(400, ErrorReason_IdempotentTokenExpired.String(), fmt.Sprintf(format, args...)) } diff --git a/pkg/apis/apps/fuzzer/fuzzer.go b/pkg/apis/apps/fuzzer/fuzzer.go new file mode 100644 index 00000000000..8298a6b7674 --- /dev/null +++ b/pkg/apis/apps/fuzzer/fuzzer.go @@ -0,0 +1,53 @@ +/* +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 fuzzer + +import ( + fuzz "github.com/google/gofuzz" + "github.com/superproj/onex/pkg/apis/apps" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" +) + +// Funcs returns the fuzzer functions for the apps api group. +var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} { + return []interface{}{ + func(j *apps.Chain, c fuzz.Continue) { + c.FuzzNoCustom(s) // fuzz self without calling this function again + + // match defaulting + }, + func(j *apps.MinerSet, c fuzz.Continue) { + c.FuzzNoCustom(s) // fuzz self without calling this function again + + // match defaulting + if j.Spec.Selector == nil { + j.Spec.Selector = &metav1.LabelSelector{MatchLabels: j.Spec.Template.Labels} + } + if len(j.Labels) == 0 { + j.Labels = j.Spec.Template.Labels + } + + }, + func(j *apps.Miner, c fuzz.Continue) { + c.FuzzNoCustom(s) // fuzz self without calling this function again + + // match defaulting + }, + } +} diff --git a/pkg/apis/apps/install/roundtrip_test.go b/pkg/apis/apps/install/roundtrip_test.go new file mode 100644 index 00000000000..b082dc8ee64 --- /dev/null +++ b/pkg/apis/apps/install/roundtrip_test.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 install + +import ( + "testing" + + "k8s.io/apimachinery/pkg/api/apitesting/roundtrip" + + appsfuzzer "github.com/superproj/onex/pkg/apis/apps/fuzzer" +) + +func TestRoundTripTypes(t *testing.T) { + roundtrip.RoundTripTestForAPIGroup(t, Install, appsfuzzer.Funcs) + // TODO: enable protobuf generation for the sample-apiserver + // roundtrip.RoundTripProtobufTestForAPIGroup(t, Install, wardlefuzzer.Funcs) +} diff --git a/pkg/apis/apps/v1beta1/generated.pb.go b/pkg/apis/apps/v1beta1/generated.pb.go index 1bdb727a935..cf3da203e5e 100644 --- a/pkg/apis/apps/v1beta1/generated.pb.go +++ b/pkg/apis/apps/v1beta1/generated.pb.go @@ -15,11 +15,11 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" + github_com_superproj_onex_pkg_errors "github.com/superproj/onex/pkg/errors" + k8s_io_api_core_v1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - github_com_superproj_onex_pkg_errors "github.com/superproj/onex/pkg/errors" - math "math" math_bits "math/bits" reflect "reflect" @@ -27,11 +27,9 @@ import ( ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -42,13 +40,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *Chain) Reset() { *m = Chain{} } func (*Chain) ProtoMessage() {} func (*Chain) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{1} + return fileDescriptor_ced0953b0a13158a, []int{0} } - func (m *Chain) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Chain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -57,15 +53,12 @@ func (m *Chain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *Chain) XXX_Merge(src proto.Message) { xxx_messageInfo_Chain.Merge(m, src) } - func (m *Chain) XXX_Size() int { return m.Size() } - func (m *Chain) XXX_DiscardUnknown() { xxx_messageInfo_Chain.DiscardUnknown(m) } @@ -75,13 +68,11 @@ var xxx_messageInfo_Chain proto.InternalMessageInfo func (m *ChainList) Reset() { *m = ChainList{} } func (*ChainList) ProtoMessage() {} func (*ChainList) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{2} + return fileDescriptor_ced0953b0a13158a, []int{1} } - func (m *ChainList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChainList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -90,15 +81,12 @@ func (m *ChainList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *ChainList) XXX_Merge(src proto.Message) { xxx_messageInfo_ChainList.Merge(m, src) } - func (m *ChainList) XXX_Size() int { return m.Size() } - func (m *ChainList) XXX_DiscardUnknown() { xxx_messageInfo_ChainList.DiscardUnknown(m) } @@ -108,13 +96,11 @@ var xxx_messageInfo_ChainList proto.InternalMessageInfo func (m *ChainSpec) Reset() { *m = ChainSpec{} } func (*ChainSpec) ProtoMessage() {} func (*ChainSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{3} + return fileDescriptor_ced0953b0a13158a, []int{2} } - func (m *ChainSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChainSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -123,15 +109,12 @@ func (m *ChainSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *ChainSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_ChainSpec.Merge(m, src) } - func (m *ChainSpec) XXX_Size() int { return m.Size() } - func (m *ChainSpec) XXX_DiscardUnknown() { xxx_messageInfo_ChainSpec.DiscardUnknown(m) } @@ -141,13 +124,11 @@ var xxx_messageInfo_ChainSpec proto.InternalMessageInfo func (m *ChainStatus) Reset() { *m = ChainStatus{} } func (*ChainStatus) ProtoMessage() {} func (*ChainStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{4} + return fileDescriptor_ced0953b0a13158a, []int{3} } - func (m *ChainStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChainStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -156,15 +137,12 @@ func (m *ChainStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } - func (m *ChainStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_ChainStatus.Merge(m, src) } - func (m *ChainStatus) XXX_Size() int { return m.Size() } - func (m *ChainStatus) XXX_DiscardUnknown() { xxx_messageInfo_ChainStatus.DiscardUnknown(m) } @@ -174,13 +152,11 @@ var xxx_messageInfo_ChainStatus proto.InternalMessageInfo func (m *ChargeRequest) Reset() { *m = ChargeRequest{} } func (*ChargeRequest) ProtoMessage() {} func (*ChargeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{5} + return fileDescriptor_ced0953b0a13158a, []int{4} } - func (m *ChargeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChargeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -189,15 +165,12 @@ func (m *ChargeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error } return b[:n], nil } - func (m *ChargeRequest) XXX_Merge(src proto.Message) { xxx_messageInfo_ChargeRequest.Merge(m, src) } - func (m *ChargeRequest) XXX_Size() int { return m.Size() } - func (m *ChargeRequest) XXX_DiscardUnknown() { xxx_messageInfo_ChargeRequest.DiscardUnknown(m) } @@ -207,13 +180,11 @@ var xxx_messageInfo_ChargeRequest proto.InternalMessageInfo func (m *ChargeRequestList) Reset() { *m = ChargeRequestList{} } func (*ChargeRequestList) ProtoMessage() {} func (*ChargeRequestList) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{6} + return fileDescriptor_ced0953b0a13158a, []int{5} } - func (m *ChargeRequestList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChargeRequestList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -222,15 +193,12 @@ func (m *ChargeRequestList) XXX_Marshal(b []byte, deterministic bool) ([]byte, e } return b[:n], nil } - func (m *ChargeRequestList) XXX_Merge(src proto.Message) { xxx_messageInfo_ChargeRequestList.Merge(m, src) } - func (m *ChargeRequestList) XXX_Size() int { return m.Size() } - func (m *ChargeRequestList) XXX_DiscardUnknown() { xxx_messageInfo_ChargeRequestList.DiscardUnknown(m) } @@ -240,13 +208,11 @@ var xxx_messageInfo_ChargeRequestList proto.InternalMessageInfo func (m *ChargeRequestSpec) Reset() { *m = ChargeRequestSpec{} } func (*ChargeRequestSpec) ProtoMessage() {} func (*ChargeRequestSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{7} + return fileDescriptor_ced0953b0a13158a, []int{6} } - func (m *ChargeRequestSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChargeRequestSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -255,15 +221,12 @@ func (m *ChargeRequestSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, e } return b[:n], nil } - func (m *ChargeRequestSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_ChargeRequestSpec.Merge(m, src) } - func (m *ChargeRequestSpec) XXX_Size() int { return m.Size() } - func (m *ChargeRequestSpec) XXX_DiscardUnknown() { xxx_messageInfo_ChargeRequestSpec.DiscardUnknown(m) } @@ -273,13 +236,11 @@ var xxx_messageInfo_ChargeRequestSpec proto.InternalMessageInfo func (m *ChargeRequestStatus) Reset() { *m = ChargeRequestStatus{} } func (*ChargeRequestStatus) ProtoMessage() {} func (*ChargeRequestStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{8} + return fileDescriptor_ced0953b0a13158a, []int{7} } - func (m *ChargeRequestStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ChargeRequestStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -288,15 +249,12 @@ func (m *ChargeRequestStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, } return b[:n], nil } - func (m *ChargeRequestStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_ChargeRequestStatus.Merge(m, src) } - func (m *ChargeRequestStatus) XXX_Size() int { return m.Size() } - func (m *ChargeRequestStatus) XXX_DiscardUnknown() { xxx_messageInfo_ChargeRequestStatus.DiscardUnknown(m) } @@ -306,13 +264,11 @@ var xxx_messageInfo_ChargeRequestStatus proto.InternalMessageInfo func (m *Condition) Reset() { *m = Condition{} } func (*Condition) ProtoMessage() {} func (*Condition) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{9} + return fileDescriptor_ced0953b0a13158a, []int{8} } - func (m *Condition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -321,15 +277,12 @@ func (m *Condition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *Condition) XXX_Merge(src proto.Message) { xxx_messageInfo_Condition.Merge(m, src) } - func (m *Condition) XXX_Size() int { return m.Size() } - func (m *Condition) XXX_DiscardUnknown() { xxx_messageInfo_Condition.DiscardUnknown(m) } @@ -339,13 +292,11 @@ var xxx_messageInfo_Condition proto.InternalMessageInfo func (m *LocalObjectReference) Reset() { *m = LocalObjectReference{} } func (*LocalObjectReference) ProtoMessage() {} func (*LocalObjectReference) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{10} + return fileDescriptor_ced0953b0a13158a, []int{9} } - func (m *LocalObjectReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *LocalObjectReference) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -354,15 +305,12 @@ func (m *LocalObjectReference) XXX_Marshal(b []byte, deterministic bool) ([]byte } return b[:n], nil } - func (m *LocalObjectReference) XXX_Merge(src proto.Message) { xxx_messageInfo_LocalObjectReference.Merge(m, src) } - func (m *LocalObjectReference) XXX_Size() int { return m.Size() } - func (m *LocalObjectReference) XXX_DiscardUnknown() { xxx_messageInfo_LocalObjectReference.DiscardUnknown(m) } @@ -372,13 +320,11 @@ var xxx_messageInfo_LocalObjectReference proto.InternalMessageInfo func (m *Miner) Reset() { *m = Miner{} } func (*Miner) ProtoMessage() {} func (*Miner) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{11} + return fileDescriptor_ced0953b0a13158a, []int{10} } - func (m *Miner) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Miner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -387,15 +333,12 @@ func (m *Miner) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *Miner) XXX_Merge(src proto.Message) { xxx_messageInfo_Miner.Merge(m, src) } - func (m *Miner) XXX_Size() int { return m.Size() } - func (m *Miner) XXX_DiscardUnknown() { xxx_messageInfo_Miner.DiscardUnknown(m) } @@ -405,13 +348,11 @@ var xxx_messageInfo_Miner proto.InternalMessageInfo func (m *MinerAddress) Reset() { *m = MinerAddress{} } func (*MinerAddress) ProtoMessage() {} func (*MinerAddress) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{12} + return fileDescriptor_ced0953b0a13158a, []int{11} } - func (m *MinerAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -420,15 +361,12 @@ func (m *MinerAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } - func (m *MinerAddress) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerAddress.Merge(m, src) } - func (m *MinerAddress) XXX_Size() int { return m.Size() } - func (m *MinerAddress) XXX_DiscardUnknown() { xxx_messageInfo_MinerAddress.DiscardUnknown(m) } @@ -438,13 +376,11 @@ var xxx_messageInfo_MinerAddress proto.InternalMessageInfo func (m *MinerList) Reset() { *m = MinerList{} } func (*MinerList) ProtoMessage() {} func (*MinerList) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{13} + return fileDescriptor_ced0953b0a13158a, []int{12} } - func (m *MinerList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -453,15 +389,12 @@ func (m *MinerList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *MinerList) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerList.Merge(m, src) } - func (m *MinerList) XXX_Size() int { return m.Size() } - func (m *MinerList) XXX_DiscardUnknown() { xxx_messageInfo_MinerList.DiscardUnknown(m) } @@ -471,13 +404,11 @@ var xxx_messageInfo_MinerList proto.InternalMessageInfo func (m *MinerSet) Reset() { *m = MinerSet{} } func (*MinerSet) ProtoMessage() {} func (*MinerSet) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{14} + return fileDescriptor_ced0953b0a13158a, []int{13} } - func (m *MinerSet) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -486,15 +417,12 @@ func (m *MinerSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *MinerSet) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerSet.Merge(m, src) } - func (m *MinerSet) XXX_Size() int { return m.Size() } - func (m *MinerSet) XXX_DiscardUnknown() { xxx_messageInfo_MinerSet.DiscardUnknown(m) } @@ -504,13 +432,11 @@ var xxx_messageInfo_MinerSet proto.InternalMessageInfo func (m *MinerSetList) Reset() { *m = MinerSetList{} } func (*MinerSetList) ProtoMessage() {} func (*MinerSetList) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{15} + return fileDescriptor_ced0953b0a13158a, []int{14} } - func (m *MinerSetList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerSetList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -519,15 +445,12 @@ func (m *MinerSetList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } - func (m *MinerSetList) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerSetList.Merge(m, src) } - func (m *MinerSetList) XXX_Size() int { return m.Size() } - func (m *MinerSetList) XXX_DiscardUnknown() { xxx_messageInfo_MinerSetList.DiscardUnknown(m) } @@ -537,13 +460,11 @@ var xxx_messageInfo_MinerSetList proto.InternalMessageInfo func (m *MinerSetSpec) Reset() { *m = MinerSetSpec{} } func (*MinerSetSpec) ProtoMessage() {} func (*MinerSetSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{16} + return fileDescriptor_ced0953b0a13158a, []int{15} } - func (m *MinerSetSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerSetSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -552,15 +473,12 @@ func (m *MinerSetSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } - func (m *MinerSetSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerSetSpec.Merge(m, src) } - func (m *MinerSetSpec) XXX_Size() int { return m.Size() } - func (m *MinerSetSpec) XXX_DiscardUnknown() { xxx_messageInfo_MinerSetSpec.DiscardUnknown(m) } @@ -570,13 +488,11 @@ var xxx_messageInfo_MinerSetSpec proto.InternalMessageInfo func (m *MinerSetStatus) Reset() { *m = MinerSetStatus{} } func (*MinerSetStatus) ProtoMessage() {} func (*MinerSetStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{17} + return fileDescriptor_ced0953b0a13158a, []int{16} } - func (m *MinerSetStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerSetStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -585,15 +501,12 @@ func (m *MinerSetStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro } return b[:n], nil } - func (m *MinerSetStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerSetStatus.Merge(m, src) } - func (m *MinerSetStatus) XXX_Size() int { return m.Size() } - func (m *MinerSetStatus) XXX_DiscardUnknown() { xxx_messageInfo_MinerSetStatus.DiscardUnknown(m) } @@ -603,13 +516,11 @@ var xxx_messageInfo_MinerSetStatus proto.InternalMessageInfo func (m *MinerSpec) Reset() { *m = MinerSpec{} } func (*MinerSpec) ProtoMessage() {} func (*MinerSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{18} + return fileDescriptor_ced0953b0a13158a, []int{17} } - func (m *MinerSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -618,15 +529,12 @@ func (m *MinerSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *MinerSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerSpec.Merge(m, src) } - func (m *MinerSpec) XXX_Size() int { return m.Size() } - func (m *MinerSpec) XXX_DiscardUnknown() { xxx_messageInfo_MinerSpec.DiscardUnknown(m) } @@ -636,13 +544,11 @@ var xxx_messageInfo_MinerSpec proto.InternalMessageInfo func (m *MinerStatus) Reset() { *m = MinerStatus{} } func (*MinerStatus) ProtoMessage() {} func (*MinerStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{19} + return fileDescriptor_ced0953b0a13158a, []int{18} } - func (m *MinerStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -651,15 +557,12 @@ func (m *MinerStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) } return b[:n], nil } - func (m *MinerStatus) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerStatus.Merge(m, src) } - func (m *MinerStatus) XXX_Size() int { return m.Size() } - func (m *MinerStatus) XXX_DiscardUnknown() { xxx_messageInfo_MinerStatus.DiscardUnknown(m) } @@ -669,13 +572,11 @@ var xxx_messageInfo_MinerStatus proto.InternalMessageInfo func (m *MinerTemplateSpec) Reset() { *m = MinerTemplateSpec{} } func (*MinerTemplateSpec) ProtoMessage() {} func (*MinerTemplateSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{20} + return fileDescriptor_ced0953b0a13158a, []int{19} } - func (m *MinerTemplateSpec) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *MinerTemplateSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -684,15 +585,12 @@ func (m *MinerTemplateSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, e } return b[:n], nil } - func (m *MinerTemplateSpec) XXX_Merge(src proto.Message) { xxx_messageInfo_MinerTemplateSpec.Merge(m, src) } - func (m *MinerTemplateSpec) XXX_Size() int { return m.Size() } - func (m *MinerTemplateSpec) XXX_DiscardUnknown() { xxx_messageInfo_MinerTemplateSpec.DiscardUnknown(m) } @@ -702,13 +600,11 @@ var xxx_messageInfo_MinerTemplateSpec proto.InternalMessageInfo func (m *ObjectMeta) Reset() { *m = ObjectMeta{} } func (*ObjectMeta) ProtoMessage() {} func (*ObjectMeta) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{21} + return fileDescriptor_ced0953b0a13158a, []int{20} } - func (m *ObjectMeta) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *ObjectMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -717,15 +613,12 @@ func (m *ObjectMeta) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *ObjectMeta) XXX_Merge(src proto.Message) { xxx_messageInfo_ObjectMeta.Merge(m, src) } - func (m *ObjectMeta) XXX_Size() int { return m.Size() } - func (m *ObjectMeta) XXX_DiscardUnknown() { xxx_messageInfo_ObjectMeta.DiscardUnknown(m) } @@ -735,13 +628,11 @@ var xxx_messageInfo_ObjectMeta proto.InternalMessageInfo func (m *PodInfo) Reset() { *m = PodInfo{} } func (*PodInfo) ProtoMessage() {} func (*PodInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_7f36063fbe370adf, []int{22} + return fileDescriptor_ced0953b0a13158a, []int{21} } - func (m *PodInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *PodInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -750,15 +641,12 @@ func (m *PodInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { } return b[:n], nil } - func (m *PodInfo) XXX_Merge(src proto.Message) { xxx_messageInfo_PodInfo.Merge(m, src) } - func (m *PodInfo) XXX_Size() int { return m.Size() } - func (m *PodInfo) XXX_DiscardUnknown() { xxx_messageInfo_PodInfo.DiscardUnknown(m) } @@ -793,133 +681,126 @@ func init() { } func init() { - proto.RegisterFile("github.com/superproj/onex/pkg/apis/apps/v1beta1/generated.proto", fileDescriptor_7f36063fbe370adf) -} - -var fileDescriptor_7f36063fbe370adf = []byte{ - // 1952 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x73, 0x1b, 0x49, - 0x15, 0xf7, 0xe8, 0xc3, 0x1f, 0x2d, 0x3b, 0xb6, 0x7b, 0x4d, 0x22, 0x0c, 0x48, 0x46, 0x5b, 0x50, - 0x59, 0x0a, 0xa4, 0xc4, 0x64, 0xb7, 0x9c, 0x2c, 0xec, 0xae, 0x14, 0xc7, 0x29, 0x2f, 0x36, 0x51, - 0xb5, 0xe3, 0x3d, 0xc0, 0xc2, 0xd2, 0x9e, 0x69, 0x49, 0xb3, 0x1e, 0x4d, 0x0f, 0xdd, 0x2d, 0x51, - 0x82, 0x0b, 0x55, 0x5b, 0x70, 0xe0, 0xc4, 0x91, 0xe2, 0x7f, 0xe0, 0xc2, 0x01, 0xfe, 0x02, 0xa8, - 0x1c, 0x38, 0xec, 0x89, 0xda, 0x93, 0x8a, 0x88, 0x1b, 0x47, 0x4e, 0x94, 0x0f, 0x14, 0xd5, 0x3d, - 0x3d, 0x9f, 0x92, 0x82, 0xa5, 0xac, 0x5d, 0x95, 0x9b, 0xa6, 0xdf, 0x7b, 0xbf, 0xd7, 0xaf, 0xfb, - 0xbd, 0x5f, 0xbf, 0x6e, 0x81, 0x77, 0xdb, 0xb6, 0xe8, 0xf4, 0xce, 0xaa, 0x26, 0xed, 0xd6, 0x78, - 0xcf, 0x23, 0xcc, 0x63, 0xf4, 0xe3, 0xda, 0xcf, 0x09, 0xa3, 0x35, 0xef, 0xbc, 0x5d, 0xc3, 0x9e, - 0xcd, 0x6b, 0xd8, 0xf3, 0x78, 0xad, 0x7f, 0xf7, 0x8c, 0x08, 0x7c, 0xb7, 0xd6, 0x26, 0x2e, 0x61, - 0x58, 0x10, 0xab, 0xea, 0x31, 0x2a, 0x28, 0xac, 0x45, 0x00, 0xd5, 0x10, 0xa0, 0x2a, 0x01, 0xaa, - 0xde, 0x79, 0xbb, 0x2a, 0x01, 0xaa, 0x12, 0xa0, 0xaa, 0x01, 0xb6, 0xbf, 0x15, 0xf3, 0xd8, 0xa6, - 0x6d, 0x5a, 0x53, 0x38, 0x67, 0xbd, 0x96, 0xfa, 0x52, 0x1f, 0xea, 0x97, 0x8f, 0xbf, 0x7d, 0xef, - 0x7c, 0x8f, 0x57, 0x6d, 0x2a, 0x67, 0xd2, 0xc5, 0x66, 0xc7, 0x76, 0x09, 0x1b, 0x44, 0x53, 0xeb, - 0x12, 0x81, 0x6b, 0xfd, 0xb1, 0x59, 0x6d, 0xd7, 0xa6, 0x59, 0xb1, 0x9e, 0x2b, 0xec, 0x2e, 0x19, - 0x33, 0x78, 0xeb, 0xff, 0x19, 0x70, 0xb3, 0x43, 0xba, 0x38, 0x6d, 0x57, 0xf9, 0x77, 0x06, 0xac, - 0x3f, 0x39, 0xfb, 0x98, 0x98, 0x02, 0x91, 0x16, 0x61, 0xc4, 0x35, 0x09, 0xdc, 0x01, 0xb9, 0x73, - 0xdb, 0xb5, 0x8a, 0xc6, 0x8e, 0x71, 0x7b, 0xa5, 0xb1, 0xfa, 0x6c, 0x58, 0x5e, 0x18, 0x0d, 0xcb, - 0xb9, 0xef, 0xd9, 0xae, 0x85, 0x94, 0x04, 0xd6, 0xc0, 0x8a, 0x8b, 0xbb, 0x84, 0x7b, 0xd8, 0x24, - 0xc5, 0x8c, 0x52, 0xdb, 0xd4, 0x6a, 0x2b, 0xdf, 0x0f, 0x04, 0x28, 0xd2, 0x91, 0x90, 0xf2, 0xa3, - 0x98, 0x4d, 0x42, 0x4a, 0x5d, 0xa4, 0x24, 0xb0, 0x01, 0xb2, 0x3d, 0xdb, 0x2a, 0xe6, 0x94, 0xc2, - 0x1d, 0xad, 0x90, 0x3d, 0x3d, 0xdc, 0xbf, 0x18, 0x96, 0xbf, 0x3a, 0x2d, 0x38, 0x31, 0xf0, 0x08, - 0xaf, 0x9e, 0x1e, 0xee, 0x23, 0x69, 0x0c, 0x77, 0x01, 0xc0, 0x9e, 0xfd, 0x01, 0x61, 0xdc, 0xa6, - 0x6e, 0x31, 0xaf, 0xa0, 0xa0, 0x86, 0x02, 0xf5, 0xe6, 0xa1, 0x96, 0xa0, 0x98, 0x16, 0xac, 0x83, - 0x75, 0x46, 0x38, 0xed, 0x31, 0x93, 0x04, 0x86, 0x8b, 0xca, 0xf0, 0x96, 0x36, 0x5c, 0x47, 0x49, - 0x31, 0x4a, 0xeb, 0xcb, 0xd5, 0x68, 0xd9, 0xc4, 0xb1, 0x9a, 0x58, 0x74, 0x8a, 0x4b, 0xc9, 0xd5, - 0x38, 0x08, 0x04, 0x28, 0xd2, 0xa9, 0xfc, 0x21, 0x03, 0xf2, 0x0f, 0x3b, 0xd8, 0x76, 0xe1, 0x4f, - 0xc0, 0xb2, 0x4c, 0x01, 0x0b, 0x0b, 0xac, 0x96, 0xbb, 0xb0, 0x7b, 0xa7, 0xea, 0x07, 0x5b, 0x8d, - 0x07, 0x1b, 0xa5, 0xa2, 0xd4, 0xae, 0xf6, 0xef, 0x56, 0xfd, 0x3d, 0x3b, 0x26, 0x02, 0x47, 0x11, - 0x46, 0x63, 0x28, 0x44, 0x85, 0x1f, 0x82, 0x1c, 0xf7, 0x88, 0xa9, 0x76, 0xa9, 0xb0, 0xfb, 0xa0, - 0x3a, 0x63, 0xba, 0x57, 0xd5, 0x3c, 0x4f, 0x3c, 0x62, 0x46, 0xbb, 0x26, 0xbf, 0x90, 0x42, 0x85, - 0x16, 0x58, 0xe4, 0x02, 0x8b, 0x1e, 0x57, 0x3b, 0x5b, 0xd8, 0xfd, 0xce, 0x9c, 0xf8, 0x0a, 0xa3, - 0x71, 0x43, 0x7b, 0x58, 0xf4, 0xbf, 0x91, 0xc6, 0xae, 0xfc, 0xd5, 0x00, 0x2b, 0x4a, 0xef, 0xc8, - 0xe6, 0x02, 0x7e, 0x38, 0xb6, 0x66, 0xd5, 0xcb, 0xad, 0x99, 0xb4, 0x56, 0x2b, 0xb6, 0xa1, 0xfd, - 0x2c, 0x07, 0x23, 0xb1, 0xf5, 0xfa, 0x21, 0xc8, 0xdb, 0x82, 0x74, 0x79, 0x31, 0xb3, 0x93, 0xbd, - 0x5d, 0xd8, 0x7d, 0x6b, 0xbe, 0x80, 0x1a, 0x6b, 0xda, 0x45, 0xfe, 0x50, 0x82, 0x21, 0x1f, 0xb3, - 0xf2, 0xc7, 0x8c, 0x0e, 0x44, 0x2e, 0x21, 0x7c, 0x13, 0x14, 0x2c, 0x9b, 0x7b, 0x0e, 0x1e, 0xc8, - 0x3a, 0xd0, 0xe5, 0xf6, 0x9a, 0x36, 0x2c, 0xec, 0x47, 0x22, 0x14, 0xd7, 0x93, 0xe9, 0xd6, 0x95, - 0x11, 0x3e, 0x1d, 0x78, 0x63, 0xc5, 0x77, 0x1c, 0x08, 0x50, 0xa4, 0x03, 0x5f, 0x07, 0x79, 0xbb, - 0x8b, 0xdb, 0x41, 0xf5, 0x45, 0x53, 0x93, 0x83, 0xc8, 0x97, 0xc1, 0x0f, 0xc0, 0xcd, 0xae, 0xed, - 0x4a, 0xfb, 0x43, 0x57, 0x10, 0xd6, 0xc7, 0xce, 0x09, 0x31, 0xa9, 0x6b, 0x71, 0x55, 0x92, 0xf9, - 0x46, 0x49, 0x5b, 0xdd, 0x3c, 0x9e, 0xa8, 0x85, 0xa6, 0x58, 0xc3, 0xf7, 0xc0, 0xc6, 0x19, 0xa5, - 0x82, 0x0b, 0x86, 0xbd, 0xba, 0x69, 0xd2, 0x9e, 0x2b, 0x74, 0x65, 0x6e, 0x8d, 0x86, 0xe5, 0x8d, - 0x46, 0x4a, 0x86, 0xc6, 0xb4, 0x2b, 0x7f, 0xce, 0x82, 0x42, 0x2c, 0x4b, 0xe0, 0x2f, 0xc0, 0xaa, - 0x49, 0xdd, 0x96, 0xdd, 0x3e, 0xc6, 0x1e, 0x22, 0x2d, 0x9d, 0x03, 0x8f, 0x66, 0xde, 0xa8, 0x23, - 0x6a, 0x62, 0x27, 0xc5, 0x7d, 0x8d, 0x8d, 0xd1, 0xb0, 0xbc, 0xfa, 0x30, 0x06, 0x8f, 0x12, 0xce, - 0x20, 0x05, 0xcb, 0x6a, 0x61, 0xa5, 0xe3, 0xcc, 0xe7, 0xe9, 0x78, 0x55, 0xe6, 0xe3, 0xb1, 0x86, - 0x46, 0xa1, 0x13, 0xf8, 0x3e, 0x80, 0xf4, 0x8c, 0x13, 0xd6, 0x27, 0xd6, 0x63, 0x9f, 0xbb, 0x25, - 0x45, 0xc9, 0x9d, 0xcc, 0x36, 0xb6, 0xf5, 0x9e, 0xc0, 0x27, 0x63, 0x1a, 0x68, 0x82, 0x15, 0x74, - 0x01, 0x90, 0x9b, 0x62, 0xcb, 0x0f, 0xb9, 0xaf, 0xd9, 0xf9, 0x18, 0x21, 0x80, 0x88, 0x98, 0x27, - 0x1c, 0xe2, 0x28, 0xe6, 0xa1, 0xf2, 0x97, 0x0c, 0x58, 0x7b, 0xd8, 0xc1, 0xac, 0x4d, 0x10, 0xf9, - 0x69, 0x8f, 0x70, 0x71, 0x0d, 0x7c, 0x67, 0x25, 0xf8, 0xae, 0x31, 0x4f, 0xf9, 0x46, 0xf3, 0x9d, - 0xca, 0x7b, 0x4e, 0x8a, 0xf7, 0xf6, 0x5f, 0xd2, 0xcf, 0x8b, 0xf9, 0xef, 0xef, 0x06, 0xd8, 0x4c, - 0xe8, 0x5f, 0x03, 0x0f, 0x9a, 0x49, 0x1e, 0x7c, 0xe7, 0xe5, 0x02, 0x9c, 0xc2, 0x87, 0x66, 0x2a, - 0x2e, 0x45, 0x8b, 0x3b, 0x20, 0xd7, 0x62, 0xb4, 0x9b, 0x6e, 0x3f, 0x0e, 0x18, 0xed, 0x22, 0x25, - 0x81, 0xdf, 0x04, 0xcb, 0x1e, 0xe6, 0xfc, 0x67, 0x94, 0x59, 0x9a, 0x00, 0xc3, 0x48, 0x9a, 0x7a, - 0x1c, 0x85, 0x1a, 0x95, 0x5f, 0x19, 0xe0, 0xb5, 0x09, 0xab, 0x9d, 0xaa, 0x06, 0xe3, 0xca, 0xab, - 0xe1, 0xf7, 0x59, 0xb0, 0x12, 0x8a, 0xe0, 0x5d, 0x90, 0x93, 0xdd, 0x8b, 0x8e, 0xf2, 0x2b, 0x41, - 0x94, 0x92, 0xb0, 0x2f, 0x86, 0xe5, 0xb5, 0x50, 0x51, 0x91, 0xb9, 0x52, 0x85, 0x47, 0x61, 0xd2, - 0xf9, 0x41, 0xdf, 0x4b, 0xa6, 0xcb, 0xc5, 0xb0, 0x5c, 0x89, 0x1a, 0xa5, 0x9a, 0x49, 0x19, 0xa9, - 0xf5, 0x63, 0x13, 0x4c, 0x26, 0x15, 0xac, 0x83, 0x65, 0x4e, 0xfa, 0x84, 0xd9, 0x62, 0xa0, 0x0f, - 0x86, 0xaf, 0x05, 0x8b, 0x78, 0xa2, 0xc7, 0x2f, 0x86, 0xe5, 0xcd, 0xc8, 0x5c, 0x0f, 0xa2, 0xd0, - 0x0c, 0xf6, 0x01, 0x74, 0x30, 0x17, 0x4f, 0x19, 0x76, 0xb9, 0x3f, 0x59, 0xbb, 0x4b, 0xd4, 0x79, - 0x51, 0xd8, 0xfd, 0xc6, 0xe5, 0x72, 0x51, 0x5a, 0x44, 0x3c, 0x76, 0x34, 0x86, 0x86, 0x26, 0x78, - 0x80, 0x5f, 0x07, 0x8b, 0x8c, 0x60, 0x1e, 0xf6, 0x78, 0x61, 0xdd, 0x20, 0x35, 0x8a, 0xb4, 0x14, - 0xbe, 0x01, 0x96, 0xba, 0x84, 0x73, 0x79, 0xf4, 0xf9, 0x3d, 0xdd, 0xba, 0x56, 0x5c, 0x3a, 0xf6, - 0x87, 0x51, 0x20, 0xaf, 0xec, 0x81, 0xad, 0x49, 0xb4, 0x1c, 0x36, 0xae, 0xc6, 0xb4, 0xc6, 0x55, - 0x35, 0x73, 0x8a, 0xb7, 0x5f, 0x81, 0x66, 0x4e, 0xcd, 0xf3, 0x0a, 0x9b, 0x39, 0x1f, 0xff, 0xc5, - 0x64, 0x46, 0xc1, 0xaa, 0x52, 0xab, 0x5b, 0x16, 0x23, 0x9c, 0xc3, 0x7b, 0x89, 0x42, 0xd8, 0x49, - 0x15, 0xc2, 0x46, 0x5c, 0x37, 0x56, 0x0b, 0x6f, 0x80, 0x25, 0xec, 0x0f, 0xea, 0x62, 0x08, 0xb7, - 0x56, 0xeb, 0xa2, 0x40, 0xae, 0xba, 0x47, 0x85, 0xf2, 0x2a, 0x74, 0x8f, 0x6a, 0xa2, 0x53, 0xd8, - 0xf2, 0x4f, 0x19, 0xe0, 0x77, 0x08, 0x27, 0xe4, 0x3a, 0x4e, 0xd2, 0x8f, 0x12, 0xc9, 0xf6, 0xdd, - 0x39, 0x93, 0x81, 0x4c, 0x3f, 0x44, 0xdb, 0xa9, 0x7c, 0x7b, 0x77, 0x7e, 0x17, 0x2f, 0x4e, 0xb9, - 0xbf, 0x19, 0x3a, 0xe7, 0x4e, 0xc8, 0x75, 0x1c, 0x9d, 0x3f, 0x4e, 0x26, 0xc1, 0xfd, 0xb9, 0xc3, - 0x9a, 0x92, 0x07, 0xbf, 0xcb, 0x45, 0xe1, 0xa8, 0x13, 0xf3, 0x36, 0x58, 0x66, 0xc4, 0x73, 0x6c, - 0x13, 0x73, 0x15, 0x4e, 0xde, 0xef, 0x26, 0x91, 0x1e, 0x43, 0xa1, 0x14, 0x62, 0x49, 0xfa, 0x0e, - 0x31, 0x05, 0x65, 0x7a, 0x5f, 0xbf, 0x7d, 0xc9, 0xc0, 0xf1, 0x19, 0x71, 0x4e, 0xb4, 0x69, 0x14, - 0x7d, 0x30, 0x82, 0x42, 0x58, 0xe8, 0x81, 0x65, 0x41, 0xba, 0x9e, 0x83, 0x05, 0xd1, 0xfb, 0xda, - 0x98, 0x6f, 0x01, 0x9e, 0x6a, 0x14, 0x95, 0x3f, 0xa1, 0xc7, 0x60, 0x14, 0x85, 0x5e, 0xd2, 0xf7, - 0xa8, 0xdc, 0x25, 0xef, 0x51, 0x7b, 0x60, 0xd5, 0x22, 0x0e, 0x11, 0xa4, 0x49, 0x1d, 0xdb, 0x1c, - 0x04, 0xb7, 0x12, 0x6d, 0xb7, 0xba, 0x1f, 0x93, 0xa1, 0x84, 0x26, 0xac, 0x83, 0xf5, 0xae, 0xed, - 0x22, 0x82, 0xad, 0x41, 0x70, 0x49, 0x5a, 0x54, 0xcb, 0x1e, 0xbe, 0x19, 0x1c, 0x27, 0xc5, 0x28, - 0xad, 0x0f, 0x4f, 0xc1, 0x2d, 0x8f, 0xd1, 0xb6, 0x24, 0xa8, 0x7d, 0x82, 0x2d, 0xc7, 0x76, 0x49, - 0x00, 0xb5, 0xa4, 0xa0, 0xbe, 0x34, 0x1a, 0x96, 0x6f, 0x35, 0x27, 0xab, 0xa0, 0x69, 0xb6, 0x95, - 0x4f, 0xf2, 0xe0, 0x46, 0xb2, 0x28, 0x64, 0xb3, 0x94, 0x4a, 0x8e, 0x70, 0x2d, 0x27, 0x24, 0x48, - 0x13, 0x6c, 0xb5, 0x7a, 0x8e, 0x33, 0x50, 0xfb, 0x4d, 0xac, 0x40, 0x43, 0x25, 0x4b, 0xbe, 0xf1, - 0x65, 0x6d, 0xb9, 0x75, 0x30, 0x41, 0x07, 0x4d, 0xb4, 0x84, 0x6f, 0x83, 0x35, 0x26, 0x23, 0x0f, - 0xa1, 0xb2, 0x0a, 0xea, 0x0b, 0x1a, 0x6a, 0x0d, 0xc5, 0x85, 0x28, 0xa9, 0x0b, 0x1f, 0x83, 0x4d, - 0xdc, 0xc7, 0xb6, 0x83, 0xcf, 0x1c, 0x12, 0x02, 0xf8, 0x17, 0xd2, 0x2f, 0x6a, 0x80, 0xcd, 0x7a, - 0x5a, 0x01, 0x8d, 0xdb, 0x4c, 0xb9, 0x46, 0xe5, 0xe7, 0xba, 0x46, 0x71, 0xb0, 0xd6, 0xc2, 0xb6, - 0xd3, 0x63, 0xc4, 0xef, 0x37, 0x74, 0x73, 0x71, 0x2c, 0xa3, 0x39, 0x88, 0x0b, 0x2e, 0x86, 0xe5, - 0xbd, 0x17, 0xbf, 0x4f, 0x12, 0xc6, 0x28, 0xe3, 0x29, 0x1e, 0x7b, 0x24, 0x07, 0x51, 0xd2, 0x07, - 0x7c, 0x00, 0x6e, 0xe8, 0x01, 0xdd, 0xbb, 0xe8, 0x97, 0x26, 0x38, 0x1a, 0x96, 0x6f, 0x1c, 0x24, - 0x24, 0x28, 0xa5, 0x99, 0xea, 0x74, 0x97, 0xaf, 0xbc, 0xd3, 0xfd, 0x57, 0x56, 0x9f, 0xb8, 0x8a, - 0x9d, 0xce, 0xc7, 0xc8, 0xf6, 0xed, 0x99, 0x7d, 0x5f, 0xfa, 0xd0, 0x4a, 0x71, 0x41, 0x66, 0x9e, - 0x37, 0x95, 0xec, 0x25, 0xde, 0x54, 0x6a, 0x60, 0xc5, 0xec, 0x60, 0xdb, 0x55, 0x5e, 0xf2, 0x49, - 0x83, 0x87, 0x81, 0x00, 0x45, 0x3a, 0xf0, 0x23, 0x59, 0x06, 0x5c, 0x60, 0x26, 0x34, 0xdd, 0xf8, - 0x49, 0x73, 0x3f, 0x2a, 0x83, 0x98, 0xf0, 0x62, 0x58, 0xde, 0x99, 0xd0, 0xca, 0x27, 0x74, 0x50, - 0x12, 0x4f, 0x36, 0xe3, 0x1e, 0xb5, 0x14, 0x6b, 0xe9, 0x3e, 0x99, 0xf6, 0x84, 0x4a, 0x92, 0x4b, - 0x9f, 0x6e, 0xfb, 0x3d, 0x3f, 0xc3, 0x1b, 0x37, 0x65, 0x35, 0x34, 0xc7, 0xd0, 0xd0, 0x04, 0x0f, - 0x95, 0xff, 0xe4, 0x41, 0x21, 0xd6, 0xf7, 0xc1, 0xdf, 0x18, 0x60, 0xd1, 0xa3, 0x56, 0xf4, 0x32, - 0xf3, 0xde, 0x9c, 0xbb, 0x1d, 0xbd, 0x8d, 0xdc, 0x91, 0x67, 0x7a, 0x53, 0x61, 0x4e, 0xb9, 0xe4, - 0xa4, 0x2c, 0x90, 0x9e, 0x01, 0xfc, 0x11, 0x28, 0xc8, 0xfb, 0xc3, 0xa9, 0x67, 0x61, 0x41, 0x2c, - 0x7d, 0xe4, 0xcd, 0x72, 0x35, 0x59, 0x97, 0x69, 0x73, 0x14, 0x41, 0xa0, 0x38, 0x1e, 0xf4, 0xd2, - 0x4c, 0xe0, 0xa7, 0xce, 0xfb, 0x93, 0x98, 0xe0, 0xcd, 0x19, 0x98, 0x60, 0x16, 0x1a, 0xc8, 0xcd, - 0x40, 0x03, 0x2b, 0xba, 0x27, 0x26, 0xbc, 0x98, 0x57, 0x2c, 0x30, 0x67, 0x57, 0xa7, 0x7b, 0xec, - 0x28, 0xe5, 0xeb, 0x01, 0x2e, 0x8a, 0x5c, 0xc0, 0xd7, 0x41, 0xde, 0xeb, 0x60, 0x1e, 0x5c, 0xbe, - 0xc2, 0x66, 0xa6, 0x29, 0x07, 0x91, 0x2f, 0x9b, 0x42, 0xcc, 0x4b, 0x9f, 0xc3, 0xfb, 0xd6, 0xd5, - 0xf3, 0xdc, 0xd0, 0x00, 0x9b, 0x63, 0xad, 0xca, 0xf5, 0xf2, 0xdd, 0x95, 0xde, 0x08, 0x2b, 0xff, - 0xcd, 0x80, 0x98, 0x5b, 0x48, 0xc1, 0xa2, 0x23, 0x4f, 0xf7, 0xe0, 0xb5, 0xe4, 0xf1, 0x4b, 0xc4, - 0xe5, 0x77, 0x94, 0xfc, 0x91, 0x2b, 0xd8, 0x20, 0x6a, 0xdc, 0xfd, 0x41, 0xa4, 0xdd, 0xc0, 0x4f, - 0x0c, 0x50, 0xc0, 0xae, 0x4b, 0x05, 0xf6, 0xb7, 0xd4, 0x6f, 0xa8, 0x8f, 0x5e, 0xc6, 0x6d, 0x3d, - 0x82, 0xf3, 0x7d, 0x87, 0x87, 0x43, 0x4c, 0x82, 0xe2, 0x5e, 0xb7, 0xef, 0x83, 0x42, 0x6c, 0xb2, - 0x70, 0x03, 0x64, 0xcf, 0xc9, 0xc0, 0xbf, 0xaf, 0x22, 0xf9, 0x13, 0x6e, 0x81, 0x7c, 0x1f, 0x3b, - 0x3d, 0x7d, 0xdc, 0x20, 0xff, 0xe3, 0x41, 0x66, 0xcf, 0xd8, 0x7e, 0x07, 0x6c, 0xa4, 0x1d, 0xce, - 0x62, 0x5f, 0xf9, 0xb5, 0x01, 0x96, 0x9a, 0xd4, 0x3a, 0x74, 0x5b, 0x54, 0x76, 0x9d, 0xd4, 0x53, - 0xa9, 0xee, 0xb6, 0x4f, 0x06, 0x5c, 0x90, 0x6e, 0x71, 0x25, 0xf9, 0x4f, 0xd5, 0x93, 0xa4, 0x18, - 0xa5, 0xf5, 0x65, 0xcb, 0x8b, 0x99, 0xd9, 0xb1, 0x05, 0x31, 0x45, 0x8f, 0x91, 0x22, 0x48, 0xb6, - 0xbc, 0xf5, 0x98, 0x0c, 0x25, 0x34, 0x1b, 0xa7, 0xcf, 0x9e, 0x97, 0x16, 0x3e, 0x7d, 0x5e, 0x5a, - 0xf8, 0xec, 0x79, 0x69, 0xe1, 0x97, 0xa3, 0x92, 0xf1, 0x6c, 0x54, 0x32, 0x3e, 0x1d, 0x95, 0x8c, - 0xcf, 0x46, 0x25, 0xe3, 0x1f, 0xa3, 0x92, 0xf1, 0xdb, 0x7f, 0x96, 0x16, 0x7e, 0x50, 0x9b, 0xf1, - 0xdf, 0xd8, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x85, 0xc1, 0x43, 0xc9, 0xbf, 0x1d, 0x00, 0x00, + proto.RegisterFile("github.com/superproj/onex/pkg/apis/apps/v1beta1/generated.proto", fileDescriptor_ced0953b0a13158a) +} + +var fileDescriptor_ced0953b0a13158a = []byte{ + // 1831 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0x4f, 0x73, 0x1b, 0x49, + 0x15, 0xf7, 0x48, 0x96, 0x6d, 0xb5, 0xec, 0xc4, 0xee, 0x35, 0x89, 0x30, 0x20, 0xb9, 0x94, 0x82, + 0xca, 0x52, 0x30, 0xda, 0x84, 0xec, 0x96, 0x93, 0x85, 0x5d, 0x3c, 0x71, 0x92, 0xca, 0x96, 0x45, + 0x54, 0xed, 0x84, 0x03, 0x2c, 0x2c, 0xad, 0x99, 0x96, 0x34, 0xeb, 0x99, 0xe9, 0x61, 0xba, 0x25, + 0x50, 0x71, 0xa1, 0x6a, 0x0b, 0xce, 0x1c, 0x29, 0xbe, 0x03, 0x17, 0x0e, 0xf0, 0x09, 0xa0, 0x72, + 0xe0, 0xb0, 0x27, 0x6a, 0x8b, 0x83, 0x8a, 0x88, 0x1b, 0x1f, 0xc1, 0x07, 0x8a, 0xea, 0x9e, 0x9e, + 0xbf, 0x92, 0x82, 0x25, 0xaf, 0x5d, 0xb5, 0x37, 0xab, 0xdf, 0x7b, 0xbf, 0xd7, 0xaf, 0xfb, 0xbd, + 0xdf, 0x7b, 0x3d, 0x06, 0xef, 0xf7, 0x6c, 0xde, 0x1f, 0x74, 0x74, 0x93, 0xba, 0x4d, 0x36, 0xf0, + 0x49, 0xe0, 0x07, 0xf4, 0xe3, 0x26, 0xf5, 0xc8, 0x2f, 0x9b, 0xfe, 0x69, 0xaf, 0x89, 0x7d, 0x9b, + 0x35, 0xb1, 0xef, 0xb3, 0xe6, 0xf0, 0x4e, 0x87, 0x70, 0x7c, 0xa7, 0xd9, 0x23, 0x1e, 0x09, 0x30, + 0x27, 0x96, 0xee, 0x07, 0x94, 0x53, 0xd8, 0x4c, 0x00, 0xf4, 0x18, 0x40, 0x17, 0x00, 0xba, 0x7f, + 0xda, 0xd3, 0x05, 0x80, 0x2e, 0x00, 0x74, 0x05, 0xb0, 0xf7, 0xed, 0x94, 0xc7, 0x1e, 0xed, 0xd1, + 0xa6, 0xc4, 0xe9, 0x0c, 0xba, 0xf2, 0x97, 0xfc, 0x21, 0xff, 0x0a, 0xf1, 0xf7, 0x1a, 0xa7, 0x07, + 0x4c, 0xb7, 0xa9, 0xd8, 0x49, 0xd3, 0xa4, 0x01, 0x69, 0x0e, 0xa7, 0xf6, 0xb0, 0x77, 0x2f, 0xd1, + 0x71, 0xb1, 0xd9, 0xb7, 0x3d, 0x12, 0x8c, 0x92, 0xed, 0xbb, 0x84, 0xe3, 0x59, 0x56, 0xcd, 0x79, + 0x56, 0xc1, 0xc0, 0xe3, 0xb6, 0x4b, 0xa6, 0x0c, 0xde, 0xf9, 0x7f, 0x06, 0xcc, 0xec, 0x13, 0x17, + 0xe7, 0xed, 0x1a, 0x7f, 0x2c, 0x80, 0xd2, 0xc3, 0x3e, 0xb6, 0x3d, 0xf8, 0x33, 0xb0, 0x21, 0x76, + 0x63, 0x61, 0x8e, 0xab, 0xda, 0xbe, 0x76, 0xbb, 0x72, 0xf7, 0x2d, 0x3d, 0x04, 0xd5, 0xd3, 0xa0, + 0xc9, 0xc9, 0x09, 0x6d, 0x7d, 0x78, 0x47, 0x7f, 0xd6, 0xf9, 0x98, 0x98, 0xbc, 0x45, 0x38, 0x36, + 0xe0, 0xcb, 0x71, 0x7d, 0x65, 0x32, 0xae, 0x83, 0x64, 0x0d, 0xc5, 0xa8, 0xf0, 0x43, 0xb0, 0xca, + 0x7c, 0x62, 0x56, 0x0b, 0x12, 0xfd, 0x81, 0xbe, 0xe0, 0xed, 0xe8, 0x72, 0x9f, 0x27, 0x3e, 0x31, + 0x8d, 0x4d, 0xe5, 0x67, 0x55, 0xfc, 0x42, 0x12, 0x15, 0x5a, 0x60, 0x8d, 0x71, 0xcc, 0x07, 0xac, + 0x5a, 0x94, 0xf8, 0xdf, 0x5d, 0x12, 0x5f, 0x62, 0x18, 0xd7, 0x94, 0x87, 0xb5, 0xf0, 0x37, 0x52, + 0xd8, 0x8d, 0xbf, 0x69, 0xa0, 0x2c, 0xf5, 0x8e, 0x6d, 0xc6, 0xe1, 0x87, 0x53, 0x67, 0xa6, 0x9f, + 0xef, 0xcc, 0x84, 0xb5, 0x3c, 0xb1, 0x6d, 0xe5, 0x67, 0x23, 0x5a, 0x49, 0x9d, 0xd7, 0x8f, 0x41, + 0xc9, 0xe6, 0xc4, 0x65, 0xd5, 0xc2, 0x7e, 0xf1, 0x76, 0xe5, 0xee, 0x3b, 0xcb, 0x05, 0x64, 0x6c, + 0x29, 0x17, 0xa5, 0xa7, 0x02, 0x0c, 0x85, 0x98, 0x8d, 0x3f, 0x15, 0x54, 0x20, 0xe2, 0x08, 0xe1, + 0xdb, 0xa0, 0x62, 0xd9, 0xcc, 0x77, 0xf0, 0xe8, 0x07, 0xd8, 0x25, 0x32, 0x96, 0xb2, 0xf1, 0x86, + 0x32, 0xac, 0x1c, 0x25, 0x22, 0x94, 0xd6, 0x83, 0x4d, 0x50, 0x76, 0x45, 0x84, 0xcf, 0x47, 0x3e, + 0x91, 0xd7, 0x5a, 0x36, 0x76, 0x94, 0x51, 0xb9, 0x15, 0x09, 0x50, 0xa2, 0x03, 0x6f, 0x81, 0x92, + 0xed, 0xe2, 0x1e, 0x91, 0x77, 0x54, 0x4e, 0x6d, 0x4d, 0x2c, 0xa2, 0x50, 0x06, 0x7f, 0x08, 0x6e, + 0xb8, 0xb6, 0x27, 0xec, 0x9f, 0x7a, 0x9c, 0x04, 0x43, 0xec, 0x9c, 0x10, 0x93, 0x7a, 0x16, 0xab, + 0xae, 0xee, 0x6b, 0xb7, 0x4b, 0x46, 0x4d, 0x59, 0xdd, 0x68, 0xcd, 0xd4, 0x42, 0x73, 0xac, 0xe1, + 0xf7, 0xc1, 0x76, 0x87, 0x52, 0xce, 0x78, 0x80, 0xfd, 0x43, 0xd3, 0xa4, 0x03, 0x8f, 0x57, 0x4b, + 0x72, 0x1f, 0xbb, 0x93, 0x71, 0x7d, 0xdb, 0xc8, 0xc9, 0xd0, 0x94, 0x76, 0xe3, 0x2f, 0x45, 0x50, + 0x49, 0x65, 0x09, 0xfc, 0x15, 0xd8, 0x34, 0xa9, 0xd7, 0xb5, 0x7b, 0x2d, 0xec, 0x23, 0xd2, 0x55, + 0x39, 0xf0, 0x68, 0xe1, 0x8b, 0x3a, 0xa6, 0x26, 0x76, 0xc2, 0x9a, 0x41, 0xa4, 0x4b, 0x02, 0xe2, + 0x99, 0xc4, 0xd8, 0x9e, 0x8c, 0xeb, 0x9b, 0x0f, 0x53, 0xf0, 0x28, 0xe3, 0x0c, 0x52, 0xb0, 0x21, + 0x0f, 0x56, 0x38, 0x2e, 0x7c, 0x9e, 0x8e, 0x37, 0x45, 0x3e, 0xb6, 0x14, 0x34, 0x8a, 0x9d, 0xc0, + 0x0f, 0x00, 0xa4, 0x1d, 0x46, 0x82, 0x21, 0xb1, 0x9e, 0x84, 0x34, 0x62, 0x53, 0x4f, 0xde, 0x64, + 0xd1, 0xd8, 0x53, 0x77, 0x02, 0x9f, 0x4d, 0x69, 0xa0, 0x19, 0x56, 0xd0, 0x03, 0x40, 0x5c, 0x8a, + 0x2d, 0x7e, 0x88, 0x7b, 0x2d, 0x2e, 0xc7, 0x08, 0x11, 0x44, 0xc2, 0x3c, 0xf1, 0x12, 0x43, 0x29, + 0x0f, 0x8d, 0xbf, 0x16, 0xc0, 0xd6, 0xc3, 0x3e, 0x0e, 0x7a, 0x04, 0x91, 0x9f, 0x0f, 0x08, 0xe3, + 0x57, 0xc0, 0x77, 0x56, 0x86, 0xef, 0x8c, 0x65, 0xca, 0x37, 0xd9, 0xef, 0x5c, 0xde, 0x73, 0x72, + 0xbc, 0x77, 0x74, 0x41, 0x3f, 0xaf, 0xe7, 0xbf, 0x7f, 0x68, 0x60, 0x27, 0xa3, 0x7f, 0x05, 0x3c, + 0x68, 0x66, 0x79, 0xf0, 0xbd, 0x8b, 0x05, 0x38, 0x87, 0x0f, 0xcd, 0x5c, 0x5c, 0x92, 0x16, 0xf7, + 0xc1, 0x6a, 0x37, 0xa0, 0xae, 0xe2, 0xc3, 0xf8, 0xf4, 0x1f, 0x07, 0xd4, 0x45, 0x52, 0x02, 0xbf, + 0x05, 0x36, 0x7c, 0xcc, 0xd8, 0x2f, 0x68, 0x60, 0x29, 0x02, 0x8c, 0x23, 0x69, 0xab, 0x75, 0x14, + 0x6b, 0x34, 0x7e, 0xa3, 0x81, 0x37, 0x66, 0x9c, 0x76, 0xae, 0x1a, 0xb4, 0x4b, 0xaf, 0x86, 0x3f, + 0x14, 0x41, 0x39, 0x16, 0xc1, 0x3b, 0x60, 0x95, 0x0b, 0x02, 0x0f, 0xa3, 0xfc, 0x5a, 0x14, 0xa5, + 0x20, 0xec, 0xb3, 0x71, 0x7d, 0x2b, 0x56, 0x94, 0x64, 0x2e, 0x55, 0xe1, 0x71, 0x9c, 0x74, 0x61, + 0xd0, 0xf7, 0xb2, 0xe9, 0x72, 0x36, 0xae, 0xcf, 0x98, 0x8d, 0x92, 0x0d, 0x66, 0x93, 0x0a, 0x1e, + 0x82, 0x0d, 0x46, 0x86, 0x24, 0xb0, 0xf9, 0x48, 0x35, 0x86, 0xaf, 0x47, 0x87, 0x78, 0xa2, 0xd6, + 0xcf, 0xc6, 0xf5, 0x9d, 0xc4, 0x5c, 0x2d, 0xa2, 0xd8, 0x0c, 0x0e, 0x01, 0x74, 0x30, 0xe3, 0xcf, + 0x03, 0xec, 0xb1, 0x70, 0xb3, 0xb6, 0x4b, 0x64, 0xbf, 0xa8, 0xdc, 0xfd, 0xe6, 0xf9, 0x72, 0x51, + 0x58, 0x24, 0x3c, 0x76, 0x3c, 0x85, 0x86, 0x66, 0x78, 0x80, 0xdf, 0x00, 0x6b, 0x01, 0xc1, 0x8c, + 0x7a, 0xaa, 0x93, 0xc4, 0x75, 0x83, 0xe4, 0x2a, 0x52, 0x52, 0xf8, 0x26, 0x58, 0x77, 0x09, 0x63, + 0xa2, 0xf5, 0xad, 0x49, 0xc5, 0xeb, 0x4a, 0x71, 0xbd, 0x15, 0x2e, 0xa3, 0x48, 0xde, 0x38, 0x00, + 0xbb, 0xb3, 0x68, 0x59, 0x24, 0xa3, 0x97, 0x34, 0xe7, 0x38, 0x19, 0x65, 0x57, 0x96, 0x12, 0x39, + 0xcc, 0x49, 0xde, 0xfe, 0x02, 0x0c, 0x73, 0x72, 0x9f, 0x97, 0x38, 0xcc, 0x85, 0xf8, 0xaf, 0x27, + 0x33, 0x0a, 0x36, 0xa5, 0xda, 0xa1, 0x65, 0x05, 0x84, 0x31, 0x78, 0x2f, 0x53, 0x08, 0xfb, 0xb9, + 0x42, 0xd8, 0x4e, 0xeb, 0xa6, 0x6a, 0xe1, 0x4d, 0xb0, 0x8e, 0xc3, 0x45, 0x55, 0x0c, 0xf1, 0xd5, + 0x2a, 0x5d, 0x14, 0xc9, 0xe5, 0xf4, 0x28, 0x51, 0xbe, 0x08, 0xd3, 0xa3, 0xdc, 0xe8, 0x1c, 0xb6, + 0xfc, 0x73, 0x01, 0x84, 0x13, 0xc2, 0x09, 0xb9, 0x8a, 0x4e, 0xfa, 0x51, 0x26, 0xd9, 0xbe, 0xb7, + 0x64, 0x32, 0x90, 0xf9, 0x4d, 0xb4, 0x97, 0xcb, 0xb7, 0xf7, 0x97, 0x77, 0xf1, 0xfa, 0x94, 0xfb, + 0xbb, 0xa6, 0x72, 0xee, 0x84, 0x5c, 0x45, 0xeb, 0xfc, 0x69, 0x36, 0x09, 0xee, 0x2f, 0x1d, 0xd6, + 0x9c, 0x3c, 0xf8, 0xfd, 0x6a, 0x12, 0x8e, 0xec, 0x98, 0xb7, 0xc1, 0x46, 0x40, 0x7c, 0xc7, 0x36, + 0x31, 0x93, 0xe1, 0x94, 0xc2, 0x69, 0x12, 0xa9, 0x35, 0x14, 0x4b, 0x21, 0x16, 0xa4, 0xef, 0x10, + 0x93, 0xd3, 0x40, 0xdd, 0xeb, 0x77, 0xce, 0x19, 0x38, 0xee, 0x10, 0xe7, 0x44, 0x99, 0x26, 0xd1, + 0x47, 0x2b, 0x28, 0x86, 0x85, 0x3e, 0xd8, 0xe0, 0xc4, 0xf5, 0x1d, 0xcc, 0x89, 0xba, 0x57, 0x63, + 0xb9, 0x03, 0x78, 0xae, 0x50, 0x64, 0xfe, 0xc4, 0x1e, 0xa3, 0x55, 0x14, 0x7b, 0xc9, 0xbf, 0xa3, + 0x56, 0xcf, 0xf9, 0x8e, 0x3a, 0x00, 0x9b, 0x16, 0x71, 0x08, 0x27, 0x6d, 0xea, 0xd8, 0xe6, 0x28, + 0x7a, 0x95, 0x28, 0xbb, 0xcd, 0xa3, 0x94, 0x0c, 0x65, 0x34, 0xe1, 0x21, 0xb8, 0xee, 0xda, 0x1e, + 0x22, 0xd8, 0x1a, 0x45, 0x8f, 0xa4, 0x35, 0x79, 0xec, 0x37, 0x95, 0xf1, 0xf5, 0x56, 0x56, 0x8c, + 0xf2, 0xfa, 0xf0, 0x05, 0xb8, 0xe9, 0x07, 0xb4, 0x27, 0x08, 0xea, 0x88, 0x60, 0xcb, 0xb1, 0x3d, + 0x12, 0x41, 0xad, 0x4b, 0xa8, 0xaf, 0x4c, 0xc6, 0xf5, 0x9b, 0xed, 0xd9, 0x2a, 0x68, 0x9e, 0x6d, + 0xe3, 0x93, 0x12, 0xb8, 0x96, 0x2d, 0x0a, 0x31, 0x2c, 0xe5, 0x92, 0x23, 0x3e, 0xcb, 0x19, 0x09, + 0xd2, 0x06, 0xbb, 0xdd, 0x81, 0xe3, 0x8c, 0xe4, 0x7d, 0x13, 0x2b, 0xd2, 0x90, 0xc9, 0x52, 0x32, + 0xbe, 0xaa, 0x2c, 0x77, 0x1f, 0xcf, 0xd0, 0x41, 0x33, 0x2d, 0xe1, 0xbb, 0x60, 0x2b, 0x10, 0x91, + 0xc7, 0x50, 0x45, 0x09, 0xf5, 0x25, 0x05, 0xb5, 0x85, 0xd2, 0x42, 0x94, 0xd5, 0x85, 0x4f, 0xc0, + 0x0e, 0x1e, 0x62, 0xdb, 0xc1, 0x1d, 0x87, 0xc4, 0x00, 0xe1, 0x83, 0xf4, 0xcb, 0x0a, 0x60, 0xe7, + 0x30, 0xaf, 0x80, 0xa6, 0x6d, 0xe6, 0x3c, 0xa3, 0x4a, 0x4b, 0x3d, 0xa3, 0x18, 0xd8, 0xea, 0x62, + 0xdb, 0x19, 0x04, 0x24, 0x9c, 0x37, 0xd4, 0x70, 0xd1, 0x12, 0xd1, 0x3c, 0x4e, 0x0b, 0xce, 0xc6, + 0xf5, 0x83, 0xd7, 0x7f, 0x4e, 0x23, 0x41, 0x40, 0x03, 0x96, 0xe3, 0xb1, 0x47, 0x62, 0x11, 0x65, + 0x7d, 0xc0, 0x07, 0xe0, 0x9a, 0x5a, 0x50, 0xb3, 0x8b, 0xcc, 0x93, 0xb2, 0x01, 0x27, 0xe3, 0xfa, + 0xb5, 0xc7, 0x19, 0x09, 0xca, 0x69, 0xe6, 0x26, 0xdd, 0x8d, 0x4b, 0x9f, 0x74, 0xff, 0x53, 0x54, + 0x1d, 0x57, 0xb2, 0xd3, 0xe9, 0x14, 0xd9, 0xbe, 0xbb, 0xb0, 0xef, 0x73, 0x37, 0xad, 0x1c, 0x17, + 0x14, 0x96, 0xf9, 0xa6, 0x52, 0x3c, 0xc7, 0x37, 0x95, 0x26, 0x28, 0x9b, 0x7d, 0x6c, 0x7b, 0xd2, + 0x4b, 0x29, 0x6b, 0xf0, 0x30, 0x12, 0xa0, 0x44, 0x07, 0x7e, 0x24, 0xca, 0x80, 0x71, 0x1c, 0x70, + 0x45, 0x37, 0x61, 0xd2, 0xdc, 0x4f, 0xca, 0x20, 0x25, 0x3c, 0x1b, 0xd7, 0xf7, 0x67, 0x8c, 0xf2, + 0x19, 0x1d, 0x94, 0xc5, 0x13, 0xc3, 0xb8, 0x4f, 0x2d, 0xc9, 0x5a, 0x6a, 0x4e, 0xa6, 0x03, 0x2e, + 0x93, 0xe4, 0xdc, 0xdd, 0xed, 0x68, 0x10, 0x66, 0xb8, 0x71, 0x43, 0x54, 0x43, 0x7b, 0x0a, 0x0d, + 0xcd, 0xf0, 0xd0, 0xf8, 0x67, 0x09, 0x54, 0x52, 0x73, 0x1f, 0x74, 0xc1, 0x9a, 0x4f, 0xad, 0xe4, + 0xc3, 0xcc, 0xad, 0x94, 0x6f, 0x5d, 0x44, 0x92, 0x0c, 0x21, 0xc9, 0xd7, 0x8f, 0xb7, 0x44, 0xd7, + 0x6e, 0x4b, 0xb3, 0x39, 0xcf, 0x98, 0x9c, 0x05, 0x52, 0x4e, 0xe0, 0x4f, 0x40, 0x45, 0xbc, 0x10, + 0x5e, 0xf8, 0x16, 0xe6, 0xc4, 0x52, 0x4d, 0x6d, 0x91, 0xc7, 0xc7, 0x75, 0x91, 0x18, 0xc7, 0x09, + 0x04, 0x4a, 0xe3, 0x41, 0x3f, 0x5f, 0xeb, 0x61, 0x72, 0x7c, 0x30, 0xab, 0xd6, 0xdf, 0x5e, 0xa0, + 0xd6, 0x17, 0x29, 0xf4, 0xd5, 0x05, 0x0a, 0xbd, 0xac, 0xa6, 0x5e, 0xc2, 0xaa, 0x25, 0x59, 0xe7, + 0x4b, 0xce, 0x6d, 0x6a, 0x8a, 0x4e, 0x92, 0xfa, 0x30, 0xc2, 0x45, 0x89, 0x0b, 0x78, 0x0b, 0x94, + 0xfc, 0x3e, 0x66, 0xd1, 0xf3, 0x2a, 0x1e, 0x57, 0xda, 0x62, 0x11, 0x85, 0xb2, 0x39, 0xd4, 0xbb, + 0xfe, 0x39, 0x7c, 0xc1, 0xba, 0x7c, 0x26, 0x1b, 0x6b, 0x60, 0x67, 0x6a, 0x18, 0xb9, 0x5a, 0x46, + 0xbb, 0xd4, 0x37, 0x5f, 0xe3, 0xbf, 0x05, 0x90, 0x72, 0x0b, 0x29, 0x58, 0x73, 0x44, 0xff, 0x8e, + 0xbe, 0x87, 0x3c, 0xb9, 0x40, 0x5c, 0xe1, 0xcc, 0xc8, 0x1e, 0x79, 0x3c, 0x18, 0x25, 0xa3, 0x79, + 0xb8, 0x88, 0x94, 0x1b, 0xf8, 0x89, 0x06, 0x2a, 0xd8, 0xf3, 0x28, 0xc7, 0xe1, 0x95, 0x86, 0x23, + 0xf3, 0xf1, 0x45, 0xdc, 0x1e, 0x26, 0x70, 0xa1, 0xef, 0x98, 0xfe, 0x53, 0x12, 0x94, 0xf6, 0xba, + 0x77, 0x1f, 0x54, 0x52, 0x9b, 0x85, 0xdb, 0xa0, 0x78, 0x4a, 0x46, 0xe1, 0x8b, 0x14, 0x89, 0x3f, + 0xe1, 0x2e, 0x28, 0x0d, 0xb1, 0x33, 0x50, 0x0d, 0x05, 0x85, 0x3f, 0x1e, 0x14, 0x0e, 0xb4, 0xbd, + 0xf7, 0xc0, 0x76, 0xde, 0xe1, 0x22, 0xf6, 0x8d, 0xdf, 0x6a, 0x60, 0xbd, 0x4d, 0xad, 0xa7, 0x5e, + 0x97, 0x8a, 0xb9, 0x92, 0xfa, 0x32, 0xd5, 0xbd, 0xde, 0xc9, 0x88, 0x71, 0xe2, 0x56, 0xcb, 0xb2, + 0xb0, 0xe2, 0xb9, 0xf2, 0x59, 0x56, 0x8c, 0xf2, 0xfa, 0x62, 0xa8, 0xc5, 0x81, 0xd9, 0xb7, 0x39, + 0x31, 0xf9, 0x20, 0x20, 0x55, 0x90, 0x1d, 0x6a, 0x0f, 0x53, 0x32, 0x94, 0xd1, 0x34, 0x5e, 0xbc, + 0x7c, 0x55, 0x5b, 0xf9, 0xf4, 0x55, 0x6d, 0xe5, 0xb3, 0x57, 0xb5, 0x95, 0x5f, 0x4f, 0x6a, 0xda, + 0xcb, 0x49, 0x4d, 0xfb, 0x74, 0x52, 0xd3, 0x3e, 0x9b, 0xd4, 0xb4, 0x7f, 0x4d, 0x6a, 0xda, 0xef, + 0xfe, 0x5d, 0x5b, 0xf9, 0x51, 0x73, 0xc1, 0x7f, 0x0f, 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xbc, + 0x09, 0x8c, 0x8b, 0x50, 0x1c, 0x00, 0x00, } func (m *Chain) Marshal() (dAtA []byte, err error) { @@ -2075,7 +1956,6 @@ func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *Chain) Size() (n int) { if m == nil { return 0 @@ -2490,17 +2370,14 @@ func (m *PodInfo) Size() (n int) { func sovGenerated(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozGenerated(x uint64) (n int) { return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (this *Chain) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&Chain{`, + s := strings.Join([]string{`&Chain{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ChainSpec", "ChainSpec", 1), `&`, ``, 1) + `,`, `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ChainStatus", "ChainStatus", 1), `&`, ``, 1) + `,`, @@ -2508,7 +2385,6 @@ func (this *Chain) String() string { }, "") return s } - func (this *ChainList) String() string { if this == nil { return "nil" @@ -2518,21 +2394,18 @@ func (this *ChainList) String() string { repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Chain", "Chain", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{ - `&ChainList{`, + s := strings.Join([]string{`&ChainList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } - func (this *ChainSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&ChainSpec{`, + s := strings.Join([]string{`&ChainSpec{`, `DisplayName:` + fmt.Sprintf("%v", this.DisplayName) + `,`, `MinerType:` + fmt.Sprintf("%v", this.MinerType) + `,`, `Image:` + fmt.Sprintf("%v", this.Image) + `,`, @@ -2542,7 +2415,6 @@ func (this *ChainSpec) String() string { }, "") return s } - func (this *ChainStatus) String() string { if this == nil { return "nil" @@ -2552,8 +2424,7 @@ func (this *ChainStatus) String() string { repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "Condition", "Condition", 1), `&`, ``, 1) + "," } repeatedStringForConditions += "}" - s := strings.Join([]string{ - `&ChainStatus{`, + s := strings.Join([]string{`&ChainStatus{`, `ConfigMapRef:` + strings.Replace(this.ConfigMapRef.String(), "LocalObjectReference", "LocalObjectReference", 1) + `,`, `MinerRef:` + strings.Replace(this.MinerRef.String(), "LocalObjectReference", "LocalObjectReference", 1) + `,`, `ObservedGeneration:` + fmt.Sprintf("%v", this.ObservedGeneration) + `,`, @@ -2562,13 +2433,11 @@ func (this *ChainStatus) String() string { }, "") return s } - func (this *ChargeRequest) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&ChargeRequest{`, + s := strings.Join([]string{`&ChargeRequest{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "ChargeRequestSpec", "ChargeRequestSpec", 1), `&`, ``, 1) + `,`, `Status:` + strings.Replace(strings.Replace(this.Status.String(), "ChargeRequestStatus", "ChargeRequestStatus", 1), `&`, ``, 1) + `,`, @@ -2576,7 +2445,6 @@ func (this *ChargeRequest) String() string { }, "") return s } - func (this *ChargeRequestList) String() string { if this == nil { return "nil" @@ -2586,28 +2454,24 @@ func (this *ChargeRequestList) String() string { repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "ChargeRequest", "ChargeRequest", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{ - `&ChargeRequestList{`, + s := strings.Join([]string{`&ChargeRequestList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } - func (this *ChargeRequestSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&ChargeRequestSpec{`, + s := strings.Join([]string{`&ChargeRequestSpec{`, `From:` + fmt.Sprintf("%v", this.From) + `,`, `Password:` + fmt.Sprintf("%v", this.Password) + `,`, `}`, }, "") return s } - func (this *ChargeRequestStatus) String() string { if this == nil { return "nil" @@ -2617,20 +2481,17 @@ func (this *ChargeRequestStatus) String() string { repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "Condition", "Condition", 1), `&`, ``, 1) + "," } repeatedStringForConditions += "}" - s := strings.Join([]string{ - `&ChargeRequestStatus{`, + s := strings.Join([]string{`&ChargeRequestStatus{`, `Conditions:` + repeatedStringForConditions + `,`, `}`, }, "") return s } - func (this *Condition) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&Condition{`, + s := strings.Join([]string{`&Condition{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Status:` + fmt.Sprintf("%v", this.Status) + `,`, `Severity:` + fmt.Sprintf("%v", this.Severity) + `,`, @@ -2641,25 +2502,21 @@ func (this *Condition) String() string { }, "") return s } - func (this *LocalObjectReference) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&LocalObjectReference{`, + s := strings.Join([]string{`&LocalObjectReference{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `}`, }, "") return s } - func (this *Miner) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&Miner{`, + s := strings.Join([]string{`&Miner{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "MinerSpec", "MinerSpec", 1), `&`, ``, 1) + `,`, `Status:` + strings.Replace(strings.Replace(this.Status.String(), "MinerStatus", "MinerStatus", 1), `&`, ``, 1) + `,`, @@ -2667,20 +2524,17 @@ func (this *Miner) String() string { }, "") return s } - func (this *MinerAddress) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&MinerAddress{`, + s := strings.Join([]string{`&MinerAddress{`, `Type:` + fmt.Sprintf("%v", this.Type) + `,`, `Address:` + fmt.Sprintf("%v", this.Address) + `,`, `}`, }, "") return s } - func (this *MinerList) String() string { if this == nil { return "nil" @@ -2690,21 +2544,18 @@ func (this *MinerList) String() string { repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Miner", "Miner", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{ - `&MinerList{`, + s := strings.Join([]string{`&MinerList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } - func (this *MinerSet) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&MinerSet{`, + s := strings.Join([]string{`&MinerSet{`, `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "MinerSetSpec", "MinerSetSpec", 1), `&`, ``, 1) + `,`, `Status:` + strings.Replace(strings.Replace(this.Status.String(), "MinerSetStatus", "MinerSetStatus", 1), `&`, ``, 1) + `,`, @@ -2712,7 +2563,6 @@ func (this *MinerSet) String() string { }, "") return s } - func (this *MinerSetList) String() string { if this == nil { return "nil" @@ -2722,21 +2572,18 @@ func (this *MinerSetList) String() string { repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "MinerSet", "MinerSet", 1), `&`, ``, 1) + "," } repeatedStringForItems += "}" - s := strings.Join([]string{ - `&MinerSetList{`, + s := strings.Join([]string{`&MinerSetList{`, `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, `Items:` + repeatedStringForItems + `,`, `}`, }, "") return s } - func (this *MinerSetSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&MinerSetSpec{`, + s := strings.Join([]string{`&MinerSetSpec{`, `Replicas:` + valueToStringGenerated(this.Replicas) + `,`, `Selector:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1), `&`, ``, 1) + `,`, `Template:` + strings.Replace(strings.Replace(this.Template.String(), "MinerTemplateSpec", "MinerTemplateSpec", 1), `&`, ``, 1) + `,`, @@ -2748,7 +2595,6 @@ func (this *MinerSetSpec) String() string { }, "") return s } - func (this *MinerSetStatus) String() string { if this == nil { return "nil" @@ -2758,8 +2604,7 @@ func (this *MinerSetStatus) String() string { repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "Condition", "Condition", 1), `&`, ``, 1) + "," } repeatedStringForConditions += "}" - s := strings.Join([]string{ - `&MinerSetStatus{`, + s := strings.Join([]string{`&MinerSetStatus{`, `Replicas:` + fmt.Sprintf("%v", this.Replicas) + `,`, `FullyLabeledReplicas:` + fmt.Sprintf("%v", this.FullyLabeledReplicas) + `,`, `ReadyReplicas:` + fmt.Sprintf("%v", this.ReadyReplicas) + `,`, @@ -2772,13 +2617,11 @@ func (this *MinerSetStatus) String() string { }, "") return s } - func (this *MinerSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&MinerSpec{`, + s := strings.Join([]string{`&MinerSpec{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "ObjectMeta", 1), `&`, ``, 1) + `,`, `DisplayName:` + fmt.Sprintf("%v", this.DisplayName) + `,`, `MinerType:` + fmt.Sprintf("%v", this.MinerType) + `,`, @@ -2789,7 +2632,6 @@ func (this *MinerSpec) String() string { }, "") return s } - func (this *MinerStatus) String() string { if this == nil { return "nil" @@ -2804,9 +2646,8 @@ func (this *MinerStatus) String() string { repeatedStringForConditions += strings.Replace(strings.Replace(f.String(), "Condition", "Condition", 1), `&`, ``, 1) + "," } repeatedStringForConditions += "}" - s := strings.Join([]string{ - `&MinerStatus{`, - `PodRef:` + strings.Replace(this.PodRef.String(), "ObjectReference", "ObjectReference", 1) + `,`, + s := strings.Join([]string{`&MinerStatus{`, + `PodRef:` + strings.Replace(fmt.Sprintf("%v", this.PodRef), "ObjectReference", "v11.ObjectReference", 1) + `,`, `LastUpdated:` + strings.Replace(fmt.Sprintf("%v", this.LastUpdated), "Time", "v1.Time", 1) + `,`, `FailureReason:` + valueToStringGenerated(this.FailureReason) + `,`, `FailureMessage:` + valueToStringGenerated(this.FailureMessage) + `,`, @@ -2818,20 +2659,17 @@ func (this *MinerStatus) String() string { }, "") return s } - func (this *MinerTemplateSpec) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&MinerTemplateSpec{`, + s := strings.Join([]string{`&MinerTemplateSpec{`, `ObjectMeta:` + strings.Replace(strings.Replace(this.ObjectMeta.String(), "ObjectMeta", "ObjectMeta", 1), `&`, ``, 1) + `,`, `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "MinerSpec", "MinerSpec", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } - func (this *ObjectMeta) String() string { if this == nil { return "nil" @@ -2856,29 +2694,25 @@ func (this *ObjectMeta) String() string { mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) } mapStringForAnnotations += "}" - s := strings.Join([]string{ - `&ObjectMeta{`, + s := strings.Join([]string{`&ObjectMeta{`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, `}`, }, "") return s } - func (this *PodInfo) String() string { if this == nil { return "nil" } - s := strings.Join([]string{ - `&PodInfo{`, + s := strings.Join([]string{`&PodInfo{`, `OperatingSystem:` + fmt.Sprintf("%v", this.OperatingSystem) + `,`, `Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`, `}`, }, "") return s } - -func valueToStringGenerated(v any) string { +func valueToStringGenerated(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" @@ -2886,7 +2720,6 @@ func valueToStringGenerated(v any) string { pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } - func (m *Chain) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3036,7 +2869,6 @@ func (m *Chain) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChainList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3154,7 +2986,6 @@ func (m *ChainList) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChainSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3353,7 +3184,6 @@ func (m *ChainSpec) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChainStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3529,7 +3359,6 @@ func (m *ChainStatus) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChargeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3679,7 +3508,6 @@ func (m *ChargeRequest) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChargeRequestList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3797,7 +3625,6 @@ func (m *ChargeRequestList) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChargeRequestSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3912,7 +3739,6 @@ func (m *ChargeRequestSpec) Unmarshal(dAtA []byte) error { } return nil } - func (m *ChargeRequestStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3997,7 +3823,6 @@ func (m *ChargeRequestStatus) Unmarshal(dAtA []byte) error { } return nil } - func (m *Condition) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4241,7 +4066,6 @@ func (m *Condition) Unmarshal(dAtA []byte) error { } return nil } - func (m *LocalObjectReference) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4324,7 +4148,6 @@ func (m *LocalObjectReference) Unmarshal(dAtA []byte) error { } return nil } - func (m *Miner) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4474,7 +4297,6 @@ func (m *Miner) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4589,7 +4411,6 @@ func (m *MinerAddress) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4707,7 +4528,6 @@ func (m *MinerList) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerSet) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4857,7 +4677,6 @@ func (m *MinerSet) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerSetList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4975,7 +4794,6 @@ func (m *MinerSetList) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerSetSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5215,7 +5033,6 @@ func (m *MinerSetSpec) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerSetStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5461,7 +5278,6 @@ func (m *MinerSetStatus) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -5709,7 +5525,6 @@ func (m *MinerSpec) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerStatus) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6017,7 +5832,6 @@ func (m *MinerStatus) Unmarshal(dAtA []byte) error { } return nil } - func (m *MinerTemplateSpec) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6134,7 +5948,6 @@ func (m *MinerTemplateSpec) Unmarshal(dAtA []byte) error { } return nil } - func (m *ObjectMeta) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6439,7 +6252,6 @@ func (m *ObjectMeta) Unmarshal(dAtA []byte) error { } return nil } - func (m *PodInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -6554,7 +6366,6 @@ func (m *PodInfo) Unmarshal(dAtA []byte) error { } return nil } - func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/pkg/apis/apps/v1beta1/generated.proto b/pkg/apis/apps/v1beta1/generated.proto index 3be3c87d266..d009a6a5c51 100644 --- a/pkg/apis/apps/v1beta1/generated.proto +++ b/pkg/apis/apps/v1beta1/generated.proto @@ -10,6 +10,7 @@ syntax = "proto2"; package github.com.superproj.onex.pkg.apis.apps.v1beta1; +import "k8s.io/api/core/v1/generated.proto"; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; @@ -17,48 +18,6 @@ import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; // Package-wide variables from generator "generated". option go_package = "github.com/superproj/onex/pkg/apis/apps/v1beta1"; -message ObjectReference { - // Kind of the referent. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - // +optional - optional string kind = 1; - - // Namespace of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ - // +optional - optional string namespace = 2; - - // Name of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - // +optional - optional string name = 3; - - // UID of the referent. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids - // +optional - optional string uid = 4; - - // API version of the referent. - // +optional - optional string apiVersion = 5; - - // 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 - // +optional - optional string resourceVersion = 6; - - // 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. - // TODO: this design is not final and this field is subject to change in the future. - // +optional - optional string fieldPath = 7; -} - // Chain is the Schema for the chains API. message Chain { // Standard object's metadata. @@ -443,7 +402,7 @@ message MinerSpec { message MinerStatus { // PodRef will point to the corresponding Pod if it exists. // +optional - optional ObjectReference podRef = 1; + optional k8s.io.api.core.v1.ObjectReference podRef = 1; // LastUpdated identifies when this status was last observed. // +optional diff --git a/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go b/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go index b2d8cf9967e..d96771c504c 100644 --- a/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go +++ b/pkg/apis/apps/v1beta1/types_swagger_doc_generated.go @@ -13,7 +13,7 @@ package v1beta1 // they are on one line! For multiple line or blocks that you want to ignore use ---. // Any context after a --- is ignored. // -// Those methods can be generated by using scripts/update-generated-swagger-docs.sh +// Those methods can be generated by using scripts/update-codegen.sh // AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. var map_ChargeRequest = map[string]string{ diff --git a/pkg/apis/apps/v1beta1/zz_generated.conversion.go b/pkg/apis/apps/v1beta1/zz_generated.conversion.go index cf17229c86f..2f2d8b23065 100644 --- a/pkg/apis/apps/v1beta1/zz_generated.conversion.go +++ b/pkg/apis/apps/v1beta1/zz_generated.conversion.go @@ -13,14 +13,13 @@ package v1beta1 import ( unsafe "unsafe" + apps "github.com/superproj/onex/pkg/apis/apps" + errors "github.com/superproj/onex/pkg/errors" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" core "k8s.io/kubernetes/pkg/apis/core" - - apps "github.com/superproj/onex/pkg/apis/apps" - errors "github.com/superproj/onex/pkg/errors" ) func init() { @@ -30,182 +29,182 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*Chain)(nil), (*apps.Chain)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*Chain)(nil), (*apps.Chain)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Chain_To_apps_Chain(a.(*Chain), b.(*apps.Chain), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.Chain)(nil), (*Chain)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.Chain)(nil), (*Chain)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_Chain_To_v1beta1_Chain(a.(*apps.Chain), b.(*Chain), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ChainList)(nil), (*apps.ChainList)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*ChainList)(nil), (*apps.ChainList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ChainList_To_apps_ChainList(a.(*ChainList), b.(*apps.ChainList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.ChainList)(nil), (*ChainList)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.ChainList)(nil), (*ChainList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_ChainList_To_v1beta1_ChainList(a.(*apps.ChainList), b.(*ChainList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ChainSpec)(nil), (*apps.ChainSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*ChainSpec)(nil), (*apps.ChainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ChainSpec_To_apps_ChainSpec(a.(*ChainSpec), b.(*apps.ChainSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.ChainSpec)(nil), (*ChainSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.ChainSpec)(nil), (*ChainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_ChainSpec_To_v1beta1_ChainSpec(a.(*apps.ChainSpec), b.(*ChainSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ChainStatus)(nil), (*apps.ChainStatus)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*ChainStatus)(nil), (*apps.ChainStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ChainStatus_To_apps_ChainStatus(a.(*ChainStatus), b.(*apps.ChainStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.ChainStatus)(nil), (*ChainStatus)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.ChainStatus)(nil), (*ChainStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_ChainStatus_To_v1beta1_ChainStatus(a.(*apps.ChainStatus), b.(*ChainStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*apps.Condition)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*apps.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Condition_To_apps_Condition(a.(*Condition), b.(*apps.Condition), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.Condition)(nil), (*Condition)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_Condition_To_v1beta1_Condition(a.(*apps.Condition), b.(*Condition), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*LocalObjectReference)(nil), (*apps.LocalObjectReference)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*LocalObjectReference)(nil), (*apps.LocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_LocalObjectReference_To_apps_LocalObjectReference(a.(*LocalObjectReference), b.(*apps.LocalObjectReference), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.LocalObjectReference)(nil), (*LocalObjectReference)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.LocalObjectReference)(nil), (*LocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_LocalObjectReference_To_v1beta1_LocalObjectReference(a.(*apps.LocalObjectReference), b.(*LocalObjectReference), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Miner)(nil), (*apps.Miner)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*Miner)(nil), (*apps.Miner)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_Miner_To_apps_Miner(a.(*Miner), b.(*apps.Miner), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.Miner)(nil), (*Miner)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.Miner)(nil), (*Miner)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_Miner_To_v1beta1_Miner(a.(*apps.Miner), b.(*Miner), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerAddress)(nil), (*apps.MinerAddress)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerAddress)(nil), (*apps.MinerAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerAddress_To_apps_MinerAddress(a.(*MinerAddress), b.(*apps.MinerAddress), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerAddress)(nil), (*MinerAddress)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerAddress)(nil), (*MinerAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerAddress_To_v1beta1_MinerAddress(a.(*apps.MinerAddress), b.(*MinerAddress), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerList)(nil), (*apps.MinerList)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerList)(nil), (*apps.MinerList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerList_To_apps_MinerList(a.(*MinerList), b.(*apps.MinerList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerList)(nil), (*MinerList)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerList)(nil), (*MinerList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerList_To_v1beta1_MinerList(a.(*apps.MinerList), b.(*MinerList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerSet)(nil), (*apps.MinerSet)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerSet)(nil), (*apps.MinerSet)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerSet_To_apps_MinerSet(a.(*MinerSet), b.(*apps.MinerSet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerSet)(nil), (*MinerSet)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerSet)(nil), (*MinerSet)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerSet_To_v1beta1_MinerSet(a.(*apps.MinerSet), b.(*MinerSet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerSetList)(nil), (*apps.MinerSetList)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerSetList)(nil), (*apps.MinerSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerSetList_To_apps_MinerSetList(a.(*MinerSetList), b.(*apps.MinerSetList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerSetList)(nil), (*MinerSetList)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerSetList)(nil), (*MinerSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerSetList_To_v1beta1_MinerSetList(a.(*apps.MinerSetList), b.(*MinerSetList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerSetSpec)(nil), (*apps.MinerSetSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerSetSpec)(nil), (*apps.MinerSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerSetSpec_To_apps_MinerSetSpec(a.(*MinerSetSpec), b.(*apps.MinerSetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerSetSpec)(nil), (*MinerSetSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerSetSpec)(nil), (*MinerSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerSetSpec_To_v1beta1_MinerSetSpec(a.(*apps.MinerSetSpec), b.(*MinerSetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerSetStatus)(nil), (*apps.MinerSetStatus)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerSetStatus)(nil), (*apps.MinerSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerSetStatus_To_apps_MinerSetStatus(a.(*MinerSetStatus), b.(*apps.MinerSetStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerSetStatus)(nil), (*MinerSetStatus)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerSetStatus)(nil), (*MinerSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerSetStatus_To_v1beta1_MinerSetStatus(a.(*apps.MinerSetStatus), b.(*MinerSetStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerSpec)(nil), (*apps.MinerSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerSpec)(nil), (*apps.MinerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerSpec_To_apps_MinerSpec(a.(*MinerSpec), b.(*apps.MinerSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerSpec)(nil), (*MinerSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerSpec)(nil), (*MinerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerSpec_To_v1beta1_MinerSpec(a.(*apps.MinerSpec), b.(*MinerSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerStatus)(nil), (*apps.MinerStatus)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerStatus)(nil), (*apps.MinerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerStatus_To_apps_MinerStatus(a.(*MinerStatus), b.(*apps.MinerStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerStatus)(nil), (*MinerStatus)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerStatus)(nil), (*MinerStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerStatus_To_v1beta1_MinerStatus(a.(*apps.MinerStatus), b.(*MinerStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MinerTemplateSpec)(nil), (*apps.MinerTemplateSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*MinerTemplateSpec)(nil), (*apps.MinerTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MinerTemplateSpec_To_apps_MinerTemplateSpec(a.(*MinerTemplateSpec), b.(*apps.MinerTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.MinerTemplateSpec)(nil), (*MinerTemplateSpec)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.MinerTemplateSpec)(nil), (*MinerTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_MinerTemplateSpec_To_v1beta1_MinerTemplateSpec(a.(*apps.MinerTemplateSpec), b.(*MinerTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ObjectMeta)(nil), (*apps.ObjectMeta)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*ObjectMeta)(nil), (*apps.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_ObjectMeta_To_apps_ObjectMeta(a.(*ObjectMeta), b.(*apps.ObjectMeta), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_ObjectMeta_To_v1beta1_ObjectMeta(a.(*apps.ObjectMeta), b.(*ObjectMeta), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*PodInfo)(nil), (*apps.PodInfo)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*PodInfo)(nil), (*apps.PodInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_PodInfo_To_apps_PodInfo(a.(*PodInfo), b.(*apps.PodInfo), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*apps.PodInfo)(nil), (*PodInfo)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddGeneratedConversionFunc((*apps.PodInfo)(nil), (*PodInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_apps_PodInfo_To_v1beta1_PodInfo(a.(*apps.PodInfo), b.(*PodInfo), scope) }); err != nil { return err diff --git a/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go b/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go index b926730d534..cad2622fd09 100644 --- a/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go +++ b/pkg/apis/apps/v1beta1/zz_generated.deepcopy.go @@ -11,11 +11,10 @@ package v1beta1 import ( + errors "github.com/superproj/onex/pkg/errors" corev1 "k8s.io/api/core/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" - - errors "github.com/superproj/onex/pkg/errors" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/pkg/apis/apps/v1beta1/zz_generated.defaults.go b/pkg/apis/apps/v1beta1/zz_generated.defaults.go index 8ab5e60c877..b13f764fc98 100644 --- a/pkg/apis/apps/v1beta1/zz_generated.defaults.go +++ b/pkg/apis/apps/v1beta1/zz_generated.defaults.go @@ -18,12 +18,12 @@ import ( // Public to allow building arbitrary schemes. // All generated defaulters are covering - they call all nested defaulters. func RegisterDefaults(scheme *runtime.Scheme) error { - scheme.AddTypeDefaultingFunc(&Chain{}, func(obj any) { SetObjectDefaults_Chain(obj.(*Chain)) }) - scheme.AddTypeDefaultingFunc(&ChainList{}, func(obj any) { SetObjectDefaults_ChainList(obj.(*ChainList)) }) - scheme.AddTypeDefaultingFunc(&Miner{}, func(obj any) { SetObjectDefaults_Miner(obj.(*Miner)) }) - scheme.AddTypeDefaultingFunc(&MinerList{}, func(obj any) { SetObjectDefaults_MinerList(obj.(*MinerList)) }) - scheme.AddTypeDefaultingFunc(&MinerSet{}, func(obj any) { SetObjectDefaults_MinerSet(obj.(*MinerSet)) }) - scheme.AddTypeDefaultingFunc(&MinerSetList{}, func(obj any) { SetObjectDefaults_MinerSetList(obj.(*MinerSetList)) }) + scheme.AddTypeDefaultingFunc(&Chain{}, func(obj interface{}) { SetObjectDefaults_Chain(obj.(*Chain)) }) + scheme.AddTypeDefaultingFunc(&ChainList{}, func(obj interface{}) { SetObjectDefaults_ChainList(obj.(*ChainList)) }) + scheme.AddTypeDefaultingFunc(&Miner{}, func(obj interface{}) { SetObjectDefaults_Miner(obj.(*Miner)) }) + scheme.AddTypeDefaultingFunc(&MinerList{}, func(obj interface{}) { SetObjectDefaults_MinerList(obj.(*MinerList)) }) + scheme.AddTypeDefaultingFunc(&MinerSet{}, func(obj interface{}) { SetObjectDefaults_MinerSet(obj.(*MinerSet)) }) + scheme.AddTypeDefaultingFunc(&MinerSetList{}, func(obj interface{}) { SetObjectDefaults_MinerSetList(obj.(*MinerSetList)) }) return nil } diff --git a/pkg/apis/apps/well_known_annotations.go b/pkg/apis/apps/well_known_annotations.go new file mode 100644 index 00000000000..4715a62fdcc --- /dev/null +++ b/pkg/apis/apps/well_known_annotations.go @@ -0,0 +1,7 @@ +package apps + +const ( + // AnnotationDeletionProtection is the key for the annotation used to enable deletion protection for resources. + // When this annotation is present on a resource, the resource should not be deleted unless the annotation is removed. + AnnotationDeletionProtection = "apps.onex.io/deletion-protection" +) diff --git a/pkg/apis/apps/well_known_labels.go b/pkg/apis/apps/well_known_labels.go new file mode 100644 index 00000000000..9e4315eb899 --- /dev/null +++ b/pkg/apis/apps/well_known_labels.go @@ -0,0 +1,6 @@ +package apps + +const ( + // LabelMinerSet represents the label key used for identifying the miner set. + LabelMinerSet = "apps.onex.io/minerset" +) diff --git a/pkg/apis/apps/zz_generated.deepcopy.go b/pkg/apis/apps/zz_generated.deepcopy.go index 9a0f57e7630..62b28737bd9 100644 --- a/pkg/apis/apps/zz_generated.deepcopy.go +++ b/pkg/apis/apps/zz_generated.deepcopy.go @@ -11,11 +11,10 @@ package apps import ( + errors "github.com/superproj/onex/pkg/errors" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" core "k8s.io/kubernetes/pkg/apis/core" - - errors "github.com/superproj/onex/pkg/errors" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. diff --git a/pkg/apis/coordination/install/doc.go b/pkg/apis/coordination/install/doc.go deleted file mode 100644 index 2c7d71a0310..00000000000 --- a/pkg/apis/coordination/install/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package install // import "github.com/superproj/onex/pkg/apis/coordination/install" diff --git a/pkg/apis/coordination/install/install.go b/pkg/apis/coordination/install/install.go deleted file mode 100644 index 3cab5f40416..00000000000 --- a/pkg/apis/coordination/install/install.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -// Package install installs the coordination API group, making it available as -// an option to all of the API encoding/decoding machinery. -package install - -import ( - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/kubernetes/pkg/api/legacyscheme" - - "github.com/superproj/onex/pkg/apis/coordination" - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" -) - -func init() { - Install(legacyscheme.Scheme) -} - -// Install registers the API group and adds types to a scheme. -func Install(scheme *runtime.Scheme) { - utilruntime.Must(coordination.AddToScheme(scheme)) - utilruntime.Must(coordinationv1.AddToScheme(scheme)) - utilruntime.Must(scheme.SetVersionPriority(coordinationv1.SchemeGroupVersion)) -} diff --git a/pkg/apis/coordination/lease_types.go b/pkg/apis/coordination/lease_types.go deleted file mode 100644 index fc5360c5164..00000000000 --- a/pkg/apis/coordination/lease_types.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package coordination - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Lease defines a lease concept. -type Lease struct { - metav1.TypeMeta - // +optional - metav1.ObjectMeta - - // Specification of the Lease. - // +optional - Spec LeaseSpec -} - -// LeaseSpec is a specification of a Lease. -type LeaseSpec struct { - // holderIdentity contains the identity of the holder of a current lease. - // +optional - HolderIdentity *string - // leaseDurationSeconds is a duration that candidates for a lease need - // to wait to force acquire it. This is measure against time of last - // observed RenewTime. - // +optional - LeaseDurationSeconds *int32 - // acquireTime is a time when the current lease was acquired. - // +optional - AcquireTime *metav1.MicroTime - // renewTime is a time when the current holder of a lease has last - // updated the lease. - // +optional - RenewTime *metav1.MicroTime - // leaseTransitions is the number of transitions of a lease between - // holders. - // +optional - LeaseTransitions *int32 -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// LeaseList is a list of Lease objects. -type LeaseList struct { - metav1.TypeMeta - // +optional - metav1.ListMeta - - // Items is a list of schema objects. - Items []Lease -} diff --git a/pkg/apis/coordination/register.go b/pkg/apis/coordination/register.go deleted file mode 100644 index 5910c5d801f..00000000000 --- a/pkg/apis/coordination/register.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package coordination - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/kubernetes/pkg/apis/coordination" -) - -// GroupName is the group name use in this package. -const GroupName = "coordination.k8s.io" - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind. -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // SchemeBuilder points to a list of functions added to Scheme. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme applies all the stored functions to the scheme. - AddToScheme = SchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - // TODO this gets cleaned up when the types are fixed - scheme.AddKnownTypes(SchemeGroupVersion, - &coordination.Lease{}, - &coordination.LeaseList{}, - ) - return nil -} diff --git a/pkg/apis/coordination/v1/doc.go b/pkg/apis/coordination/v1/doc.go deleted file mode 100644 index 2205b02301e..00000000000 --- a/pkg/apis/coordination/v1/doc.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package -// +k8s:protobuf-gen=package -// +k8s:conversion-gen=github.com/superproj/onex/pkg/apis/coordination -// +k8s:defaulter-gen=TypeMeta -// +groupName=coordination.k8s.io - -package v1 // import "github.com/superproj/onex/pkg/apis/coordination/v1" diff --git a/pkg/apis/coordination/v1/generated.pb.go b/pkg/apis/coordination/v1/generated.pb.go deleted file mode 100644 index caf3c110d27..00000000000 --- a/pkg/apis/coordination/v1/generated.pb.go +++ /dev/null @@ -1,986 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: github.com/superproj/onex/pkg/apis/coordination/v1/generated.proto - -package v1 - -import ( - fmt "fmt" - - io "io" - - proto "github.com/gogo/protobuf/proto" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - math "math" - math_bits "math/bits" - reflect "reflect" - strings "strings" -) - -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func (m *Lease) Reset() { *m = Lease{} } -func (*Lease) ProtoMessage() {} -func (*Lease) Descriptor() ([]byte, []int) { - return fileDescriptor_b760b42e087a13cc, []int{0} -} - -func (m *Lease) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *Lease) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} - -func (m *Lease) XXX_Merge(src proto.Message) { - xxx_messageInfo_Lease.Merge(m, src) -} - -func (m *Lease) XXX_Size() int { - return m.Size() -} - -func (m *Lease) XXX_DiscardUnknown() { - xxx_messageInfo_Lease.DiscardUnknown(m) -} - -var xxx_messageInfo_Lease proto.InternalMessageInfo - -func (m *LeaseList) Reset() { *m = LeaseList{} } -func (*LeaseList) ProtoMessage() {} -func (*LeaseList) Descriptor() ([]byte, []int) { - return fileDescriptor_b760b42e087a13cc, []int{1} -} - -func (m *LeaseList) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *LeaseList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} - -func (m *LeaseList) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseList.Merge(m, src) -} - -func (m *LeaseList) XXX_Size() int { - return m.Size() -} - -func (m *LeaseList) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseList.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseList proto.InternalMessageInfo - -func (m *LeaseSpec) Reset() { *m = LeaseSpec{} } -func (*LeaseSpec) ProtoMessage() {} -func (*LeaseSpec) Descriptor() ([]byte, []int) { - return fileDescriptor_b760b42e087a13cc, []int{2} -} - -func (m *LeaseSpec) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} - -func (m *LeaseSpec) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} - -func (m *LeaseSpec) XXX_Merge(src proto.Message) { - xxx_messageInfo_LeaseSpec.Merge(m, src) -} - -func (m *LeaseSpec) XXX_Size() int { - return m.Size() -} - -func (m *LeaseSpec) XXX_DiscardUnknown() { - xxx_messageInfo_LeaseSpec.DiscardUnknown(m) -} - -var xxx_messageInfo_LeaseSpec proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Lease)(nil), "github.com.superproj.onex.pkg.apis.coordination.v1.Lease") - proto.RegisterType((*LeaseList)(nil), "github.com.superproj.onex.pkg.apis.coordination.v1.LeaseList") - proto.RegisterType((*LeaseSpec)(nil), "github.com.superproj.onex.pkg.apis.coordination.v1.LeaseSpec") -} - -func init() { - proto.RegisterFile("github.com/superproj/onex/pkg/apis/coordination/v1/generated.proto", fileDescriptor_b760b42e087a13cc) -} - -var fileDescriptor_b760b42e087a13cc = []byte{ - // 541 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x94, 0xc1, 0x6e, 0xd3, 0x4e, - 0x10, 0xc6, 0xe3, 0x26, 0x91, 0x9a, 0xcd, 0xbf, 0xfd, 0x47, 0x56, 0x0e, 0x56, 0x0e, 0x76, 0x95, - 0x53, 0x2f, 0xac, 0x49, 0x84, 0x10, 0x20, 0x21, 0x81, 0xc5, 0x81, 0x4a, 0xa9, 0x90, 0xdc, 0x1e, - 0x10, 0xaa, 0x80, 0x8d, 0x3d, 0x38, 0xdb, 0xd4, 0x5e, 0xb3, 0x5e, 0x07, 0x7a, 0xe3, 0x11, 0xb8, - 0xf2, 0x46, 0x81, 0x53, 0x8f, 0x3d, 0x59, 0x64, 0x79, 0x11, 0xb4, 0x9b, 0xb4, 0x0e, 0x49, 0x10, - 0x6d, 0x6f, 0x99, 0x9d, 0xf9, 0x7e, 0xdf, 0x7c, 0x13, 0xc9, 0xc8, 0x8b, 0xa8, 0x18, 0xe5, 0x43, - 0x1c, 0xb0, 0xd8, 0xcd, 0xf2, 0x14, 0x78, 0xca, 0xd9, 0xa9, 0xcb, 0x12, 0xf8, 0xec, 0xa6, 0xe3, - 0xc8, 0x25, 0x29, 0xcd, 0xdc, 0x80, 0x31, 0x1e, 0xd2, 0x84, 0x08, 0xca, 0x12, 0x77, 0xd2, 0x73, - 0x23, 0x48, 0x80, 0x13, 0x01, 0x21, 0x4e, 0x39, 0x13, 0xcc, 0xec, 0x97, 0x0c, 0x7c, 0xcd, 0xc0, - 0x8a, 0x81, 0xd3, 0x71, 0x84, 0x15, 0x03, 0x2f, 0x33, 0xf0, 0xa4, 0xd7, 0xb9, 0xb7, 0xe4, 0x1b, - 0xb1, 0x88, 0xb9, 0x1a, 0x35, 0xcc, 0x3f, 0xe8, 0x4a, 0x17, 0xfa, 0xd7, 0xdc, 0xa2, 0xf3, 0x60, - 0xfc, 0x28, 0xc3, 0x94, 0xa9, 0x7d, 0x62, 0x12, 0x8c, 0x68, 0x02, 0xfc, 0xbc, 0x5c, 0x30, 0x06, - 0x41, 0x36, 0x2c, 0xd6, 0x71, 0xff, 0xa6, 0xe2, 0x79, 0x22, 0x68, 0x0c, 0x6b, 0x82, 0x87, 0xff, - 0x12, 0x64, 0xc1, 0x08, 0x62, 0xb2, 0xaa, 0xeb, 0xfe, 0x30, 0x50, 0x7d, 0x00, 0x24, 0x03, 0xf3, - 0x3d, 0xda, 0x56, 0xdb, 0x84, 0x44, 0x10, 0xcb, 0xd8, 0x33, 0xf6, 0x9b, 0xfd, 0xfb, 0x78, 0x0e, - 0xc5, 0xcb, 0xd0, 0xf2, 0x30, 0x6a, 0x1a, 0x4f, 0x7a, 0xf8, 0xd5, 0xf0, 0x14, 0x02, 0x71, 0x08, - 0x82, 0x78, 0xe6, 0xb4, 0x70, 0x2a, 0xb2, 0x70, 0x50, 0xf9, 0xe6, 0x5f, 0x53, 0xcd, 0x77, 0xa8, - 0x96, 0xa5, 0x10, 0x58, 0x5b, 0x9a, 0xfe, 0x14, 0xdf, 0xfe, 0xf8, 0x58, 0xaf, 0x7a, 0x94, 0x42, - 0xe0, 0xfd, 0xb7, 0xb0, 0xaa, 0xa9, 0xca, 0xd7, 0xe0, 0xee, 0x77, 0x03, 0x35, 0xf4, 0xc4, 0x80, - 0x66, 0xc2, 0x3c, 0x59, 0x0b, 0x84, 0x6f, 0x16, 0x48, 0xa9, 0x75, 0x9c, 0xd6, 0xc2, 0x63, 0xfb, - 0xea, 0x65, 0x29, 0xcc, 0x5b, 0x54, 0xa7, 0x02, 0xe2, 0xcc, 0xda, 0xda, 0xab, 0xee, 0x37, 0xfb, - 0x8f, 0xef, 0x9c, 0xc6, 0xdb, 0x59, 0xb8, 0xd4, 0x0f, 0x14, 0xcf, 0x9f, 0x63, 0xbb, 0xdf, 0xaa, - 0x8b, 0x2c, 0x2a, 0x9f, 0xf9, 0x04, 0xed, 0x8e, 0xd8, 0x59, 0x08, 0xfc, 0x20, 0x84, 0x44, 0x50, - 0x71, 0xae, 0x13, 0x35, 0x3c, 0x53, 0x16, 0xce, 0xee, 0xcb, 0x3f, 0x3a, 0xfe, 0xca, 0xa4, 0x39, - 0x40, 0xed, 0x33, 0x05, 0x7a, 0x91, 0x73, 0xed, 0x7c, 0x04, 0x01, 0x4b, 0xc2, 0x4c, 0xff, 0x0d, - 0x75, 0xcf, 0x92, 0x85, 0xd3, 0x1e, 0x6c, 0xe8, 0xfb, 0x1b, 0x55, 0xe6, 0x10, 0x35, 0x49, 0xf0, - 0x31, 0xa7, 0x1c, 0x8e, 0x69, 0x0c, 0x56, 0x55, 0x1f, 0xd6, 0xbd, 0xd9, 0x61, 0x0f, 0x69, 0xc0, - 0x99, 0x92, 0x79, 0xff, 0xcb, 0xc2, 0x69, 0x3e, 0x2f, 0x39, 0xfe, 0x32, 0xd4, 0x3c, 0x41, 0x0d, - 0x0e, 0x09, 0x7c, 0xd2, 0x0e, 0xb5, 0xbb, 0x39, 0xec, 0xc8, 0xc2, 0x69, 0xf8, 0x57, 0x14, 0xbf, - 0x04, 0x9a, 0xcf, 0x50, 0x4b, 0x27, 0x3b, 0xe6, 0x24, 0xc9, 0xa8, 0xca, 0x96, 0x59, 0x75, 0x7d, - 0x8b, 0xb6, 0x2c, 0x9c, 0xd6, 0x60, 0xa5, 0xe7, 0xaf, 0x4d, 0x7b, 0xaf, 0xa7, 0x33, 0xbb, 0x72, - 0x31, 0xb3, 0x2b, 0x97, 0x33, 0xbb, 0xf2, 0x45, 0xda, 0xc6, 0x54, 0xda, 0xc6, 0x85, 0xb4, 0x8d, - 0x4b, 0x69, 0x1b, 0x3f, 0xa5, 0x6d, 0x7c, 0xfd, 0x65, 0x57, 0xde, 0xf4, 0x6f, 0xff, 0x81, 0xfa, - 0x1d, 0x00, 0x00, 0xff, 0xff, 0x83, 0x64, 0x99, 0xfb, 0xd5, 0x04, 0x00, 0x00, -} - -func (m *Lease) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Lease) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Spec.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.ObjectMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *LeaseList) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseList) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseList) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Items) > 0 { - for iNdEx := len(m.Items) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Items[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - { - size, err := m.ListMeta.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *LeaseSpec) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *LeaseSpec) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *LeaseSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.LeaseTransitions != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.LeaseTransitions)) - i-- - dAtA[i] = 0x28 - } - if m.RenewTime != nil { - { - size, err := m.RenewTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.AcquireTime != nil { - { - size, err := m.AcquireTime.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenerated(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.LeaseDurationSeconds != nil { - i = encodeVarintGenerated(dAtA, i, uint64(*m.LeaseDurationSeconds)) - i-- - dAtA[i] = 0x10 - } - if m.HolderIdentity != nil { - i -= len(*m.HolderIdentity) - copy(dAtA[i:], *m.HolderIdentity) - i = encodeVarintGenerated(dAtA, i, uint64(len(*m.HolderIdentity))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGenerated(dAtA []byte, offset int, v uint64) int { - offset -= sovGenerated(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func (m *Lease) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ObjectMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - l = m.Spec.Size() - n += 1 + l + sovGenerated(uint64(l)) - return n -} - -func (m *LeaseList) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ListMeta.Size() - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Items) > 0 { - for _, e := range m.Items { - l = e.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - } - return n -} - -func (m *LeaseSpec) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.HolderIdentity != nil { - l = len(*m.HolderIdentity) - n += 1 + l + sovGenerated(uint64(l)) - } - if m.LeaseDurationSeconds != nil { - n += 1 + sovGenerated(uint64(*m.LeaseDurationSeconds)) - } - if m.AcquireTime != nil { - l = m.AcquireTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.RenewTime != nil { - l = m.RenewTime.Size() - n += 1 + l + sovGenerated(uint64(l)) - } - if m.LeaseTransitions != nil { - n += 1 + sovGenerated(uint64(*m.LeaseTransitions)) - } - return n -} - -func sovGenerated(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozGenerated(x uint64) (n int) { - return sovGenerated(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func (this *Lease) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{ - `&Lease{`, - `ObjectMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ObjectMeta), "ObjectMeta", "v1.ObjectMeta", 1), `&`, ``, 1) + `,`, - `Spec:` + strings.Replace(strings.Replace(this.Spec.String(), "LeaseSpec", "LeaseSpec", 1), `&`, ``, 1) + `,`, - `}`, - }, "") - return s -} - -func (this *LeaseList) String() string { - if this == nil { - return "nil" - } - repeatedStringForItems := "[]Lease{" - for _, f := range this.Items { - repeatedStringForItems += strings.Replace(strings.Replace(f.String(), "Lease", "Lease", 1), `&`, ``, 1) + "," - } - repeatedStringForItems += "}" - s := strings.Join([]string{ - `&LeaseList{`, - `ListMeta:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ListMeta), "ListMeta", "v1.ListMeta", 1), `&`, ``, 1) + `,`, - `Items:` + repeatedStringForItems + `,`, - `}`, - }, "") - return s -} - -func (this *LeaseSpec) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{ - `&LeaseSpec{`, - `HolderIdentity:` + valueToStringGenerated(this.HolderIdentity) + `,`, - `LeaseDurationSeconds:` + valueToStringGenerated(this.LeaseDurationSeconds) + `,`, - `AcquireTime:` + strings.Replace(fmt.Sprintf("%v", this.AcquireTime), "MicroTime", "v1.MicroTime", 1) + `,`, - `RenewTime:` + strings.Replace(fmt.Sprintf("%v", this.RenewTime), "MicroTime", "v1.MicroTime", 1) + `,`, - `LeaseTransitions:` + valueToStringGenerated(this.LeaseTransitions) + `,`, - `}`, - }, "") - return s -} - -func valueToStringGenerated(v any) string { - rv := reflect.ValueOf(v) - if rv.IsNil() { - return "nil" - } - pv := reflect.Indirect(rv).Interface() - return fmt.Sprintf("*%v", pv) -} - -func (m *Lease) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Lease: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Lease: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ObjectMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ObjectMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spec", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Spec.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *LeaseList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, Lease{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func (m *LeaseSpec) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: LeaseSpec: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: LeaseSpec: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HolderIdentity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - s := string(dAtA[iNdEx:postIndex]) - m.HolderIdentity = &s - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseDurationSeconds", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LeaseDurationSeconds = &v - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AcquireTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.AcquireTime == nil { - m.AcquireTime = &v1.MicroTime{} - } - if err := m.AcquireTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RenewTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RenewTime == nil { - m.RenewTime = &v1.MicroTime{} - } - if err := m.RenewTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field LeaseTransitions", wireType) - } - var v int32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.LeaseTransitions = &v - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} - -func skipGenerated(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenerated - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenerated - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") -) diff --git a/pkg/apis/coordination/v1/generated.proto b/pkg/apis/coordination/v1/generated.proto deleted file mode 100644 index 5c8759fe6bf..00000000000 --- a/pkg/apis/coordination/v1/generated.proto +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package github.com.superproj.onex.pkg.apis.coordination.v1; - -import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; - -// Package-wide variables from generator "generated". -option go_package = "github.com/superproj/onex/pkg/apis/coordination/v1"; - -// Lease defines a lease concept. -message Lease { - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ObjectMeta metadata = 1; - - // Specification of the Lease. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - optional LeaseSpec spec = 2; -} - -// LeaseList is a list of Lease objects. -message LeaseList { - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.ListMeta metadata = 1; - - // Items is a list of schema objects. - repeated Lease items = 2; -} - -// LeaseSpec is a specification of a Lease. -message LeaseSpec { - // holderIdentity contains the identity of the holder of a current lease. - // +optional - optional string holderIdentity = 1; - - // leaseDurationSeconds is a duration that candidates for a lease need - // to wait to force acquire it. This is measure against time of last - // observed RenewTime. - // +optional - optional int32 leaseDurationSeconds = 2; - - // acquireTime is a time when the current lease was acquired. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime acquireTime = 3; - - // renewTime is a time when the current holder of a lease has last - // updated the lease. - // +optional - optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime renewTime = 4; - - // leaseTransitions is the number of transitions of a lease between - // holders. - // +optional - optional int32 leaseTransitions = 5; -} - diff --git a/pkg/apis/coordination/v1/lease_types.go b/pkg/apis/coordination/v1/lease_types.go deleted file mode 100644 index b1362c3b52e..00000000000 --- a/pkg/apis/coordination/v1/lease_types.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package v1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// Lease defines a lease concept. -type Lease struct { - metav1.TypeMeta `json:",inline"` - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Specification of the Lease. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Spec LeaseSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` -} - -// LeaseSpec is a specification of a Lease. -type LeaseSpec struct { - // holderIdentity contains the identity of the holder of a current lease. - // +optional - HolderIdentity *string `json:"holderIdentity,omitempty" protobuf:"bytes,1,opt,name=holderIdentity"` - // leaseDurationSeconds is a duration that candidates for a lease need - // to wait to force acquire it. This is measure against time of last - // observed RenewTime. - // +optional - LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty" protobuf:"varint,2,opt,name=leaseDurationSeconds"` - // acquireTime is a time when the current lease was acquired. - // +optional - AcquireTime *metav1.MicroTime `json:"acquireTime,omitempty" protobuf:"bytes,3,opt,name=acquireTime"` - // renewTime is a time when the current holder of a lease has last - // updated the lease. - // +optional - RenewTime *metav1.MicroTime `json:"renewTime,omitempty" protobuf:"bytes,4,opt,name=renewTime"` - // leaseTransitions is the number of transitions of a lease between - // holders. - // +optional - LeaseTransitions *int32 `json:"leaseTransitions,omitempty" protobuf:"varint,5,opt,name=leaseTransitions"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// LeaseList is a list of Lease objects. -type LeaseList struct { - metav1.TypeMeta `json:",inline"` - // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` - - // Items is a list of schema objects. - Items []Lease `json:"items" protobuf:"bytes,2,rep,name=items"` -} diff --git a/pkg/apis/coordination/v1/register.go b/pkg/apis/coordination/v1/register.go deleted file mode 100644 index dfb843f9292..00000000000 --- a/pkg/apis/coordination/v1/register.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package v1 - -import ( - coordinationv1 "k8s.io/api/coordination/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package. -const GroupName = "coordination.k8s.io" - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api. - // localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to api.Scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &coordinationv1.Lease{}, - &coordinationv1.LeaseList{}, - ) - - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/apis/coordination/v1/types_swagger_doc_generated.go b/pkg/apis/coordination/v1/types_swagger_doc_generated.go deleted file mode 100644 index d11c212396f..00000000000 --- a/pkg/apis/coordination/v1/types_swagger_doc_generated.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -package v1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using scripts/update-generated-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -var map_Lease = map[string]string{ - "": "Lease defines a lease concept.", - "metadata": "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "spec": "Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", -} - -func (Lease) SwaggerDoc() map[string]string { - return map_Lease -} - -var map_LeaseList = map[string]string{ - "": "LeaseList is a list of Lease objects.", - "metadata": "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - "items": "Items is a list of schema objects.", -} - -func (LeaseList) SwaggerDoc() map[string]string { - return map_LeaseList -} - -var map_LeaseSpec = map[string]string{ - "": "LeaseSpec is a specification of a Lease.", - "holderIdentity": "holderIdentity contains the identity of the holder of a current lease.", - "leaseDurationSeconds": "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime.", - "acquireTime": "acquireTime is a time when the current lease was acquired.", - "renewTime": "renewTime is a time when the current holder of a lease has last updated the lease.", - "leaseTransitions": "leaseTransitions is the number of transitions of a lease between holders.", -} - -func (LeaseSpec) SwaggerDoc() map[string]string { - return map_LeaseSpec -} - -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/pkg/apis/coordination/v1/zz_generated.conversion.go b/pkg/apis/coordination/v1/zz_generated.conversion.go deleted file mode 100644 index 9611d9a0928..00000000000 --- a/pkg/apis/coordination/v1/zz_generated.conversion.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1 - -import ( - unsafe "unsafe" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - - coordination "github.com/superproj/onex/pkg/apis/coordination" -) - -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((*Lease)(nil), (*coordination.Lease)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Lease_To_coordination_Lease(a.(*Lease), b.(*coordination.Lease), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*coordination.Lease)(nil), (*Lease)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_coordination_Lease_To_v1_Lease(a.(*coordination.Lease), b.(*Lease), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LeaseList)(nil), (*coordination.LeaseList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LeaseList_To_coordination_LeaseList(a.(*LeaseList), b.(*coordination.LeaseList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*coordination.LeaseList)(nil), (*LeaseList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_coordination_LeaseList_To_v1_LeaseList(a.(*coordination.LeaseList), b.(*LeaseList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LeaseSpec)(nil), (*coordination.LeaseSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LeaseSpec_To_coordination_LeaseSpec(a.(*LeaseSpec), b.(*coordination.LeaseSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*coordination.LeaseSpec)(nil), (*LeaseSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_coordination_LeaseSpec_To_v1_LeaseSpec(a.(*coordination.LeaseSpec), b.(*LeaseSpec), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1_Lease_To_coordination_Lease(in *Lease, out *coordination.Lease, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_LeaseSpec_To_coordination_LeaseSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1_Lease_To_coordination_Lease is an autogenerated conversion function. -func Convert_v1_Lease_To_coordination_Lease(in *Lease, out *coordination.Lease, s conversion.Scope) error { - return autoConvert_v1_Lease_To_coordination_Lease(in, out, s) -} - -func autoConvert_coordination_Lease_To_v1_Lease(in *coordination.Lease, out *Lease, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_coordination_LeaseSpec_To_v1_LeaseSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_coordination_Lease_To_v1_Lease is an autogenerated conversion function. -func Convert_coordination_Lease_To_v1_Lease(in *coordination.Lease, out *Lease, s conversion.Scope) error { - return autoConvert_coordination_Lease_To_v1_Lease(in, out, s) -} - -func autoConvert_v1_LeaseList_To_coordination_LeaseList(in *LeaseList, out *coordination.LeaseList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]coordination.Lease)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_LeaseList_To_coordination_LeaseList is an autogenerated conversion function. -func Convert_v1_LeaseList_To_coordination_LeaseList(in *LeaseList, out *coordination.LeaseList, s conversion.Scope) error { - return autoConvert_v1_LeaseList_To_coordination_LeaseList(in, out, s) -} - -func autoConvert_coordination_LeaseList_To_v1_LeaseList(in *coordination.LeaseList, out *LeaseList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]Lease)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_coordination_LeaseList_To_v1_LeaseList is an autogenerated conversion function. -func Convert_coordination_LeaseList_To_v1_LeaseList(in *coordination.LeaseList, out *LeaseList, s conversion.Scope) error { - return autoConvert_coordination_LeaseList_To_v1_LeaseList(in, out, s) -} - -func autoConvert_v1_LeaseSpec_To_coordination_LeaseSpec(in *LeaseSpec, out *coordination.LeaseSpec, s conversion.Scope) error { - out.HolderIdentity = (*string)(unsafe.Pointer(in.HolderIdentity)) - out.LeaseDurationSeconds = (*int32)(unsafe.Pointer(in.LeaseDurationSeconds)) - out.AcquireTime = (*metav1.MicroTime)(unsafe.Pointer(in.AcquireTime)) - out.RenewTime = (*metav1.MicroTime)(unsafe.Pointer(in.RenewTime)) - out.LeaseTransitions = (*int32)(unsafe.Pointer(in.LeaseTransitions)) - return nil -} - -// Convert_v1_LeaseSpec_To_coordination_LeaseSpec is an autogenerated conversion function. -func Convert_v1_LeaseSpec_To_coordination_LeaseSpec(in *LeaseSpec, out *coordination.LeaseSpec, s conversion.Scope) error { - return autoConvert_v1_LeaseSpec_To_coordination_LeaseSpec(in, out, s) -} - -func autoConvert_coordination_LeaseSpec_To_v1_LeaseSpec(in *coordination.LeaseSpec, out *LeaseSpec, s conversion.Scope) error { - out.HolderIdentity = (*string)(unsafe.Pointer(in.HolderIdentity)) - out.LeaseDurationSeconds = (*int32)(unsafe.Pointer(in.LeaseDurationSeconds)) - out.AcquireTime = (*metav1.MicroTime)(unsafe.Pointer(in.AcquireTime)) - out.RenewTime = (*metav1.MicroTime)(unsafe.Pointer(in.RenewTime)) - out.LeaseTransitions = (*int32)(unsafe.Pointer(in.LeaseTransitions)) - return nil -} - -// Convert_coordination_LeaseSpec_To_v1_LeaseSpec is an autogenerated conversion function. -func Convert_coordination_LeaseSpec_To_v1_LeaseSpec(in *coordination.LeaseSpec, out *LeaseSpec, s conversion.Scope) error { - return autoConvert_coordination_LeaseSpec_To_v1_LeaseSpec(in, out, s) -} diff --git a/pkg/apis/coordination/v1/zz_generated.deepcopy.go b/pkg/apis/coordination/v1/zz_generated.deepcopy.go deleted file mode 100644 index 29e0992bf41..00000000000 --- a/pkg/apis/coordination/v1/zz_generated.deepcopy.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// 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 *Lease) DeepCopyInto(out *Lease) { - *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 Lease. -func (in *Lease) DeepCopy() *Lease { - if in == nil { - return nil - } - out := new(Lease) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Lease) 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 *LeaseList) DeepCopyInto(out *LeaseList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Lease, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseList. -func (in *LeaseList) DeepCopy() *LeaseList { - if in == nil { - return nil - } - out := new(LeaseList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeaseList) 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 *LeaseSpec) DeepCopyInto(out *LeaseSpec) { - *out = *in - if in.HolderIdentity != nil { - in, out := &in.HolderIdentity, &out.HolderIdentity - *out = new(string) - **out = **in - } - if in.LeaseDurationSeconds != nil { - in, out := &in.LeaseDurationSeconds, &out.LeaseDurationSeconds - *out = new(int32) - **out = **in - } - if in.AcquireTime != nil { - in, out := &in.AcquireTime, &out.AcquireTime - *out = (*in).DeepCopy() - } - if in.RenewTime != nil { - in, out := &in.RenewTime, &out.RenewTime - *out = (*in).DeepCopy() - } - if in.LeaseTransitions != nil { - in, out := &in.LeaseTransitions, &out.LeaseTransitions - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseSpec. -func (in *LeaseSpec) DeepCopy() *LeaseSpec { - if in == nil { - return nil - } - out := new(LeaseSpec) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/apis/coordination/v1/zz_generated.defaults.go b/pkg/apis/coordination/v1/zz_generated.defaults.go deleted file mode 100644 index 2d21fac50bd..00000000000 --- a/pkg/apis/coordination/v1/zz_generated.defaults.go +++ /dev/null @@ -1,22 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// 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/pkg/apis/coordination/validation/doc.go b/pkg/apis/coordination/validation/doc.go deleted file mode 100644 index ccdfbfcb946..00000000000 --- a/pkg/apis/coordination/validation/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package validation // import "github.com/superproj/onex/pkg/apis/coordination/validation" diff --git a/pkg/apis/coordination/validation/validation.go b/pkg/apis/coordination/validation/validation.go deleted file mode 100644 index 65c813168f1..00000000000 --- a/pkg/apis/coordination/validation/validation.go +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package validation - -import ( - apimachineryvalidation "k8s.io/apimachinery/pkg/api/validation" - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/superproj/onex/pkg/apis/coordination" -) - -// ValidateLease validates a Lease. -func ValidateLease(lease *coordination.Lease) field.ErrorList { - allErrs := apimachineryvalidation.ValidateObjectMeta( - &lease.ObjectMeta, - true, - apimachineryvalidation.NameIsDNSSubdomain, - field.NewPath("metadata"), - ) - allErrs = append(allErrs, ValidateLeaseSpec(&lease.Spec, field.NewPath("spec"))...) - return allErrs -} - -// ValidateLeaseUpdate validates an update of Lease object. -func ValidateLeaseUpdate(lease, oldLease *coordination.Lease) field.ErrorList { - allErrs := apimachineryvalidation.ValidateObjectMetaUpdate(&lease.ObjectMeta, &oldLease.ObjectMeta, field.NewPath("metadata")) - allErrs = append(allErrs, ValidateLeaseSpec(&lease.Spec, field.NewPath("spec"))...) - return allErrs -} - -// ValidateLeaseSpec validates spec of Lease. -func ValidateLeaseSpec(spec *coordination.LeaseSpec, fldPath *field.Path) field.ErrorList { - allErrs := field.ErrorList{} - - if spec.LeaseDurationSeconds != nil && *spec.LeaseDurationSeconds <= 0 { - fld := fldPath.Child("leaseDurationSeconds") - allErrs = append(allErrs, field.Invalid(fld, spec.LeaseDurationSeconds, "must be greater than 0")) - } - if spec.LeaseTransitions != nil && *spec.LeaseTransitions < 0 { - fld := fldPath.Child("leaseTransitions") - allErrs = append(allErrs, field.Invalid(fld, spec.LeaseTransitions, "must be greater than or equal to 0")) - } - return allErrs -} diff --git a/pkg/apis/coordination/validation/validation_test.go b/pkg/apis/coordination/validation/validation_test.go deleted file mode 100644 index 8ef82c98d6e..00000000000 --- a/pkg/apis/coordination/validation/validation_test.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package validation - -import ( - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/validation/field" - - "github.com/superproj/onex/pkg/apis/coordination" -) - -func TestValidateLease(t *testing.T) { - lease := &coordination.Lease{ - ObjectMeta: metav1.ObjectMeta{ - Name: "invalidName++", - Namespace: "==invalid_Namespace==", - }, - } - errs := ValidateLease(lease) - if len(errs) != 2 { - t.Errorf("unexpected list of errors: %#v", errs.ToAggregate().Error()) - } -} - -func TestValidateLeaseSpec(t *testing.T) { - holder := "holder" - leaseDuration := int32(0) - leaseTransitions := int32(-1) - spec := &coordination.LeaseSpec{ - HolderIdentity: &holder, - LeaseDurationSeconds: &leaseDuration, - LeaseTransitions: &leaseTransitions, - } - errs := ValidateLeaseSpec(spec, field.NewPath("foo")) - if len(errs) != 2 { - t.Errorf("unexpected list of errors: %#v", errs.ToAggregate().Error()) - } -} - -func TestValidateLeaseSpecUpdate(t *testing.T) { - holder := "holder" - leaseDuration := int32(0) - leaseTransitions := int32(-1) - lease := &coordination.Lease{ - ObjectMeta: metav1.ObjectMeta{ - Name: "holder", - Namespace: "holder-namespace", - }, - Spec: coordination.LeaseSpec{ - HolderIdentity: &holder, - LeaseDurationSeconds: &leaseDuration, - LeaseTransitions: &leaseTransitions, - }, - } - oldHolder := "oldHolder" - oldLeaseDuration := int32(3) - oldLeaseTransitions := int32(3) - oldLease := &coordination.Lease{ - ObjectMeta: metav1.ObjectMeta{ - Name: "holder", - Namespace: "holder-namespace", - }, - Spec: coordination.LeaseSpec{ - HolderIdentity: &oldHolder, - LeaseDurationSeconds: &oldLeaseDuration, - LeaseTransitions: &oldLeaseTransitions, - }, - } - errs := ValidateLeaseUpdate(lease, oldLease) - if len(errs) != 3 { - t.Errorf("unexpected list of errors: %#v", errs.ToAggregate().Error()) - } - - validLeaseDuration := int32(10) - validLeaseTransitions := int32(20) - validLease := &coordination.Lease{ - ObjectMeta: oldLease.ObjectMeta, - Spec: coordination.LeaseSpec{ - HolderIdentity: &holder, - LeaseDurationSeconds: &validLeaseDuration, - LeaseTransitions: &validLeaseTransitions, - }, - } - validLease.ObjectMeta.ResourceVersion = "2" - errs = ValidateLeaseUpdate(validLease, oldLease) - if len(errs) != 0 { - t.Errorf("unexpected list of errors for valid update: %#v", errs.ToAggregate().Error()) - } -} diff --git a/pkg/apis/coordination/zz_generated.deepcopy.go b/pkg/apis/coordination/zz_generated.deepcopy.go deleted file mode 100644 index 14a91e2b8af..00000000000 --- a/pkg/apis/coordination/zz_generated.deepcopy.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// Code generated by deepcopy-gen. DO NOT EDIT. - -package coordination - -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 *Lease) DeepCopyInto(out *Lease) { - *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 Lease. -func (in *Lease) DeepCopy() *Lease { - if in == nil { - return nil - } - out := new(Lease) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Lease) 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 *LeaseList) DeepCopyInto(out *LeaseList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Lease, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseList. -func (in *LeaseList) DeepCopy() *LeaseList { - if in == nil { - return nil - } - out := new(LeaseList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *LeaseList) 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 *LeaseSpec) DeepCopyInto(out *LeaseSpec) { - *out = *in - if in.HolderIdentity != nil { - in, out := &in.HolderIdentity, &out.HolderIdentity - *out = new(string) - **out = **in - } - if in.LeaseDurationSeconds != nil { - in, out := &in.LeaseDurationSeconds, &out.LeaseDurationSeconds - *out = new(int32) - **out = **in - } - if in.AcquireTime != nil { - in, out := &in.AcquireTime, &out.AcquireTime - *out = (*in).DeepCopy() - } - if in.RenewTime != nil { - in, out := &in.RenewTime, &out.RenewTime - *out = (*in).DeepCopy() - } - if in.LeaseTransitions != nil { - in, out := &in.LeaseTransitions, &out.LeaseTransitions - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LeaseSpec. -func (in *LeaseSpec) DeepCopy() *LeaseSpec { - if in == nil { - return nil - } - out := new(LeaseSpec) - in.DeepCopyInto(out) - return out -} diff --git a/pkg/apis/core/doc.go b/pkg/apis/core/doc.go deleted file mode 100644 index 22559cfe878..00000000000 --- a/pkg/apis/core/doc.go +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -// +k8s:deepcopy-gen=package - -// Package core contains the latest (or "internal") version of the -// OneX API objects. This is the API objects as represented in memory. -// The contract presented to clients is located in the versioned packages, -// which are sub-directories. The first one is "v1". -package core // import "github.com/superproj/onex/pkg/apis/core" diff --git a/pkg/apis/core/install/doc.go b/pkg/apis/core/install/doc.go deleted file mode 100644 index 704b5f9c1ad..00000000000 --- a/pkg/apis/core/install/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package install // import "github.com/superproj/onex/pkg/apis/core/install" diff --git a/pkg/apis/core/install/install.go b/pkg/apis/core/install/install.go deleted file mode 100644 index 60266121670..00000000000 --- a/pkg/apis/core/install/install.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -// Package install installs the v1 monolithic api, making it available as an -// option to all of the API encoding/decoding machinery. -package install - -import ( - "k8s.io/apimachinery/pkg/runtime" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/kubernetes/pkg/api/legacyscheme" - - api "github.com/superproj/onex/pkg/apis/core" - apiv1 "github.com/superproj/onex/pkg/apis/core/v1" -) - -func init() { - Install(legacyscheme.Scheme) -} - -// Install registers the API group and adds types to a scheme. -func Install(scheme *runtime.Scheme) { - utilruntime.Must(api.AddToScheme(scheme)) - utilruntime.Must(apiv1.AddToScheme(scheme)) - utilruntime.Must(scheme.SetVersionPriority(apiv1.SchemeGroupVersion)) -} diff --git a/pkg/apis/core/register.go b/pkg/apis/core/register.go deleted file mode 100644 index 5596a56ebd5..00000000000 --- a/pkg/apis/core/register.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package core - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/kubernetes/pkg/apis/core" -) - -var ( - // SchemeBuilder stores functions to add things to a scheme. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - // AddToScheme applies all stored functions t oa scheme. - AddToScheme = SchemeBuilder.AddToScheme -) - -// GroupName is the group name use in this package. -const GroupName = "" - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} - -// Kind takes an unqualified kind and returns a Group qualified GroupKind. -func Kind(kind string) schema.GroupKind { - return SchemeGroupVersion.WithKind(kind).GroupKind() -} - -// 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, - &core.Namespace{}, - &core.NamespaceList{}, - &core.ConfigMap{}, - &core.ConfigMapList{}, - &core.Secret{}, - &core.SecretList{}, - &core.Event{}, - &core.EventList{}, - ) - return nil -} diff --git a/pkg/apis/core/v1/doc.go b/pkg/apis/core/v1/doc.go deleted file mode 100644 index 11cd1a789b3..00000000000 --- a/pkg/apis/core/v1/doc.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -// +k8s:openapi-gen=true -// +k8s:deepcopy-gen=package -// +k8s:conversion-gen=github.com/superproj/onex/pkg/apis/core -// +k8s:conversion-gen=k8s.io/kubernetes/pkg/apis/core -// +k8s:conversion-gen-external-types=k8s.io/api/core/v1 -// +k8s:defaulter-gen-input=k8s.io/api/core/v1 -// +k8s:defaulter-gen=TypeMeta - -// Package v1 is the v1 version of the API. -package v1 // import "github.com/superproj/onex/pkg/apis/core/v1" diff --git a/pkg/apis/core/v1/register.go b/pkg/apis/core/v1/register.go deleted file mode 100644 index 607b3ce2c2c..00000000000 --- a/pkg/apis/core/v1/register.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. -// - -package v1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -// GroupName is the group name use in this package. -const GroupName = "" - -// SchemeGroupVersion is group version used to register these objects. -var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"} - -// Resource takes an unqualified resource and returns a Group qualified GroupResource. -func Resource(resource string) schema.GroupResource { - return SchemeGroupVersion.WithResource(resource).GroupResource() -} - -var ( - // 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. - SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - localSchemeBuilder = &SchemeBuilder - AddToScheme = localSchemeBuilder.AddToScheme -) - -// Adds the list of known types to the given scheme. -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(SchemeGroupVersion, - &corev1.Namespace{}, - &corev1.NamespaceList{}, - &corev1.ConfigMap{}, - &corev1.ConfigMapList{}, - &corev1.Secret{}, - &corev1.SecretList{}, - &corev1.Event{}, - &corev1.EventList{}, - ) - - // Add the watch version that applies - metav1.AddToGroupVersion(scheme, SchemeGroupVersion) - return nil -} diff --git a/pkg/apis/core/v1/types_swagger_doc_generated.go b/pkg/apis/core/v1/types_swagger_doc_generated.go deleted file mode 100644 index a5df02273e6..00000000000 --- a/pkg/apis/core/v1/types_swagger_doc_generated.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -package v1 - -// This file contains a collection of methods that can be used from go-restful to -// generate Swagger API documentation for its models. Please read this PR for more -// information on the implementation: https://github.com/emicklei/go-restful/pull/215 -// -// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if -// they are on one line! For multiple line or blocks that you want to ignore use ---. -// Any context after a --- is ignored. -// -// Those methods can be generated by using scripts/update-generated-swagger-docs.sh - -// AUTO-GENERATED FUNCTIONS START HERE. DO NOT EDIT. -// AUTO-GENERATED FUNCTIONS END HERE diff --git a/pkg/apis/core/v1/zz_generated.conversion.go b/pkg/apis/core/v1/zz_generated.conversion.go deleted file mode 100644 index 68ef45ceba1..00000000000 --- a/pkg/apis/core/v1/zz_generated.conversion.go +++ /dev/null @@ -1,8645 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1 - -import ( - url "net/url" - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - resource "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - types "k8s.io/apimachinery/pkg/types" - core "k8s.io/kubernetes/pkg/apis/core" - corev1 "k8s.io/kubernetes/pkg/apis/core/v1" -) - -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((*v1.AWSElasticBlockStoreVolumeSource)(nil), (*core.AWSElasticBlockStoreVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_AWSElasticBlockStoreVolumeSource_To_core_AWSElasticBlockStoreVolumeSource(a.(*v1.AWSElasticBlockStoreVolumeSource), b.(*core.AWSElasticBlockStoreVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.AWSElasticBlockStoreVolumeSource)(nil), (*v1.AWSElasticBlockStoreVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(a.(*core.AWSElasticBlockStoreVolumeSource), b.(*v1.AWSElasticBlockStoreVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Affinity)(nil), (*core.Affinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Affinity_To_core_Affinity(a.(*v1.Affinity), b.(*core.Affinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Affinity)(nil), (*v1.Affinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Affinity_To_v1_Affinity(a.(*core.Affinity), b.(*v1.Affinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.AttachedVolume)(nil), (*core.AttachedVolume)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_AttachedVolume_To_core_AttachedVolume(a.(*v1.AttachedVolume), b.(*core.AttachedVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.AttachedVolume)(nil), (*v1.AttachedVolume)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_AttachedVolume_To_v1_AttachedVolume(a.(*core.AttachedVolume), b.(*v1.AttachedVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.AvoidPods)(nil), (*core.AvoidPods)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_AvoidPods_To_core_AvoidPods(a.(*v1.AvoidPods), b.(*core.AvoidPods), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.AvoidPods)(nil), (*v1.AvoidPods)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_AvoidPods_To_v1_AvoidPods(a.(*core.AvoidPods), b.(*v1.AvoidPods), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.AzureDiskVolumeSource)(nil), (*core.AzureDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_AzureDiskVolumeSource_To_core_AzureDiskVolumeSource(a.(*v1.AzureDiskVolumeSource), b.(*core.AzureDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.AzureDiskVolumeSource)(nil), (*v1.AzureDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(a.(*core.AzureDiskVolumeSource), b.(*v1.AzureDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.AzureFilePersistentVolumeSource)(nil), (*core.AzureFilePersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_AzureFilePersistentVolumeSource_To_core_AzureFilePersistentVolumeSource(a.(*v1.AzureFilePersistentVolumeSource), b.(*core.AzureFilePersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.AzureFilePersistentVolumeSource)(nil), (*v1.AzureFilePersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_AzureFilePersistentVolumeSource_To_v1_AzureFilePersistentVolumeSource(a.(*core.AzureFilePersistentVolumeSource), b.(*v1.AzureFilePersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.AzureFileVolumeSource)(nil), (*core.AzureFileVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_AzureFileVolumeSource_To_core_AzureFileVolumeSource(a.(*v1.AzureFileVolumeSource), b.(*core.AzureFileVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.AzureFileVolumeSource)(nil), (*v1.AzureFileVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(a.(*core.AzureFileVolumeSource), b.(*v1.AzureFileVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Binding)(nil), (*core.Binding)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Binding_To_core_Binding(a.(*v1.Binding), b.(*core.Binding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Binding)(nil), (*v1.Binding)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Binding_To_v1_Binding(a.(*core.Binding), b.(*v1.Binding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.CSIPersistentVolumeSource)(nil), (*core.CSIPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_CSIPersistentVolumeSource_To_core_CSIPersistentVolumeSource(a.(*v1.CSIPersistentVolumeSource), b.(*core.CSIPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.CSIPersistentVolumeSource)(nil), (*v1.CSIPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(a.(*core.CSIPersistentVolumeSource), b.(*v1.CSIPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.CSIVolumeSource)(nil), (*core.CSIVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_CSIVolumeSource_To_core_CSIVolumeSource(a.(*v1.CSIVolumeSource), b.(*core.CSIVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.CSIVolumeSource)(nil), (*v1.CSIVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource(a.(*core.CSIVolumeSource), b.(*v1.CSIVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Capabilities)(nil), (*core.Capabilities)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Capabilities_To_core_Capabilities(a.(*v1.Capabilities), b.(*core.Capabilities), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Capabilities)(nil), (*v1.Capabilities)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Capabilities_To_v1_Capabilities(a.(*core.Capabilities), b.(*v1.Capabilities), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.CephFSPersistentVolumeSource)(nil), (*core.CephFSPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_CephFSPersistentVolumeSource_To_core_CephFSPersistentVolumeSource(a.(*v1.CephFSPersistentVolumeSource), b.(*core.CephFSPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.CephFSPersistentVolumeSource)(nil), (*v1.CephFSPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_CephFSPersistentVolumeSource_To_v1_CephFSPersistentVolumeSource(a.(*core.CephFSPersistentVolumeSource), b.(*v1.CephFSPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.CephFSVolumeSource)(nil), (*core.CephFSVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_CephFSVolumeSource_To_core_CephFSVolumeSource(a.(*v1.CephFSVolumeSource), b.(*core.CephFSVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.CephFSVolumeSource)(nil), (*v1.CephFSVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_CephFSVolumeSource_To_v1_CephFSVolumeSource(a.(*core.CephFSVolumeSource), b.(*v1.CephFSVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.CinderPersistentVolumeSource)(nil), (*core.CinderPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_CinderPersistentVolumeSource_To_core_CinderPersistentVolumeSource(a.(*v1.CinderPersistentVolumeSource), b.(*core.CinderPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.CinderPersistentVolumeSource)(nil), (*v1.CinderPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_CinderPersistentVolumeSource_To_v1_CinderPersistentVolumeSource(a.(*core.CinderPersistentVolumeSource), b.(*v1.CinderPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.CinderVolumeSource)(nil), (*core.CinderVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_CinderVolumeSource_To_core_CinderVolumeSource(a.(*v1.CinderVolumeSource), b.(*core.CinderVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.CinderVolumeSource)(nil), (*v1.CinderVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_CinderVolumeSource_To_v1_CinderVolumeSource(a.(*core.CinderVolumeSource), b.(*v1.CinderVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ClaimSource)(nil), (*core.ClaimSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ClaimSource_To_core_ClaimSource(a.(*v1.ClaimSource), b.(*core.ClaimSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ClaimSource)(nil), (*v1.ClaimSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ClaimSource_To_v1_ClaimSource(a.(*core.ClaimSource), b.(*v1.ClaimSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ClientIPConfig)(nil), (*core.ClientIPConfig)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ClientIPConfig_To_core_ClientIPConfig(a.(*v1.ClientIPConfig), b.(*core.ClientIPConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ClientIPConfig)(nil), (*v1.ClientIPConfig)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ClientIPConfig_To_v1_ClientIPConfig(a.(*core.ClientIPConfig), b.(*v1.ClientIPConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ClusterTrustBundleProjection)(nil), (*core.ClusterTrustBundleProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ClusterTrustBundleProjection_To_core_ClusterTrustBundleProjection(a.(*v1.ClusterTrustBundleProjection), b.(*core.ClusterTrustBundleProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ClusterTrustBundleProjection)(nil), (*v1.ClusterTrustBundleProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ClusterTrustBundleProjection_To_v1_ClusterTrustBundleProjection(a.(*core.ClusterTrustBundleProjection), b.(*v1.ClusterTrustBundleProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ComponentCondition)(nil), (*core.ComponentCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ComponentCondition_To_core_ComponentCondition(a.(*v1.ComponentCondition), b.(*core.ComponentCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ComponentCondition)(nil), (*v1.ComponentCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ComponentCondition_To_v1_ComponentCondition(a.(*core.ComponentCondition), b.(*v1.ComponentCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ComponentStatus)(nil), (*core.ComponentStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ComponentStatus_To_core_ComponentStatus(a.(*v1.ComponentStatus), b.(*core.ComponentStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ComponentStatus)(nil), (*v1.ComponentStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ComponentStatus_To_v1_ComponentStatus(a.(*core.ComponentStatus), b.(*v1.ComponentStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ComponentStatusList)(nil), (*core.ComponentStatusList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ComponentStatusList_To_core_ComponentStatusList(a.(*v1.ComponentStatusList), b.(*core.ComponentStatusList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ComponentStatusList)(nil), (*v1.ComponentStatusList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ComponentStatusList_To_v1_ComponentStatusList(a.(*core.ComponentStatusList), b.(*v1.ComponentStatusList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMap)(nil), (*core.ConfigMap)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMap_To_core_ConfigMap(a.(*v1.ConfigMap), b.(*core.ConfigMap), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMap)(nil), (*v1.ConfigMap)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMap_To_v1_ConfigMap(a.(*core.ConfigMap), b.(*v1.ConfigMap), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMapEnvSource)(nil), (*core.ConfigMapEnvSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMapEnvSource_To_core_ConfigMapEnvSource(a.(*v1.ConfigMapEnvSource), b.(*core.ConfigMapEnvSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMapEnvSource)(nil), (*v1.ConfigMapEnvSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMapEnvSource_To_v1_ConfigMapEnvSource(a.(*core.ConfigMapEnvSource), b.(*v1.ConfigMapEnvSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMapKeySelector)(nil), (*core.ConfigMapKeySelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMapKeySelector_To_core_ConfigMapKeySelector(a.(*v1.ConfigMapKeySelector), b.(*core.ConfigMapKeySelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMapKeySelector)(nil), (*v1.ConfigMapKeySelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(a.(*core.ConfigMapKeySelector), b.(*v1.ConfigMapKeySelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMapList)(nil), (*core.ConfigMapList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMapList_To_core_ConfigMapList(a.(*v1.ConfigMapList), b.(*core.ConfigMapList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMapList)(nil), (*v1.ConfigMapList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMapList_To_v1_ConfigMapList(a.(*core.ConfigMapList), b.(*v1.ConfigMapList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMapNodeConfigSource)(nil), (*core.ConfigMapNodeConfigSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMapNodeConfigSource_To_core_ConfigMapNodeConfigSource(a.(*v1.ConfigMapNodeConfigSource), b.(*core.ConfigMapNodeConfigSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMapNodeConfigSource)(nil), (*v1.ConfigMapNodeConfigSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMapNodeConfigSource_To_v1_ConfigMapNodeConfigSource(a.(*core.ConfigMapNodeConfigSource), b.(*v1.ConfigMapNodeConfigSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMapProjection)(nil), (*core.ConfigMapProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMapProjection_To_core_ConfigMapProjection(a.(*v1.ConfigMapProjection), b.(*core.ConfigMapProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMapProjection)(nil), (*v1.ConfigMapProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMapProjection_To_v1_ConfigMapProjection(a.(*core.ConfigMapProjection), b.(*v1.ConfigMapProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ConfigMapVolumeSource)(nil), (*core.ConfigMapVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ConfigMapVolumeSource_To_core_ConfigMapVolumeSource(a.(*v1.ConfigMapVolumeSource), b.(*core.ConfigMapVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ConfigMapVolumeSource)(nil), (*v1.ConfigMapVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(a.(*core.ConfigMapVolumeSource), b.(*v1.ConfigMapVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Container)(nil), (*core.Container)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Container_To_core_Container(a.(*v1.Container), b.(*core.Container), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Container)(nil), (*v1.Container)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Container_To_v1_Container(a.(*core.Container), b.(*v1.Container), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerImage)(nil), (*core.ContainerImage)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerImage_To_core_ContainerImage(a.(*v1.ContainerImage), b.(*core.ContainerImage), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerImage)(nil), (*v1.ContainerImage)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerImage_To_v1_ContainerImage(a.(*core.ContainerImage), b.(*v1.ContainerImage), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerPort)(nil), (*core.ContainerPort)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerPort_To_core_ContainerPort(a.(*v1.ContainerPort), b.(*core.ContainerPort), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerPort)(nil), (*v1.ContainerPort)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerPort_To_v1_ContainerPort(a.(*core.ContainerPort), b.(*v1.ContainerPort), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerResizePolicy)(nil), (*core.ContainerResizePolicy)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(a.(*v1.ContainerResizePolicy), b.(*core.ContainerResizePolicy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerResizePolicy)(nil), (*v1.ContainerResizePolicy)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(a.(*core.ContainerResizePolicy), b.(*v1.ContainerResizePolicy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerState)(nil), (*core.ContainerState)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerState_To_core_ContainerState(a.(*v1.ContainerState), b.(*core.ContainerState), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerState)(nil), (*v1.ContainerState)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerState_To_v1_ContainerState(a.(*core.ContainerState), b.(*v1.ContainerState), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerStateRunning)(nil), (*core.ContainerStateRunning)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerStateRunning_To_core_ContainerStateRunning(a.(*v1.ContainerStateRunning), b.(*core.ContainerStateRunning), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerStateRunning)(nil), (*v1.ContainerStateRunning)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerStateRunning_To_v1_ContainerStateRunning(a.(*core.ContainerStateRunning), b.(*v1.ContainerStateRunning), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerStateTerminated)(nil), (*core.ContainerStateTerminated)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerStateTerminated_To_core_ContainerStateTerminated(a.(*v1.ContainerStateTerminated), b.(*core.ContainerStateTerminated), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerStateTerminated)(nil), (*v1.ContainerStateTerminated)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerStateTerminated_To_v1_ContainerStateTerminated(a.(*core.ContainerStateTerminated), b.(*v1.ContainerStateTerminated), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerStateWaiting)(nil), (*core.ContainerStateWaiting)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerStateWaiting_To_core_ContainerStateWaiting(a.(*v1.ContainerStateWaiting), b.(*core.ContainerStateWaiting), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerStateWaiting)(nil), (*v1.ContainerStateWaiting)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerStateWaiting_To_v1_ContainerStateWaiting(a.(*core.ContainerStateWaiting), b.(*v1.ContainerStateWaiting), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ContainerStatus)(nil), (*core.ContainerStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ContainerStatus_To_core_ContainerStatus(a.(*v1.ContainerStatus), b.(*core.ContainerStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ContainerStatus)(nil), (*v1.ContainerStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ContainerStatus_To_v1_ContainerStatus(a.(*core.ContainerStatus), b.(*v1.ContainerStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.DaemonEndpoint)(nil), (*core.DaemonEndpoint)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_DaemonEndpoint_To_core_DaemonEndpoint(a.(*v1.DaemonEndpoint), b.(*core.DaemonEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.DaemonEndpoint)(nil), (*v1.DaemonEndpoint)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_DaemonEndpoint_To_v1_DaemonEndpoint(a.(*core.DaemonEndpoint), b.(*v1.DaemonEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.DownwardAPIProjection)(nil), (*core.DownwardAPIProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_DownwardAPIProjection_To_core_DownwardAPIProjection(a.(*v1.DownwardAPIProjection), b.(*core.DownwardAPIProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.DownwardAPIProjection)(nil), (*v1.DownwardAPIProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_DownwardAPIProjection_To_v1_DownwardAPIProjection(a.(*core.DownwardAPIProjection), b.(*v1.DownwardAPIProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.DownwardAPIVolumeFile)(nil), (*core.DownwardAPIVolumeFile)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_DownwardAPIVolumeFile_To_core_DownwardAPIVolumeFile(a.(*v1.DownwardAPIVolumeFile), b.(*core.DownwardAPIVolumeFile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.DownwardAPIVolumeFile)(nil), (*v1.DownwardAPIVolumeFile)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(a.(*core.DownwardAPIVolumeFile), b.(*v1.DownwardAPIVolumeFile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.DownwardAPIVolumeSource)(nil), (*core.DownwardAPIVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_DownwardAPIVolumeSource_To_core_DownwardAPIVolumeSource(a.(*v1.DownwardAPIVolumeSource), b.(*core.DownwardAPIVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.DownwardAPIVolumeSource)(nil), (*v1.DownwardAPIVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(a.(*core.DownwardAPIVolumeSource), b.(*v1.DownwardAPIVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EmptyDirVolumeSource)(nil), (*core.EmptyDirVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EmptyDirVolumeSource_To_core_EmptyDirVolumeSource(a.(*v1.EmptyDirVolumeSource), b.(*core.EmptyDirVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EmptyDirVolumeSource)(nil), (*v1.EmptyDirVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(a.(*core.EmptyDirVolumeSource), b.(*v1.EmptyDirVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EndpointAddress)(nil), (*core.EndpointAddress)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EndpointAddress_To_core_EndpointAddress(a.(*v1.EndpointAddress), b.(*core.EndpointAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EndpointAddress)(nil), (*v1.EndpointAddress)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EndpointAddress_To_v1_EndpointAddress(a.(*core.EndpointAddress), b.(*v1.EndpointAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EndpointPort)(nil), (*core.EndpointPort)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EndpointPort_To_core_EndpointPort(a.(*v1.EndpointPort), b.(*core.EndpointPort), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EndpointPort)(nil), (*v1.EndpointPort)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EndpointPort_To_v1_EndpointPort(a.(*core.EndpointPort), b.(*v1.EndpointPort), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EndpointSubset)(nil), (*core.EndpointSubset)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EndpointSubset_To_core_EndpointSubset(a.(*v1.EndpointSubset), b.(*core.EndpointSubset), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EndpointSubset)(nil), (*v1.EndpointSubset)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EndpointSubset_To_v1_EndpointSubset(a.(*core.EndpointSubset), b.(*v1.EndpointSubset), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Endpoints)(nil), (*core.Endpoints)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Endpoints_To_core_Endpoints(a.(*v1.Endpoints), b.(*core.Endpoints), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Endpoints)(nil), (*v1.Endpoints)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Endpoints_To_v1_Endpoints(a.(*core.Endpoints), b.(*v1.Endpoints), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EndpointsList)(nil), (*core.EndpointsList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EndpointsList_To_core_EndpointsList(a.(*v1.EndpointsList), b.(*core.EndpointsList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EndpointsList)(nil), (*v1.EndpointsList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EndpointsList_To_v1_EndpointsList(a.(*core.EndpointsList), b.(*v1.EndpointsList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EnvFromSource)(nil), (*core.EnvFromSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EnvFromSource_To_core_EnvFromSource(a.(*v1.EnvFromSource), b.(*core.EnvFromSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EnvFromSource)(nil), (*v1.EnvFromSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EnvFromSource_To_v1_EnvFromSource(a.(*core.EnvFromSource), b.(*v1.EnvFromSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EnvVar)(nil), (*core.EnvVar)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EnvVar_To_core_EnvVar(a.(*v1.EnvVar), b.(*core.EnvVar), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EnvVar)(nil), (*v1.EnvVar)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EnvVar_To_v1_EnvVar(a.(*core.EnvVar), b.(*v1.EnvVar), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EnvVarSource)(nil), (*core.EnvVarSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EnvVarSource_To_core_EnvVarSource(a.(*v1.EnvVarSource), b.(*core.EnvVarSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EnvVarSource)(nil), (*v1.EnvVarSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EnvVarSource_To_v1_EnvVarSource(a.(*core.EnvVarSource), b.(*v1.EnvVarSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EphemeralContainer)(nil), (*core.EphemeralContainer)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EphemeralContainer_To_core_EphemeralContainer(a.(*v1.EphemeralContainer), b.(*core.EphemeralContainer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EphemeralContainer)(nil), (*v1.EphemeralContainer)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EphemeralContainer_To_v1_EphemeralContainer(a.(*core.EphemeralContainer), b.(*v1.EphemeralContainer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EphemeralContainerCommon)(nil), (*core.EphemeralContainerCommon)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon(a.(*v1.EphemeralContainerCommon), b.(*core.EphemeralContainerCommon), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EphemeralContainerCommon)(nil), (*v1.EphemeralContainerCommon)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(a.(*core.EphemeralContainerCommon), b.(*v1.EphemeralContainerCommon), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EphemeralVolumeSource)(nil), (*core.EphemeralVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(a.(*v1.EphemeralVolumeSource), b.(*core.EphemeralVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EphemeralVolumeSource)(nil), (*v1.EphemeralVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource(a.(*core.EphemeralVolumeSource), b.(*v1.EphemeralVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Event)(nil), (*core.Event)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Event_To_core_Event(a.(*v1.Event), b.(*core.Event), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Event)(nil), (*v1.Event)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Event_To_v1_Event(a.(*core.Event), b.(*v1.Event), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EventList)(nil), (*core.EventList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EventList_To_core_EventList(a.(*v1.EventList), b.(*core.EventList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EventList)(nil), (*v1.EventList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EventList_To_v1_EventList(a.(*core.EventList), b.(*v1.EventList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EventSeries)(nil), (*core.EventSeries)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EventSeries_To_core_EventSeries(a.(*v1.EventSeries), b.(*core.EventSeries), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EventSeries)(nil), (*v1.EventSeries)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EventSeries_To_v1_EventSeries(a.(*core.EventSeries), b.(*v1.EventSeries), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.EventSource)(nil), (*core.EventSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_EventSource_To_core_EventSource(a.(*v1.EventSource), b.(*core.EventSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.EventSource)(nil), (*v1.EventSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_EventSource_To_v1_EventSource(a.(*core.EventSource), b.(*v1.EventSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ExecAction)(nil), (*core.ExecAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ExecAction_To_core_ExecAction(a.(*v1.ExecAction), b.(*core.ExecAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ExecAction)(nil), (*v1.ExecAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ExecAction_To_v1_ExecAction(a.(*core.ExecAction), b.(*v1.ExecAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.FCVolumeSource)(nil), (*core.FCVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_FCVolumeSource_To_core_FCVolumeSource(a.(*v1.FCVolumeSource), b.(*core.FCVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.FCVolumeSource)(nil), (*v1.FCVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_FCVolumeSource_To_v1_FCVolumeSource(a.(*core.FCVolumeSource), b.(*v1.FCVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.FlexPersistentVolumeSource)(nil), (*core.FlexPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_FlexPersistentVolumeSource_To_core_FlexPersistentVolumeSource(a.(*v1.FlexPersistentVolumeSource), b.(*core.FlexPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.FlexPersistentVolumeSource)(nil), (*v1.FlexPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_FlexPersistentVolumeSource_To_v1_FlexPersistentVolumeSource(a.(*core.FlexPersistentVolumeSource), b.(*v1.FlexPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.FlexVolumeSource)(nil), (*core.FlexVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_FlexVolumeSource_To_core_FlexVolumeSource(a.(*v1.FlexVolumeSource), b.(*core.FlexVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.FlexVolumeSource)(nil), (*v1.FlexVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_FlexVolumeSource_To_v1_FlexVolumeSource(a.(*core.FlexVolumeSource), b.(*v1.FlexVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.FlockerVolumeSource)(nil), (*core.FlockerVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_FlockerVolumeSource_To_core_FlockerVolumeSource(a.(*v1.FlockerVolumeSource), b.(*core.FlockerVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.FlockerVolumeSource)(nil), (*v1.FlockerVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_FlockerVolumeSource_To_v1_FlockerVolumeSource(a.(*core.FlockerVolumeSource), b.(*v1.FlockerVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.GCEPersistentDiskVolumeSource)(nil), (*core.GCEPersistentDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_GCEPersistentDiskVolumeSource_To_core_GCEPersistentDiskVolumeSource(a.(*v1.GCEPersistentDiskVolumeSource), b.(*core.GCEPersistentDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.GCEPersistentDiskVolumeSource)(nil), (*v1.GCEPersistentDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(a.(*core.GCEPersistentDiskVolumeSource), b.(*v1.GCEPersistentDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.GRPCAction)(nil), (*core.GRPCAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_GRPCAction_To_core_GRPCAction(a.(*v1.GRPCAction), b.(*core.GRPCAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.GRPCAction)(nil), (*v1.GRPCAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_GRPCAction_To_v1_GRPCAction(a.(*core.GRPCAction), b.(*v1.GRPCAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.GitRepoVolumeSource)(nil), (*core.GitRepoVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_GitRepoVolumeSource_To_core_GitRepoVolumeSource(a.(*v1.GitRepoVolumeSource), b.(*core.GitRepoVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.GitRepoVolumeSource)(nil), (*v1.GitRepoVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(a.(*core.GitRepoVolumeSource), b.(*v1.GitRepoVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.GlusterfsPersistentVolumeSource)(nil), (*core.GlusterfsPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_GlusterfsPersistentVolumeSource_To_core_GlusterfsPersistentVolumeSource(a.(*v1.GlusterfsPersistentVolumeSource), b.(*core.GlusterfsPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.GlusterfsPersistentVolumeSource)(nil), (*v1.GlusterfsPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_GlusterfsPersistentVolumeSource_To_v1_GlusterfsPersistentVolumeSource(a.(*core.GlusterfsPersistentVolumeSource), b.(*v1.GlusterfsPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.GlusterfsVolumeSource)(nil), (*core.GlusterfsVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_GlusterfsVolumeSource_To_core_GlusterfsVolumeSource(a.(*v1.GlusterfsVolumeSource), b.(*core.GlusterfsVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.GlusterfsVolumeSource)(nil), (*v1.GlusterfsVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(a.(*core.GlusterfsVolumeSource), b.(*v1.GlusterfsVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.HTTPGetAction)(nil), (*core.HTTPGetAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_HTTPGetAction_To_core_HTTPGetAction(a.(*v1.HTTPGetAction), b.(*core.HTTPGetAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.HTTPGetAction)(nil), (*v1.HTTPGetAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_HTTPGetAction_To_v1_HTTPGetAction(a.(*core.HTTPGetAction), b.(*v1.HTTPGetAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.HTTPHeader)(nil), (*core.HTTPHeader)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_HTTPHeader_To_core_HTTPHeader(a.(*v1.HTTPHeader), b.(*core.HTTPHeader), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.HTTPHeader)(nil), (*v1.HTTPHeader)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_HTTPHeader_To_v1_HTTPHeader(a.(*core.HTTPHeader), b.(*v1.HTTPHeader), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.HostAlias)(nil), (*core.HostAlias)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_HostAlias_To_core_HostAlias(a.(*v1.HostAlias), b.(*core.HostAlias), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.HostAlias)(nil), (*v1.HostAlias)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_HostAlias_To_v1_HostAlias(a.(*core.HostAlias), b.(*v1.HostAlias), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.HostIP)(nil), (*core.HostIP)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_HostIP_To_core_HostIP(a.(*v1.HostIP), b.(*core.HostIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.HostIP)(nil), (*v1.HostIP)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_HostIP_To_v1_HostIP(a.(*core.HostIP), b.(*v1.HostIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.HostPathVolumeSource)(nil), (*core.HostPathVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_HostPathVolumeSource_To_core_HostPathVolumeSource(a.(*v1.HostPathVolumeSource), b.(*core.HostPathVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.HostPathVolumeSource)(nil), (*v1.HostPathVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_HostPathVolumeSource_To_v1_HostPathVolumeSource(a.(*core.HostPathVolumeSource), b.(*v1.HostPathVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ISCSIPersistentVolumeSource)(nil), (*core.ISCSIPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ISCSIPersistentVolumeSource_To_core_ISCSIPersistentVolumeSource(a.(*v1.ISCSIPersistentVolumeSource), b.(*core.ISCSIPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ISCSIPersistentVolumeSource)(nil), (*v1.ISCSIPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ISCSIPersistentVolumeSource_To_v1_ISCSIPersistentVolumeSource(a.(*core.ISCSIPersistentVolumeSource), b.(*v1.ISCSIPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ISCSIVolumeSource)(nil), (*core.ISCSIVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ISCSIVolumeSource_To_core_ISCSIVolumeSource(a.(*v1.ISCSIVolumeSource), b.(*core.ISCSIVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ISCSIVolumeSource)(nil), (*v1.ISCSIVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(a.(*core.ISCSIVolumeSource), b.(*v1.ISCSIVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.KeyToPath)(nil), (*core.KeyToPath)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_KeyToPath_To_core_KeyToPath(a.(*v1.KeyToPath), b.(*core.KeyToPath), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.KeyToPath)(nil), (*v1.KeyToPath)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_KeyToPath_To_v1_KeyToPath(a.(*core.KeyToPath), b.(*v1.KeyToPath), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Lifecycle)(nil), (*core.Lifecycle)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Lifecycle_To_core_Lifecycle(a.(*v1.Lifecycle), b.(*core.Lifecycle), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Lifecycle)(nil), (*v1.Lifecycle)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Lifecycle_To_v1_Lifecycle(a.(*core.Lifecycle), b.(*v1.Lifecycle), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LifecycleHandler)(nil), (*core.LifecycleHandler)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LifecycleHandler_To_core_LifecycleHandler(a.(*v1.LifecycleHandler), b.(*core.LifecycleHandler), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LifecycleHandler)(nil), (*v1.LifecycleHandler)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LifecycleHandler_To_v1_LifecycleHandler(a.(*core.LifecycleHandler), b.(*v1.LifecycleHandler), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LimitRange)(nil), (*core.LimitRange)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LimitRange_To_core_LimitRange(a.(*v1.LimitRange), b.(*core.LimitRange), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LimitRange)(nil), (*v1.LimitRange)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LimitRange_To_v1_LimitRange(a.(*core.LimitRange), b.(*v1.LimitRange), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LimitRangeItem)(nil), (*core.LimitRangeItem)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LimitRangeItem_To_core_LimitRangeItem(a.(*v1.LimitRangeItem), b.(*core.LimitRangeItem), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LimitRangeItem)(nil), (*v1.LimitRangeItem)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LimitRangeItem_To_v1_LimitRangeItem(a.(*core.LimitRangeItem), b.(*v1.LimitRangeItem), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LimitRangeList)(nil), (*core.LimitRangeList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LimitRangeList_To_core_LimitRangeList(a.(*v1.LimitRangeList), b.(*core.LimitRangeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LimitRangeList)(nil), (*v1.LimitRangeList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LimitRangeList_To_v1_LimitRangeList(a.(*core.LimitRangeList), b.(*v1.LimitRangeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LimitRangeSpec)(nil), (*core.LimitRangeSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LimitRangeSpec_To_core_LimitRangeSpec(a.(*v1.LimitRangeSpec), b.(*core.LimitRangeSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LimitRangeSpec)(nil), (*v1.LimitRangeSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LimitRangeSpec_To_v1_LimitRangeSpec(a.(*core.LimitRangeSpec), b.(*v1.LimitRangeSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.List)(nil), (*core.List)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_List_To_core_List(a.(*v1.List), b.(*core.List), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.List)(nil), (*v1.List)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_List_To_v1_List(a.(*core.List), b.(*v1.List), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LoadBalancerIngress)(nil), (*core.LoadBalancerIngress)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LoadBalancerIngress_To_core_LoadBalancerIngress(a.(*v1.LoadBalancerIngress), b.(*core.LoadBalancerIngress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LoadBalancerIngress)(nil), (*v1.LoadBalancerIngress)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LoadBalancerIngress_To_v1_LoadBalancerIngress(a.(*core.LoadBalancerIngress), b.(*v1.LoadBalancerIngress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LocalObjectReference)(nil), (*core.LocalObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LocalObjectReference_To_core_LocalObjectReference(a.(*v1.LocalObjectReference), b.(*core.LocalObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LocalObjectReference)(nil), (*v1.LocalObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LocalObjectReference_To_v1_LocalObjectReference(a.(*core.LocalObjectReference), b.(*v1.LocalObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.LocalVolumeSource)(nil), (*core.LocalVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_LocalVolumeSource_To_core_LocalVolumeSource(a.(*v1.LocalVolumeSource), b.(*core.LocalVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.LocalVolumeSource)(nil), (*v1.LocalVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_LocalVolumeSource_To_v1_LocalVolumeSource(a.(*core.LocalVolumeSource), b.(*v1.LocalVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ModifyVolumeStatus)(nil), (*core.ModifyVolumeStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ModifyVolumeStatus_To_core_ModifyVolumeStatus(a.(*v1.ModifyVolumeStatus), b.(*core.ModifyVolumeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ModifyVolumeStatus)(nil), (*v1.ModifyVolumeStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ModifyVolumeStatus_To_v1_ModifyVolumeStatus(a.(*core.ModifyVolumeStatus), b.(*v1.ModifyVolumeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NFSVolumeSource)(nil), (*core.NFSVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NFSVolumeSource_To_core_NFSVolumeSource(a.(*v1.NFSVolumeSource), b.(*core.NFSVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NFSVolumeSource)(nil), (*v1.NFSVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NFSVolumeSource_To_v1_NFSVolumeSource(a.(*core.NFSVolumeSource), b.(*v1.NFSVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Namespace)(nil), (*core.Namespace)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Namespace_To_core_Namespace(a.(*v1.Namespace), b.(*core.Namespace), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Namespace)(nil), (*v1.Namespace)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Namespace_To_v1_Namespace(a.(*core.Namespace), b.(*v1.Namespace), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NamespaceCondition)(nil), (*core.NamespaceCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NamespaceCondition_To_core_NamespaceCondition(a.(*v1.NamespaceCondition), b.(*core.NamespaceCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NamespaceCondition)(nil), (*v1.NamespaceCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NamespaceCondition_To_v1_NamespaceCondition(a.(*core.NamespaceCondition), b.(*v1.NamespaceCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NamespaceList)(nil), (*core.NamespaceList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NamespaceList_To_core_NamespaceList(a.(*v1.NamespaceList), b.(*core.NamespaceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NamespaceList)(nil), (*v1.NamespaceList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NamespaceList_To_v1_NamespaceList(a.(*core.NamespaceList), b.(*v1.NamespaceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NamespaceSpec)(nil), (*core.NamespaceSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NamespaceSpec_To_core_NamespaceSpec(a.(*v1.NamespaceSpec), b.(*core.NamespaceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NamespaceSpec)(nil), (*v1.NamespaceSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NamespaceSpec_To_v1_NamespaceSpec(a.(*core.NamespaceSpec), b.(*v1.NamespaceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NamespaceStatus)(nil), (*core.NamespaceStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NamespaceStatus_To_core_NamespaceStatus(a.(*v1.NamespaceStatus), b.(*core.NamespaceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NamespaceStatus)(nil), (*v1.NamespaceStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NamespaceStatus_To_v1_NamespaceStatus(a.(*core.NamespaceStatus), b.(*v1.NamespaceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Node)(nil), (*core.Node)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Node_To_core_Node(a.(*v1.Node), b.(*core.Node), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Node)(nil), (*v1.Node)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Node_To_v1_Node(a.(*core.Node), b.(*v1.Node), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeAddress)(nil), (*core.NodeAddress)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeAddress_To_core_NodeAddress(a.(*v1.NodeAddress), b.(*core.NodeAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeAddress)(nil), (*v1.NodeAddress)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeAddress_To_v1_NodeAddress(a.(*core.NodeAddress), b.(*v1.NodeAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeAffinity)(nil), (*core.NodeAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeAffinity_To_core_NodeAffinity(a.(*v1.NodeAffinity), b.(*core.NodeAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeAffinity)(nil), (*v1.NodeAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeAffinity_To_v1_NodeAffinity(a.(*core.NodeAffinity), b.(*v1.NodeAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeCondition)(nil), (*core.NodeCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeCondition_To_core_NodeCondition(a.(*v1.NodeCondition), b.(*core.NodeCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeCondition)(nil), (*v1.NodeCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeCondition_To_v1_NodeCondition(a.(*core.NodeCondition), b.(*v1.NodeCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeConfigSource)(nil), (*core.NodeConfigSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeConfigSource_To_core_NodeConfigSource(a.(*v1.NodeConfigSource), b.(*core.NodeConfigSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeConfigSource)(nil), (*v1.NodeConfigSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeConfigSource_To_v1_NodeConfigSource(a.(*core.NodeConfigSource), b.(*v1.NodeConfigSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeConfigStatus)(nil), (*core.NodeConfigStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeConfigStatus_To_core_NodeConfigStatus(a.(*v1.NodeConfigStatus), b.(*core.NodeConfigStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeConfigStatus)(nil), (*v1.NodeConfigStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeConfigStatus_To_v1_NodeConfigStatus(a.(*core.NodeConfigStatus), b.(*v1.NodeConfigStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeDaemonEndpoints)(nil), (*core.NodeDaemonEndpoints)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints(a.(*v1.NodeDaemonEndpoints), b.(*core.NodeDaemonEndpoints), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeDaemonEndpoints)(nil), (*v1.NodeDaemonEndpoints)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(a.(*core.NodeDaemonEndpoints), b.(*v1.NodeDaemonEndpoints), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeList)(nil), (*core.NodeList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeList_To_core_NodeList(a.(*v1.NodeList), b.(*core.NodeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeList)(nil), (*v1.NodeList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeList_To_v1_NodeList(a.(*core.NodeList), b.(*v1.NodeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeProxyOptions)(nil), (*core.NodeProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeProxyOptions_To_core_NodeProxyOptions(a.(*v1.NodeProxyOptions), b.(*core.NodeProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeProxyOptions)(nil), (*v1.NodeProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeProxyOptions_To_v1_NodeProxyOptions(a.(*core.NodeProxyOptions), b.(*v1.NodeProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeResources)(nil), (*core.NodeResources)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeResources_To_core_NodeResources(a.(*v1.NodeResources), b.(*core.NodeResources), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeResources)(nil), (*v1.NodeResources)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeResources_To_v1_NodeResources(a.(*core.NodeResources), b.(*v1.NodeResources), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeSelector)(nil), (*core.NodeSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeSelector_To_core_NodeSelector(a.(*v1.NodeSelector), b.(*core.NodeSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeSelector)(nil), (*v1.NodeSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeSelector_To_v1_NodeSelector(a.(*core.NodeSelector), b.(*v1.NodeSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeSelectorRequirement)(nil), (*core.NodeSelectorRequirement)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeSelectorRequirement_To_core_NodeSelectorRequirement(a.(*v1.NodeSelectorRequirement), b.(*core.NodeSelectorRequirement), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeSelectorRequirement)(nil), (*v1.NodeSelectorRequirement)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(a.(*core.NodeSelectorRequirement), b.(*v1.NodeSelectorRequirement), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeSelectorTerm)(nil), (*core.NodeSelectorTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm(a.(*v1.NodeSelectorTerm), b.(*core.NodeSelectorTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeSelectorTerm)(nil), (*v1.NodeSelectorTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm(a.(*core.NodeSelectorTerm), b.(*v1.NodeSelectorTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeStatus)(nil), (*core.NodeStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeStatus_To_core_NodeStatus(a.(*v1.NodeStatus), b.(*core.NodeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeStatus)(nil), (*v1.NodeStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeStatus_To_v1_NodeStatus(a.(*core.NodeStatus), b.(*v1.NodeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.NodeSystemInfo)(nil), (*core.NodeSystemInfo)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_NodeSystemInfo_To_core_NodeSystemInfo(a.(*v1.NodeSystemInfo), b.(*core.NodeSystemInfo), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.NodeSystemInfo)(nil), (*v1.NodeSystemInfo)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_NodeSystemInfo_To_v1_NodeSystemInfo(a.(*core.NodeSystemInfo), b.(*v1.NodeSystemInfo), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ObjectFieldSelector)(nil), (*core.ObjectFieldSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ObjectFieldSelector_To_core_ObjectFieldSelector(a.(*v1.ObjectFieldSelector), b.(*core.ObjectFieldSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ObjectFieldSelector)(nil), (*v1.ObjectFieldSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ObjectFieldSelector_To_v1_ObjectFieldSelector(a.(*core.ObjectFieldSelector), b.(*v1.ObjectFieldSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ObjectReference)(nil), (*core.ObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ObjectReference_To_core_ObjectReference(a.(*v1.ObjectReference), b.(*core.ObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ObjectReference)(nil), (*v1.ObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ObjectReference_To_v1_ObjectReference(a.(*core.ObjectReference), b.(*v1.ObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolume)(nil), (*core.PersistentVolume)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolume_To_core_PersistentVolume(a.(*v1.PersistentVolume), b.(*core.PersistentVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolume)(nil), (*v1.PersistentVolume)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolume_To_v1_PersistentVolume(a.(*core.PersistentVolume), b.(*v1.PersistentVolume), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaim)(nil), (*core.PersistentVolumeClaim)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaim_To_core_PersistentVolumeClaim(a.(*v1.PersistentVolumeClaim), b.(*core.PersistentVolumeClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaim)(nil), (*v1.PersistentVolumeClaim)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(a.(*core.PersistentVolumeClaim), b.(*v1.PersistentVolumeClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimCondition)(nil), (*core.PersistentVolumeClaimCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaimCondition_To_core_PersistentVolumeClaimCondition(a.(*v1.PersistentVolumeClaimCondition), b.(*core.PersistentVolumeClaimCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimCondition)(nil), (*v1.PersistentVolumeClaimCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaimCondition_To_v1_PersistentVolumeClaimCondition(a.(*core.PersistentVolumeClaimCondition), b.(*v1.PersistentVolumeClaimCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimList)(nil), (*core.PersistentVolumeClaimList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaimList_To_core_PersistentVolumeClaimList(a.(*v1.PersistentVolumeClaimList), b.(*core.PersistentVolumeClaimList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimList)(nil), (*v1.PersistentVolumeClaimList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(a.(*core.PersistentVolumeClaimList), b.(*v1.PersistentVolumeClaimList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimSpec)(nil), (*core.PersistentVolumeClaimSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(a.(*v1.PersistentVolumeClaimSpec), b.(*core.PersistentVolumeClaimSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimSpec)(nil), (*v1.PersistentVolumeClaimSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(a.(*core.PersistentVolumeClaimSpec), b.(*v1.PersistentVolumeClaimSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimStatus)(nil), (*core.PersistentVolumeClaimStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus(a.(*v1.PersistentVolumeClaimStatus), b.(*core.PersistentVolumeClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimStatus)(nil), (*v1.PersistentVolumeClaimStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(a.(*core.PersistentVolumeClaimStatus), b.(*v1.PersistentVolumeClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimTemplate)(nil), (*core.PersistentVolumeClaimTemplate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaimTemplate_To_core_PersistentVolumeClaimTemplate(a.(*v1.PersistentVolumeClaimTemplate), b.(*core.PersistentVolumeClaimTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimTemplate)(nil), (*v1.PersistentVolumeClaimTemplate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaimTemplate_To_v1_PersistentVolumeClaimTemplate(a.(*core.PersistentVolumeClaimTemplate), b.(*v1.PersistentVolumeClaimTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeClaimVolumeSource)(nil), (*core.PersistentVolumeClaimVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeClaimVolumeSource_To_core_PersistentVolumeClaimVolumeSource(a.(*v1.PersistentVolumeClaimVolumeSource), b.(*core.PersistentVolumeClaimVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeClaimVolumeSource)(nil), (*v1.PersistentVolumeClaimVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(a.(*core.PersistentVolumeClaimVolumeSource), b.(*v1.PersistentVolumeClaimVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeList)(nil), (*core.PersistentVolumeList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeList_To_core_PersistentVolumeList(a.(*v1.PersistentVolumeList), b.(*core.PersistentVolumeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeList)(nil), (*v1.PersistentVolumeList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeList_To_v1_PersistentVolumeList(a.(*core.PersistentVolumeList), b.(*v1.PersistentVolumeList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeSource)(nil), (*core.PersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource(a.(*v1.PersistentVolumeSource), b.(*core.PersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeSource)(nil), (*v1.PersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource(a.(*core.PersistentVolumeSource), b.(*v1.PersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PersistentVolumeStatus)(nil), (*core.PersistentVolumeStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus(a.(*v1.PersistentVolumeStatus), b.(*core.PersistentVolumeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PersistentVolumeStatus)(nil), (*v1.PersistentVolumeStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(a.(*core.PersistentVolumeStatus), b.(*v1.PersistentVolumeStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PhotonPersistentDiskVolumeSource)(nil), (*core.PhotonPersistentDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PhotonPersistentDiskVolumeSource_To_core_PhotonPersistentDiskVolumeSource(a.(*v1.PhotonPersistentDiskVolumeSource), b.(*core.PhotonPersistentDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PhotonPersistentDiskVolumeSource)(nil), (*v1.PhotonPersistentDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolumeSource(a.(*core.PhotonPersistentDiskVolumeSource), b.(*v1.PhotonPersistentDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodAffinity)(nil), (*core.PodAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodAffinity_To_core_PodAffinity(a.(*v1.PodAffinity), b.(*core.PodAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodAffinity)(nil), (*v1.PodAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodAffinity_To_v1_PodAffinity(a.(*core.PodAffinity), b.(*v1.PodAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodAffinityTerm)(nil), (*core.PodAffinityTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodAffinityTerm_To_core_PodAffinityTerm(a.(*v1.PodAffinityTerm), b.(*core.PodAffinityTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodAffinityTerm)(nil), (*v1.PodAffinityTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodAffinityTerm_To_v1_PodAffinityTerm(a.(*core.PodAffinityTerm), b.(*v1.PodAffinityTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodAntiAffinity)(nil), (*core.PodAntiAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodAntiAffinity_To_core_PodAntiAffinity(a.(*v1.PodAntiAffinity), b.(*core.PodAntiAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodAntiAffinity)(nil), (*v1.PodAntiAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodAntiAffinity_To_v1_PodAntiAffinity(a.(*core.PodAntiAffinity), b.(*v1.PodAntiAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodAttachOptions)(nil), (*core.PodAttachOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodAttachOptions_To_core_PodAttachOptions(a.(*v1.PodAttachOptions), b.(*core.PodAttachOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodAttachOptions)(nil), (*v1.PodAttachOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodAttachOptions_To_v1_PodAttachOptions(a.(*core.PodAttachOptions), b.(*v1.PodAttachOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodCondition)(nil), (*core.PodCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodCondition_To_core_PodCondition(a.(*v1.PodCondition), b.(*core.PodCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodCondition)(nil), (*v1.PodCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodCondition_To_v1_PodCondition(a.(*core.PodCondition), b.(*v1.PodCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodDNSConfig)(nil), (*core.PodDNSConfig)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodDNSConfig_To_core_PodDNSConfig(a.(*v1.PodDNSConfig), b.(*core.PodDNSConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodDNSConfig)(nil), (*v1.PodDNSConfig)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodDNSConfig_To_v1_PodDNSConfig(a.(*core.PodDNSConfig), b.(*v1.PodDNSConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodDNSConfigOption)(nil), (*core.PodDNSConfigOption)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodDNSConfigOption_To_core_PodDNSConfigOption(a.(*v1.PodDNSConfigOption), b.(*core.PodDNSConfigOption), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodDNSConfigOption)(nil), (*v1.PodDNSConfigOption)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodDNSConfigOption_To_v1_PodDNSConfigOption(a.(*core.PodDNSConfigOption), b.(*v1.PodDNSConfigOption), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodExecOptions)(nil), (*core.PodExecOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodExecOptions_To_core_PodExecOptions(a.(*v1.PodExecOptions), b.(*core.PodExecOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodExecOptions)(nil), (*v1.PodExecOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodExecOptions_To_v1_PodExecOptions(a.(*core.PodExecOptions), b.(*v1.PodExecOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodIP)(nil), (*core.PodIP)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodIP_To_core_PodIP(a.(*v1.PodIP), b.(*core.PodIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodIP)(nil), (*v1.PodIP)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodIP_To_v1_PodIP(a.(*core.PodIP), b.(*v1.PodIP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodList)(nil), (*core.PodList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodList_To_core_PodList(a.(*v1.PodList), b.(*core.PodList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodList)(nil), (*v1.PodList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodList_To_v1_PodList(a.(*core.PodList), b.(*v1.PodList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodLogOptions)(nil), (*core.PodLogOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodLogOptions_To_core_PodLogOptions(a.(*v1.PodLogOptions), b.(*core.PodLogOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodLogOptions)(nil), (*v1.PodLogOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodLogOptions_To_v1_PodLogOptions(a.(*core.PodLogOptions), b.(*v1.PodLogOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodOS)(nil), (*core.PodOS)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodOS_To_core_PodOS(a.(*v1.PodOS), b.(*core.PodOS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodOS)(nil), (*v1.PodOS)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodOS_To_v1_PodOS(a.(*core.PodOS), b.(*v1.PodOS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodPortForwardOptions)(nil), (*core.PodPortForwardOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodPortForwardOptions_To_core_PodPortForwardOptions(a.(*v1.PodPortForwardOptions), b.(*core.PodPortForwardOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodPortForwardOptions)(nil), (*v1.PodPortForwardOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodPortForwardOptions_To_v1_PodPortForwardOptions(a.(*core.PodPortForwardOptions), b.(*v1.PodPortForwardOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodProxyOptions)(nil), (*core.PodProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodProxyOptions_To_core_PodProxyOptions(a.(*v1.PodProxyOptions), b.(*core.PodProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodProxyOptions)(nil), (*v1.PodProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodProxyOptions_To_v1_PodProxyOptions(a.(*core.PodProxyOptions), b.(*v1.PodProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodReadinessGate)(nil), (*core.PodReadinessGate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodReadinessGate_To_core_PodReadinessGate(a.(*v1.PodReadinessGate), b.(*core.PodReadinessGate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodReadinessGate)(nil), (*v1.PodReadinessGate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodReadinessGate_To_v1_PodReadinessGate(a.(*core.PodReadinessGate), b.(*v1.PodReadinessGate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodResourceClaim)(nil), (*core.PodResourceClaim)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodResourceClaim_To_core_PodResourceClaim(a.(*v1.PodResourceClaim), b.(*core.PodResourceClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodResourceClaim)(nil), (*v1.PodResourceClaim)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodResourceClaim_To_v1_PodResourceClaim(a.(*core.PodResourceClaim), b.(*v1.PodResourceClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodResourceClaimStatus)(nil), (*core.PodResourceClaimStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodResourceClaimStatus_To_core_PodResourceClaimStatus(a.(*v1.PodResourceClaimStatus), b.(*core.PodResourceClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodResourceClaimStatus)(nil), (*v1.PodResourceClaimStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodResourceClaimStatus_To_v1_PodResourceClaimStatus(a.(*core.PodResourceClaimStatus), b.(*v1.PodResourceClaimStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodSchedulingGate)(nil), (*core.PodSchedulingGate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodSchedulingGate_To_core_PodSchedulingGate(a.(*v1.PodSchedulingGate), b.(*core.PodSchedulingGate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodSchedulingGate)(nil), (*v1.PodSchedulingGate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodSchedulingGate_To_v1_PodSchedulingGate(a.(*core.PodSchedulingGate), b.(*v1.PodSchedulingGate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodSecurityContext)(nil), (*core.PodSecurityContext)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodSecurityContext_To_core_PodSecurityContext(a.(*v1.PodSecurityContext), b.(*core.PodSecurityContext), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodSecurityContext)(nil), (*v1.PodSecurityContext)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodSecurityContext_To_v1_PodSecurityContext(a.(*core.PodSecurityContext), b.(*v1.PodSecurityContext), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodSignature)(nil), (*core.PodSignature)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodSignature_To_core_PodSignature(a.(*v1.PodSignature), b.(*core.PodSignature), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodSignature)(nil), (*v1.PodSignature)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodSignature_To_v1_PodSignature(a.(*core.PodSignature), b.(*v1.PodSignature), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodStatusResult)(nil), (*core.PodStatusResult)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodStatusResult_To_core_PodStatusResult(a.(*v1.PodStatusResult), b.(*core.PodStatusResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodStatusResult)(nil), (*v1.PodStatusResult)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodStatusResult_To_v1_PodStatusResult(a.(*core.PodStatusResult), b.(*v1.PodStatusResult), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodTemplate)(nil), (*core.PodTemplate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodTemplate_To_core_PodTemplate(a.(*v1.PodTemplate), b.(*core.PodTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodTemplate)(nil), (*v1.PodTemplate)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodTemplate_To_v1_PodTemplate(a.(*core.PodTemplate), b.(*v1.PodTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PodTemplateList)(nil), (*core.PodTemplateList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PodTemplateList_To_core_PodTemplateList(a.(*v1.PodTemplateList), b.(*core.PodTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PodTemplateList)(nil), (*v1.PodTemplateList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PodTemplateList_To_v1_PodTemplateList(a.(*core.PodTemplateList), b.(*v1.PodTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PortStatus)(nil), (*core.PortStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PortStatus_To_core_PortStatus(a.(*v1.PortStatus), b.(*core.PortStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PortStatus)(nil), (*v1.PortStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PortStatus_To_v1_PortStatus(a.(*core.PortStatus), b.(*v1.PortStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PortworxVolumeSource)(nil), (*core.PortworxVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PortworxVolumeSource_To_core_PortworxVolumeSource(a.(*v1.PortworxVolumeSource), b.(*core.PortworxVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PortworxVolumeSource)(nil), (*v1.PortworxVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PortworxVolumeSource_To_v1_PortworxVolumeSource(a.(*core.PortworxVolumeSource), b.(*v1.PortworxVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Preconditions)(nil), (*core.Preconditions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Preconditions_To_core_Preconditions(a.(*v1.Preconditions), b.(*core.Preconditions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Preconditions)(nil), (*v1.Preconditions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Preconditions_To_v1_Preconditions(a.(*core.Preconditions), b.(*v1.Preconditions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PreferAvoidPodsEntry)(nil), (*core.PreferAvoidPodsEntry)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PreferAvoidPodsEntry_To_core_PreferAvoidPodsEntry(a.(*v1.PreferAvoidPodsEntry), b.(*core.PreferAvoidPodsEntry), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PreferAvoidPodsEntry)(nil), (*v1.PreferAvoidPodsEntry)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(a.(*core.PreferAvoidPodsEntry), b.(*v1.PreferAvoidPodsEntry), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.PreferredSchedulingTerm)(nil), (*core.PreferredSchedulingTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_PreferredSchedulingTerm_To_core_PreferredSchedulingTerm(a.(*v1.PreferredSchedulingTerm), b.(*core.PreferredSchedulingTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.PreferredSchedulingTerm)(nil), (*v1.PreferredSchedulingTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(a.(*core.PreferredSchedulingTerm), b.(*v1.PreferredSchedulingTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Probe)(nil), (*core.Probe)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Probe_To_core_Probe(a.(*v1.Probe), b.(*core.Probe), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Probe)(nil), (*v1.Probe)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Probe_To_v1_Probe(a.(*core.Probe), b.(*v1.Probe), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ProbeHandler)(nil), (*core.ProbeHandler)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ProbeHandler_To_core_ProbeHandler(a.(*v1.ProbeHandler), b.(*core.ProbeHandler), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ProbeHandler)(nil), (*v1.ProbeHandler)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ProbeHandler_To_v1_ProbeHandler(a.(*core.ProbeHandler), b.(*v1.ProbeHandler), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ProjectedVolumeSource)(nil), (*core.ProjectedVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(a.(*v1.ProjectedVolumeSource), b.(*core.ProjectedVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ProjectedVolumeSource)(nil), (*v1.ProjectedVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(a.(*core.ProjectedVolumeSource), b.(*v1.ProjectedVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.QuobyteVolumeSource)(nil), (*core.QuobyteVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_QuobyteVolumeSource_To_core_QuobyteVolumeSource(a.(*v1.QuobyteVolumeSource), b.(*core.QuobyteVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.QuobyteVolumeSource)(nil), (*v1.QuobyteVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(a.(*core.QuobyteVolumeSource), b.(*v1.QuobyteVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.RBDPersistentVolumeSource)(nil), (*core.RBDPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_RBDPersistentVolumeSource_To_core_RBDPersistentVolumeSource(a.(*v1.RBDPersistentVolumeSource), b.(*core.RBDPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.RBDPersistentVolumeSource)(nil), (*v1.RBDPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_RBDPersistentVolumeSource_To_v1_RBDPersistentVolumeSource(a.(*core.RBDPersistentVolumeSource), b.(*v1.RBDPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.RBDVolumeSource)(nil), (*core.RBDVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource(a.(*v1.RBDVolumeSource), b.(*core.RBDVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.RBDVolumeSource)(nil), (*v1.RBDVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_RBDVolumeSource_To_v1_RBDVolumeSource(a.(*core.RBDVolumeSource), b.(*v1.RBDVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.RangeAllocation)(nil), (*core.RangeAllocation)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_RangeAllocation_To_core_RangeAllocation(a.(*v1.RangeAllocation), b.(*core.RangeAllocation), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.RangeAllocation)(nil), (*v1.RangeAllocation)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_RangeAllocation_To_v1_RangeAllocation(a.(*core.RangeAllocation), b.(*v1.RangeAllocation), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ReplicationController)(nil), (*core.ReplicationController)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ReplicationController_To_core_ReplicationController(a.(*v1.ReplicationController), b.(*core.ReplicationController), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ReplicationController)(nil), (*v1.ReplicationController)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ReplicationController_To_v1_ReplicationController(a.(*core.ReplicationController), b.(*v1.ReplicationController), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ReplicationControllerCondition)(nil), (*core.ReplicationControllerCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ReplicationControllerCondition_To_core_ReplicationControllerCondition(a.(*v1.ReplicationControllerCondition), b.(*core.ReplicationControllerCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ReplicationControllerCondition)(nil), (*v1.ReplicationControllerCondition)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ReplicationControllerCondition_To_v1_ReplicationControllerCondition(a.(*core.ReplicationControllerCondition), b.(*v1.ReplicationControllerCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ReplicationControllerList)(nil), (*core.ReplicationControllerList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ReplicationControllerList_To_core_ReplicationControllerList(a.(*v1.ReplicationControllerList), b.(*core.ReplicationControllerList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ReplicationControllerList)(nil), (*v1.ReplicationControllerList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ReplicationControllerList_To_v1_ReplicationControllerList(a.(*core.ReplicationControllerList), b.(*v1.ReplicationControllerList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ReplicationControllerStatus)(nil), (*core.ReplicationControllerStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus(a.(*v1.ReplicationControllerStatus), b.(*core.ReplicationControllerStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ReplicationControllerStatus)(nil), (*v1.ReplicationControllerStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(a.(*core.ReplicationControllerStatus), b.(*v1.ReplicationControllerStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceClaim)(nil), (*core.ResourceClaim)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceClaim_To_core_ResourceClaim(a.(*v1.ResourceClaim), b.(*core.ResourceClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceClaim)(nil), (*v1.ResourceClaim)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceClaim_To_v1_ResourceClaim(a.(*core.ResourceClaim), b.(*v1.ResourceClaim), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceFieldSelector)(nil), (*core.ResourceFieldSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceFieldSelector_To_core_ResourceFieldSelector(a.(*v1.ResourceFieldSelector), b.(*core.ResourceFieldSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceFieldSelector)(nil), (*v1.ResourceFieldSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceFieldSelector_To_v1_ResourceFieldSelector(a.(*core.ResourceFieldSelector), b.(*v1.ResourceFieldSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceQuota)(nil), (*core.ResourceQuota)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceQuota_To_core_ResourceQuota(a.(*v1.ResourceQuota), b.(*core.ResourceQuota), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceQuota)(nil), (*v1.ResourceQuota)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceQuota_To_v1_ResourceQuota(a.(*core.ResourceQuota), b.(*v1.ResourceQuota), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceQuotaList)(nil), (*core.ResourceQuotaList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceQuotaList_To_core_ResourceQuotaList(a.(*v1.ResourceQuotaList), b.(*core.ResourceQuotaList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceQuotaList)(nil), (*v1.ResourceQuotaList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceQuotaList_To_v1_ResourceQuotaList(a.(*core.ResourceQuotaList), b.(*v1.ResourceQuotaList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceQuotaSpec)(nil), (*core.ResourceQuotaSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec(a.(*v1.ResourceQuotaSpec), b.(*core.ResourceQuotaSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceQuotaSpec)(nil), (*v1.ResourceQuotaSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(a.(*core.ResourceQuotaSpec), b.(*v1.ResourceQuotaSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceQuotaStatus)(nil), (*core.ResourceQuotaStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus(a.(*v1.ResourceQuotaStatus), b.(*core.ResourceQuotaStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceQuotaStatus)(nil), (*v1.ResourceQuotaStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(a.(*core.ResourceQuotaStatus), b.(*v1.ResourceQuotaStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ResourceRequirements)(nil), (*core.ResourceRequirements)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ResourceRequirements_To_core_ResourceRequirements(a.(*v1.ResourceRequirements), b.(*core.ResourceRequirements), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ResourceRequirements)(nil), (*v1.ResourceRequirements)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ResourceRequirements_To_v1_ResourceRequirements(a.(*core.ResourceRequirements), b.(*v1.ResourceRequirements), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SELinuxOptions)(nil), (*core.SELinuxOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SELinuxOptions_To_core_SELinuxOptions(a.(*v1.SELinuxOptions), b.(*core.SELinuxOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SELinuxOptions)(nil), (*v1.SELinuxOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SELinuxOptions_To_v1_SELinuxOptions(a.(*core.SELinuxOptions), b.(*v1.SELinuxOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ScaleIOPersistentVolumeSource)(nil), (*core.ScaleIOPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ScaleIOPersistentVolumeSource_To_core_ScaleIOPersistentVolumeSource(a.(*v1.ScaleIOPersistentVolumeSource), b.(*core.ScaleIOPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ScaleIOPersistentVolumeSource)(nil), (*v1.ScaleIOPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ScaleIOPersistentVolumeSource_To_v1_ScaleIOPersistentVolumeSource(a.(*core.ScaleIOPersistentVolumeSource), b.(*v1.ScaleIOPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ScaleIOVolumeSource)(nil), (*core.ScaleIOVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ScaleIOVolumeSource_To_core_ScaleIOVolumeSource(a.(*v1.ScaleIOVolumeSource), b.(*core.ScaleIOVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ScaleIOVolumeSource)(nil), (*v1.ScaleIOVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ScaleIOVolumeSource_To_v1_ScaleIOVolumeSource(a.(*core.ScaleIOVolumeSource), b.(*v1.ScaleIOVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ScopeSelector)(nil), (*core.ScopeSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ScopeSelector_To_core_ScopeSelector(a.(*v1.ScopeSelector), b.(*core.ScopeSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ScopeSelector)(nil), (*v1.ScopeSelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ScopeSelector_To_v1_ScopeSelector(a.(*core.ScopeSelector), b.(*v1.ScopeSelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ScopedResourceSelectorRequirement)(nil), (*core.ScopedResourceSelectorRequirement)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ScopedResourceSelectorRequirement_To_core_ScopedResourceSelectorRequirement(a.(*v1.ScopedResourceSelectorRequirement), b.(*core.ScopedResourceSelectorRequirement), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ScopedResourceSelectorRequirement)(nil), (*v1.ScopedResourceSelectorRequirement)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ScopedResourceSelectorRequirement_To_v1_ScopedResourceSelectorRequirement(a.(*core.ScopedResourceSelectorRequirement), b.(*v1.ScopedResourceSelectorRequirement), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SeccompProfile)(nil), (*core.SeccompProfile)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SeccompProfile_To_core_SeccompProfile(a.(*v1.SeccompProfile), b.(*core.SeccompProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SeccompProfile)(nil), (*v1.SeccompProfile)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SeccompProfile_To_v1_SeccompProfile(a.(*core.SeccompProfile), b.(*v1.SeccompProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Secret)(nil), (*v1.Secret)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Secret_To_v1_Secret(a.(*core.Secret), b.(*v1.Secret), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecretEnvSource)(nil), (*core.SecretEnvSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecretEnvSource_To_core_SecretEnvSource(a.(*v1.SecretEnvSource), b.(*core.SecretEnvSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecretEnvSource)(nil), (*v1.SecretEnvSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecretEnvSource_To_v1_SecretEnvSource(a.(*core.SecretEnvSource), b.(*v1.SecretEnvSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecretKeySelector)(nil), (*core.SecretKeySelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecretKeySelector_To_core_SecretKeySelector(a.(*v1.SecretKeySelector), b.(*core.SecretKeySelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecretKeySelector)(nil), (*v1.SecretKeySelector)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecretKeySelector_To_v1_SecretKeySelector(a.(*core.SecretKeySelector), b.(*v1.SecretKeySelector), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecretList)(nil), (*core.SecretList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecretList_To_core_SecretList(a.(*v1.SecretList), b.(*core.SecretList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecretList)(nil), (*v1.SecretList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecretList_To_v1_SecretList(a.(*core.SecretList), b.(*v1.SecretList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecretProjection)(nil), (*core.SecretProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecretProjection_To_core_SecretProjection(a.(*v1.SecretProjection), b.(*core.SecretProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecretProjection)(nil), (*v1.SecretProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecretProjection_To_v1_SecretProjection(a.(*core.SecretProjection), b.(*v1.SecretProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecretReference)(nil), (*core.SecretReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecretReference_To_core_SecretReference(a.(*v1.SecretReference), b.(*core.SecretReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecretReference)(nil), (*v1.SecretReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecretReference_To_v1_SecretReference(a.(*core.SecretReference), b.(*v1.SecretReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecretVolumeSource)(nil), (*core.SecretVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecretVolumeSource_To_core_SecretVolumeSource(a.(*v1.SecretVolumeSource), b.(*core.SecretVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecretVolumeSource)(nil), (*v1.SecretVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecretVolumeSource_To_v1_SecretVolumeSource(a.(*core.SecretVolumeSource), b.(*v1.SecretVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SecurityContext)(nil), (*core.SecurityContext)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SecurityContext_To_core_SecurityContext(a.(*v1.SecurityContext), b.(*core.SecurityContext), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SecurityContext)(nil), (*v1.SecurityContext)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SecurityContext_To_v1_SecurityContext(a.(*core.SecurityContext), b.(*v1.SecurityContext), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SerializedReference)(nil), (*core.SerializedReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SerializedReference_To_core_SerializedReference(a.(*v1.SerializedReference), b.(*core.SerializedReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SerializedReference)(nil), (*v1.SerializedReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SerializedReference_To_v1_SerializedReference(a.(*core.SerializedReference), b.(*v1.SerializedReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Service)(nil), (*core.Service)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Service_To_core_Service(a.(*v1.Service), b.(*core.Service), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Service)(nil), (*v1.Service)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Service_To_v1_Service(a.(*core.Service), b.(*v1.Service), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceAccount)(nil), (*core.ServiceAccount)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceAccount_To_core_ServiceAccount(a.(*v1.ServiceAccount), b.(*core.ServiceAccount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceAccount)(nil), (*v1.ServiceAccount)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceAccount_To_v1_ServiceAccount(a.(*core.ServiceAccount), b.(*v1.ServiceAccount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceAccountList)(nil), (*core.ServiceAccountList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceAccountList_To_core_ServiceAccountList(a.(*v1.ServiceAccountList), b.(*core.ServiceAccountList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceAccountList)(nil), (*v1.ServiceAccountList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceAccountList_To_v1_ServiceAccountList(a.(*core.ServiceAccountList), b.(*v1.ServiceAccountList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceAccountTokenProjection)(nil), (*core.ServiceAccountTokenProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection(a.(*v1.ServiceAccountTokenProjection), b.(*core.ServiceAccountTokenProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceAccountTokenProjection)(nil), (*v1.ServiceAccountTokenProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection(a.(*core.ServiceAccountTokenProjection), b.(*v1.ServiceAccountTokenProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceList)(nil), (*core.ServiceList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceList_To_core_ServiceList(a.(*v1.ServiceList), b.(*core.ServiceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceList)(nil), (*v1.ServiceList)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceList_To_v1_ServiceList(a.(*core.ServiceList), b.(*v1.ServiceList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServicePort)(nil), (*core.ServicePort)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServicePort_To_core_ServicePort(a.(*v1.ServicePort), b.(*core.ServicePort), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServicePort)(nil), (*v1.ServicePort)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServicePort_To_v1_ServicePort(a.(*core.ServicePort), b.(*v1.ServicePort), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceProxyOptions)(nil), (*core.ServiceProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceProxyOptions_To_core_ServiceProxyOptions(a.(*v1.ServiceProxyOptions), b.(*core.ServiceProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceProxyOptions)(nil), (*v1.ServiceProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceProxyOptions_To_v1_ServiceProxyOptions(a.(*core.ServiceProxyOptions), b.(*v1.ServiceProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceSpec)(nil), (*core.ServiceSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceSpec_To_core_ServiceSpec(a.(*v1.ServiceSpec), b.(*core.ServiceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceSpec)(nil), (*v1.ServiceSpec)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceSpec_To_v1_ServiceSpec(a.(*core.ServiceSpec), b.(*v1.ServiceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.ServiceStatus)(nil), (*core.ServiceStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_ServiceStatus_To_core_ServiceStatus(a.(*v1.ServiceStatus), b.(*core.ServiceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.ServiceStatus)(nil), (*v1.ServiceStatus)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_ServiceStatus_To_v1_ServiceStatus(a.(*core.ServiceStatus), b.(*v1.ServiceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SessionAffinityConfig)(nil), (*core.SessionAffinityConfig)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SessionAffinityConfig_To_core_SessionAffinityConfig(a.(*v1.SessionAffinityConfig), b.(*core.SessionAffinityConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SessionAffinityConfig)(nil), (*v1.SessionAffinityConfig)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SessionAffinityConfig_To_v1_SessionAffinityConfig(a.(*core.SessionAffinityConfig), b.(*v1.SessionAffinityConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.SleepAction)(nil), (*core.SleepAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_SleepAction_To_core_SleepAction(a.(*v1.SleepAction), b.(*core.SleepAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.SleepAction)(nil), (*v1.SleepAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_SleepAction_To_v1_SleepAction(a.(*core.SleepAction), b.(*v1.SleepAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.StorageOSPersistentVolumeSource)(nil), (*core.StorageOSPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_StorageOSPersistentVolumeSource_To_core_StorageOSPersistentVolumeSource(a.(*v1.StorageOSPersistentVolumeSource), b.(*core.StorageOSPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.StorageOSPersistentVolumeSource)(nil), (*v1.StorageOSPersistentVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_StorageOSPersistentVolumeSource_To_v1_StorageOSPersistentVolumeSource(a.(*core.StorageOSPersistentVolumeSource), b.(*v1.StorageOSPersistentVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.StorageOSVolumeSource)(nil), (*core.StorageOSVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(a.(*v1.StorageOSVolumeSource), b.(*core.StorageOSVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.StorageOSVolumeSource)(nil), (*v1.StorageOSVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_StorageOSVolumeSource_To_v1_StorageOSVolumeSource(a.(*core.StorageOSVolumeSource), b.(*v1.StorageOSVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Sysctl)(nil), (*core.Sysctl)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Sysctl_To_core_Sysctl(a.(*v1.Sysctl), b.(*core.Sysctl), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Sysctl)(nil), (*v1.Sysctl)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Sysctl_To_v1_Sysctl(a.(*core.Sysctl), b.(*v1.Sysctl), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TCPSocketAction)(nil), (*core.TCPSocketAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_TCPSocketAction_To_core_TCPSocketAction(a.(*v1.TCPSocketAction), b.(*core.TCPSocketAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.TCPSocketAction)(nil), (*v1.TCPSocketAction)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_TCPSocketAction_To_v1_TCPSocketAction(a.(*core.TCPSocketAction), b.(*v1.TCPSocketAction), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Taint)(nil), (*core.Taint)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Taint_To_core_Taint(a.(*v1.Taint), b.(*core.Taint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Taint)(nil), (*v1.Taint)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Taint_To_v1_Taint(a.(*core.Taint), b.(*v1.Taint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.Toleration)(nil), (*core.Toleration)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_Toleration_To_core_Toleration(a.(*v1.Toleration), b.(*core.Toleration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.Toleration)(nil), (*v1.Toleration)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_Toleration_To_v1_Toleration(a.(*core.Toleration), b.(*v1.Toleration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TopologySelectorLabelRequirement)(nil), (*core.TopologySelectorLabelRequirement)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_TopologySelectorLabelRequirement_To_core_TopologySelectorLabelRequirement(a.(*v1.TopologySelectorLabelRequirement), b.(*core.TopologySelectorLabelRequirement), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.TopologySelectorLabelRequirement)(nil), (*v1.TopologySelectorLabelRequirement)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_TopologySelectorLabelRequirement_To_v1_TopologySelectorLabelRequirement(a.(*core.TopologySelectorLabelRequirement), b.(*v1.TopologySelectorLabelRequirement), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TopologySelectorTerm)(nil), (*core.TopologySelectorTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_TopologySelectorTerm_To_core_TopologySelectorTerm(a.(*v1.TopologySelectorTerm), b.(*core.TopologySelectorTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.TopologySelectorTerm)(nil), (*v1.TopologySelectorTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_TopologySelectorTerm_To_v1_TopologySelectorTerm(a.(*core.TopologySelectorTerm), b.(*v1.TopologySelectorTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TopologySpreadConstraint)(nil), (*core.TopologySpreadConstraint)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_TopologySpreadConstraint_To_core_TopologySpreadConstraint(a.(*v1.TopologySpreadConstraint), b.(*core.TopologySpreadConstraint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.TopologySpreadConstraint)(nil), (*v1.TopologySpreadConstraint)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_TopologySpreadConstraint_To_v1_TopologySpreadConstraint(a.(*core.TopologySpreadConstraint), b.(*v1.TopologySpreadConstraint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TypedLocalObjectReference)(nil), (*core.TypedLocalObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_TypedLocalObjectReference_To_core_TypedLocalObjectReference(a.(*v1.TypedLocalObjectReference), b.(*core.TypedLocalObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.TypedLocalObjectReference)(nil), (*v1.TypedLocalObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_TypedLocalObjectReference_To_v1_TypedLocalObjectReference(a.(*core.TypedLocalObjectReference), b.(*v1.TypedLocalObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.TypedObjectReference)(nil), (*core.TypedObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_TypedObjectReference_To_core_TypedObjectReference(a.(*v1.TypedObjectReference), b.(*core.TypedObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.TypedObjectReference)(nil), (*v1.TypedObjectReference)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_TypedObjectReference_To_v1_TypedObjectReference(a.(*core.TypedObjectReference), b.(*v1.TypedObjectReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VolumeDevice)(nil), (*core.VolumeDevice)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VolumeDevice_To_core_VolumeDevice(a.(*v1.VolumeDevice), b.(*core.VolumeDevice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VolumeDevice)(nil), (*v1.VolumeDevice)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VolumeDevice_To_v1_VolumeDevice(a.(*core.VolumeDevice), b.(*v1.VolumeDevice), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VolumeMount)(nil), (*core.VolumeMount)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VolumeMount_To_core_VolumeMount(a.(*v1.VolumeMount), b.(*core.VolumeMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VolumeMount)(nil), (*v1.VolumeMount)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VolumeMount_To_v1_VolumeMount(a.(*core.VolumeMount), b.(*v1.VolumeMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VolumeNodeAffinity)(nil), (*core.VolumeNodeAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VolumeNodeAffinity_To_core_VolumeNodeAffinity(a.(*v1.VolumeNodeAffinity), b.(*core.VolumeNodeAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VolumeNodeAffinity)(nil), (*v1.VolumeNodeAffinity)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VolumeNodeAffinity_To_v1_VolumeNodeAffinity(a.(*core.VolumeNodeAffinity), b.(*v1.VolumeNodeAffinity), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VolumeProjection)(nil), (*core.VolumeProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VolumeProjection_To_core_VolumeProjection(a.(*v1.VolumeProjection), b.(*core.VolumeProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VolumeProjection)(nil), (*v1.VolumeProjection)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VolumeProjection_To_v1_VolumeProjection(a.(*core.VolumeProjection), b.(*v1.VolumeProjection), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VolumeResourceRequirements)(nil), (*core.VolumeResourceRequirements)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VolumeResourceRequirements_To_core_VolumeResourceRequirements(a.(*v1.VolumeResourceRequirements), b.(*core.VolumeResourceRequirements), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VolumeResourceRequirements)(nil), (*v1.VolumeResourceRequirements)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VolumeResourceRequirements_To_v1_VolumeResourceRequirements(a.(*core.VolumeResourceRequirements), b.(*v1.VolumeResourceRequirements), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VolumeSource)(nil), (*core.VolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VolumeSource_To_core_VolumeSource(a.(*v1.VolumeSource), b.(*core.VolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VolumeSource)(nil), (*v1.VolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VolumeSource_To_v1_VolumeSource(a.(*core.VolumeSource), b.(*v1.VolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.VsphereVirtualDiskVolumeSource)(nil), (*core.VsphereVirtualDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_VsphereVirtualDiskVolumeSource_To_core_VsphereVirtualDiskVolumeSource(a.(*v1.VsphereVirtualDiskVolumeSource), b.(*core.VsphereVirtualDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.VsphereVirtualDiskVolumeSource)(nil), (*v1.VsphereVirtualDiskVolumeSource)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(a.(*core.VsphereVirtualDiskVolumeSource), b.(*v1.VsphereVirtualDiskVolumeSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.WeightedPodAffinityTerm)(nil), (*core.WeightedPodAffinityTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_WeightedPodAffinityTerm_To_core_WeightedPodAffinityTerm(a.(*v1.WeightedPodAffinityTerm), b.(*core.WeightedPodAffinityTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.WeightedPodAffinityTerm)(nil), (*v1.WeightedPodAffinityTerm)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(a.(*core.WeightedPodAffinityTerm), b.(*v1.WeightedPodAffinityTerm), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1.WindowsSecurityContextOptions)(nil), (*core.WindowsSecurityContextOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContextOptions(a.(*v1.WindowsSecurityContextOptions), b.(*core.WindowsSecurityContextOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*core.WindowsSecurityContextOptions)(nil), (*v1.WindowsSecurityContextOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContextOptions(a.(*core.WindowsSecurityContextOptions), b.(*v1.WindowsSecurityContextOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.NodeProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_NodeProxyOptions(a.(*url.Values), b.(*v1.NodeProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodAttachOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_PodAttachOptions(a.(*url.Values), b.(*v1.PodAttachOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodExecOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_PodExecOptions(a.(*url.Values), b.(*v1.PodExecOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodLogOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_PodLogOptions(a.(*url.Values), b.(*v1.PodLogOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodPortForwardOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_PodPortForwardOptions(a.(*url.Values), b.(*v1.PodPortForwardOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.PodProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_PodProxyOptions(a.(*url.Values), b.(*v1.PodProxyOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*url.Values)(nil), (*v1.ServiceProxyOptions)(nil), func(a, b any, scope conversion.Scope) error { - return Convert_url_Values_To_v1_ServiceProxyOptions(a.(*url.Values), b.(*v1.ServiceProxyOptions), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_core_AWSElasticBlockStoreVolumeSource(in *v1.AWSElasticBlockStoreVolumeSource, out *core.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_AWSElasticBlockStoreVolumeSource_To_core_AWSElasticBlockStoreVolumeSource is an autogenerated conversion function. -func Convert_v1_AWSElasticBlockStoreVolumeSource_To_core_AWSElasticBlockStoreVolumeSource(in *v1.AWSElasticBlockStoreVolumeSource, out *core.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - return autoConvert_v1_AWSElasticBlockStoreVolumeSource_To_core_AWSElasticBlockStoreVolumeSource(in, out, s) -} - -func autoConvert_core_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in *core.AWSElasticBlockStoreVolumeSource, out *v1.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource is an autogenerated conversion function. -func Convert_core_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in *core.AWSElasticBlockStoreVolumeSource, out *v1.AWSElasticBlockStoreVolumeSource, s conversion.Scope) error { - return autoConvert_core_AWSElasticBlockStoreVolumeSource_To_v1_AWSElasticBlockStoreVolumeSource(in, out, s) -} - -func autoConvert_v1_Affinity_To_core_Affinity(in *v1.Affinity, out *core.Affinity, s conversion.Scope) error { - out.NodeAffinity = (*core.NodeAffinity)(unsafe.Pointer(in.NodeAffinity)) - out.PodAffinity = (*core.PodAffinity)(unsafe.Pointer(in.PodAffinity)) - out.PodAntiAffinity = (*core.PodAntiAffinity)(unsafe.Pointer(in.PodAntiAffinity)) - return nil -} - -// Convert_v1_Affinity_To_core_Affinity is an autogenerated conversion function. -func Convert_v1_Affinity_To_core_Affinity(in *v1.Affinity, out *core.Affinity, s conversion.Scope) error { - return autoConvert_v1_Affinity_To_core_Affinity(in, out, s) -} - -func autoConvert_core_Affinity_To_v1_Affinity(in *core.Affinity, out *v1.Affinity, s conversion.Scope) error { - out.NodeAffinity = (*v1.NodeAffinity)(unsafe.Pointer(in.NodeAffinity)) - out.PodAffinity = (*v1.PodAffinity)(unsafe.Pointer(in.PodAffinity)) - out.PodAntiAffinity = (*v1.PodAntiAffinity)(unsafe.Pointer(in.PodAntiAffinity)) - return nil -} - -// Convert_core_Affinity_To_v1_Affinity is an autogenerated conversion function. -func Convert_core_Affinity_To_v1_Affinity(in *core.Affinity, out *v1.Affinity, s conversion.Scope) error { - return autoConvert_core_Affinity_To_v1_Affinity(in, out, s) -} - -func autoConvert_v1_AttachedVolume_To_core_AttachedVolume(in *v1.AttachedVolume, out *core.AttachedVolume, s conversion.Scope) error { - out.Name = core.UniqueVolumeName(in.Name) - out.DevicePath = in.DevicePath - return nil -} - -// Convert_v1_AttachedVolume_To_core_AttachedVolume is an autogenerated conversion function. -func Convert_v1_AttachedVolume_To_core_AttachedVolume(in *v1.AttachedVolume, out *core.AttachedVolume, s conversion.Scope) error { - return autoConvert_v1_AttachedVolume_To_core_AttachedVolume(in, out, s) -} - -func autoConvert_core_AttachedVolume_To_v1_AttachedVolume(in *core.AttachedVolume, out *v1.AttachedVolume, s conversion.Scope) error { - out.Name = v1.UniqueVolumeName(in.Name) - out.DevicePath = in.DevicePath - return nil -} - -// Convert_core_AttachedVolume_To_v1_AttachedVolume is an autogenerated conversion function. -func Convert_core_AttachedVolume_To_v1_AttachedVolume(in *core.AttachedVolume, out *v1.AttachedVolume, s conversion.Scope) error { - return autoConvert_core_AttachedVolume_To_v1_AttachedVolume(in, out, s) -} - -func autoConvert_v1_AvoidPods_To_core_AvoidPods(in *v1.AvoidPods, out *core.AvoidPods, s conversion.Scope) error { - out.PreferAvoidPods = *(*[]core.PreferAvoidPodsEntry)(unsafe.Pointer(&in.PreferAvoidPods)) - return nil -} - -// Convert_v1_AvoidPods_To_core_AvoidPods is an autogenerated conversion function. -func Convert_v1_AvoidPods_To_core_AvoidPods(in *v1.AvoidPods, out *core.AvoidPods, s conversion.Scope) error { - return autoConvert_v1_AvoidPods_To_core_AvoidPods(in, out, s) -} - -func autoConvert_core_AvoidPods_To_v1_AvoidPods(in *core.AvoidPods, out *v1.AvoidPods, s conversion.Scope) error { - out.PreferAvoidPods = *(*[]v1.PreferAvoidPodsEntry)(unsafe.Pointer(&in.PreferAvoidPods)) - return nil -} - -// Convert_core_AvoidPods_To_v1_AvoidPods is an autogenerated conversion function. -func Convert_core_AvoidPods_To_v1_AvoidPods(in *core.AvoidPods, out *v1.AvoidPods, s conversion.Scope) error { - return autoConvert_core_AvoidPods_To_v1_AvoidPods(in, out, s) -} - -func autoConvert_v1_AzureDiskVolumeSource_To_core_AzureDiskVolumeSource(in *v1.AzureDiskVolumeSource, out *core.AzureDiskVolumeSource, s conversion.Scope) error { - out.DiskName = in.DiskName - out.DataDiskURI = in.DataDiskURI - out.CachingMode = (*core.AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode)) - out.FSType = (*string)(unsafe.Pointer(in.FSType)) - out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly)) - out.Kind = (*core.AzureDataDiskKind)(unsafe.Pointer(in.Kind)) - return nil -} - -// Convert_v1_AzureDiskVolumeSource_To_core_AzureDiskVolumeSource is an autogenerated conversion function. -func Convert_v1_AzureDiskVolumeSource_To_core_AzureDiskVolumeSource(in *v1.AzureDiskVolumeSource, out *core.AzureDiskVolumeSource, s conversion.Scope) error { - return autoConvert_v1_AzureDiskVolumeSource_To_core_AzureDiskVolumeSource(in, out, s) -} - -func autoConvert_core_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *core.AzureDiskVolumeSource, out *v1.AzureDiskVolumeSource, s conversion.Scope) error { - out.DiskName = in.DiskName - out.DataDiskURI = in.DataDiskURI - out.CachingMode = (*v1.AzureDataDiskCachingMode)(unsafe.Pointer(in.CachingMode)) - out.FSType = (*string)(unsafe.Pointer(in.FSType)) - out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly)) - out.Kind = (*v1.AzureDataDiskKind)(unsafe.Pointer(in.Kind)) - return nil -} - -// Convert_core_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource is an autogenerated conversion function. -func Convert_core_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in *core.AzureDiskVolumeSource, out *v1.AzureDiskVolumeSource, s conversion.Scope) error { - return autoConvert_core_AzureDiskVolumeSource_To_v1_AzureDiskVolumeSource(in, out, s) -} - -func autoConvert_v1_AzureFilePersistentVolumeSource_To_core_AzureFilePersistentVolumeSource(in *v1.AzureFilePersistentVolumeSource, out *core.AzureFilePersistentVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - out.SecretNamespace = (*string)(unsafe.Pointer(in.SecretNamespace)) - return nil -} - -// Convert_v1_AzureFilePersistentVolumeSource_To_core_AzureFilePersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_AzureFilePersistentVolumeSource_To_core_AzureFilePersistentVolumeSource(in *v1.AzureFilePersistentVolumeSource, out *core.AzureFilePersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_AzureFilePersistentVolumeSource_To_core_AzureFilePersistentVolumeSource(in, out, s) -} - -func autoConvert_core_AzureFilePersistentVolumeSource_To_v1_AzureFilePersistentVolumeSource(in *core.AzureFilePersistentVolumeSource, out *v1.AzureFilePersistentVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - out.SecretNamespace = (*string)(unsafe.Pointer(in.SecretNamespace)) - return nil -} - -// Convert_core_AzureFilePersistentVolumeSource_To_v1_AzureFilePersistentVolumeSource is an autogenerated conversion function. -func Convert_core_AzureFilePersistentVolumeSource_To_v1_AzureFilePersistentVolumeSource(in *core.AzureFilePersistentVolumeSource, out *v1.AzureFilePersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_AzureFilePersistentVolumeSource_To_v1_AzureFilePersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_AzureFileVolumeSource_To_core_AzureFileVolumeSource(in *v1.AzureFileVolumeSource, out *core.AzureFileVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_AzureFileVolumeSource_To_core_AzureFileVolumeSource is an autogenerated conversion function. -func Convert_v1_AzureFileVolumeSource_To_core_AzureFileVolumeSource(in *v1.AzureFileVolumeSource, out *core.AzureFileVolumeSource, s conversion.Scope) error { - return autoConvert_v1_AzureFileVolumeSource_To_core_AzureFileVolumeSource(in, out, s) -} - -func autoConvert_core_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *core.AzureFileVolumeSource, out *v1.AzureFileVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.ShareName = in.ShareName - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_AzureFileVolumeSource_To_v1_AzureFileVolumeSource is an autogenerated conversion function. -func Convert_core_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in *core.AzureFileVolumeSource, out *v1.AzureFileVolumeSource, s conversion.Scope) error { - return autoConvert_core_AzureFileVolumeSource_To_v1_AzureFileVolumeSource(in, out, s) -} - -func autoConvert_v1_Binding_To_core_Binding(in *v1.Binding, out *core.Binding, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_ObjectReference_To_core_ObjectReference(&in.Target, &out.Target, s); err != nil { - return err - } - return nil -} - -// Convert_v1_Binding_To_core_Binding is an autogenerated conversion function. -func Convert_v1_Binding_To_core_Binding(in *v1.Binding, out *core.Binding, s conversion.Scope) error { - return autoConvert_v1_Binding_To_core_Binding(in, out, s) -} - -func autoConvert_core_Binding_To_v1_Binding(in *core.Binding, out *v1.Binding, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_ObjectReference_To_v1_ObjectReference(&in.Target, &out.Target, s); err != nil { - return err - } - return nil -} - -// Convert_core_Binding_To_v1_Binding is an autogenerated conversion function. -func Convert_core_Binding_To_v1_Binding(in *core.Binding, out *v1.Binding, s conversion.Scope) error { - return autoConvert_core_Binding_To_v1_Binding(in, out, s) -} - -func autoConvert_v1_CSIPersistentVolumeSource_To_core_CSIPersistentVolumeSource(in *v1.CSIPersistentVolumeSource, out *core.CSIPersistentVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.VolumeHandle = in.VolumeHandle - out.ReadOnly = in.ReadOnly - out.FSType = in.FSType - out.VolumeAttributes = *(*map[string]string)(unsafe.Pointer(&in.VolumeAttributes)) - out.ControllerPublishSecretRef = (*core.SecretReference)(unsafe.Pointer(in.ControllerPublishSecretRef)) - out.NodeStageSecretRef = (*core.SecretReference)(unsafe.Pointer(in.NodeStageSecretRef)) - out.NodePublishSecretRef = (*core.SecretReference)(unsafe.Pointer(in.NodePublishSecretRef)) - out.ControllerExpandSecretRef = (*core.SecretReference)(unsafe.Pointer(in.ControllerExpandSecretRef)) - out.NodeExpandSecretRef = (*core.SecretReference)(unsafe.Pointer(in.NodeExpandSecretRef)) - return nil -} - -// Convert_v1_CSIPersistentVolumeSource_To_core_CSIPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_CSIPersistentVolumeSource_To_core_CSIPersistentVolumeSource(in *v1.CSIPersistentVolumeSource, out *core.CSIPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CSIPersistentVolumeSource_To_core_CSIPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(in *core.CSIPersistentVolumeSource, out *v1.CSIPersistentVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.VolumeHandle = in.VolumeHandle - out.ReadOnly = in.ReadOnly - out.FSType = in.FSType - out.VolumeAttributes = *(*map[string]string)(unsafe.Pointer(&in.VolumeAttributes)) - out.ControllerPublishSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.ControllerPublishSecretRef)) - out.NodeStageSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.NodeStageSecretRef)) - out.NodePublishSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.NodePublishSecretRef)) - out.ControllerExpandSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.ControllerExpandSecretRef)) - out.NodeExpandSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.NodeExpandSecretRef)) - return nil -} - -// Convert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(in *core.CSIPersistentVolumeSource, out *v1.CSIPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_CSIPersistentVolumeSource_To_v1_CSIPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_CSIVolumeSource_To_core_CSIVolumeSource(in *v1.CSIVolumeSource, out *core.CSIVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly)) - out.FSType = (*string)(unsafe.Pointer(in.FSType)) - out.VolumeAttributes = *(*map[string]string)(unsafe.Pointer(&in.VolumeAttributes)) - out.NodePublishSecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.NodePublishSecretRef)) - return nil -} - -// Convert_v1_CSIVolumeSource_To_core_CSIVolumeSource is an autogenerated conversion function. -func Convert_v1_CSIVolumeSource_To_core_CSIVolumeSource(in *v1.CSIVolumeSource, out *core.CSIVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CSIVolumeSource_To_core_CSIVolumeSource(in, out, s) -} - -func autoConvert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in *core.CSIVolumeSource, out *v1.CSIVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.ReadOnly = (*bool)(unsafe.Pointer(in.ReadOnly)) - out.FSType = (*string)(unsafe.Pointer(in.FSType)) - out.VolumeAttributes = *(*map[string]string)(unsafe.Pointer(&in.VolumeAttributes)) - out.NodePublishSecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.NodePublishSecretRef)) - return nil -} - -// Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource is an autogenerated conversion function. -func Convert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in *core.CSIVolumeSource, out *v1.CSIVolumeSource, s conversion.Scope) error { - return autoConvert_core_CSIVolumeSource_To_v1_CSIVolumeSource(in, out, s) -} - -func autoConvert_v1_Capabilities_To_core_Capabilities(in *v1.Capabilities, out *core.Capabilities, s conversion.Scope) error { - out.Add = *(*[]core.Capability)(unsafe.Pointer(&in.Add)) - out.Drop = *(*[]core.Capability)(unsafe.Pointer(&in.Drop)) - return nil -} - -// Convert_v1_Capabilities_To_core_Capabilities is an autogenerated conversion function. -func Convert_v1_Capabilities_To_core_Capabilities(in *v1.Capabilities, out *core.Capabilities, s conversion.Scope) error { - return autoConvert_v1_Capabilities_To_core_Capabilities(in, out, s) -} - -func autoConvert_core_Capabilities_To_v1_Capabilities(in *core.Capabilities, out *v1.Capabilities, s conversion.Scope) error { - out.Add = *(*[]v1.Capability)(unsafe.Pointer(&in.Add)) - out.Drop = *(*[]v1.Capability)(unsafe.Pointer(&in.Drop)) - return nil -} - -// Convert_core_Capabilities_To_v1_Capabilities is an autogenerated conversion function. -func Convert_core_Capabilities_To_v1_Capabilities(in *core.Capabilities, out *v1.Capabilities, s conversion.Scope) error { - return autoConvert_core_Capabilities_To_v1_Capabilities(in, out, s) -} - -func autoConvert_v1_CephFSPersistentVolumeSource_To_core_CephFSPersistentVolumeSource(in *v1.CephFSPersistentVolumeSource, out *core.CephFSPersistentVolumeSource, s conversion.Scope) error { - out.Monitors = *(*[]string)(unsafe.Pointer(&in.Monitors)) - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - out.SecretRef = (*core.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_CephFSPersistentVolumeSource_To_core_CephFSPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_CephFSPersistentVolumeSource_To_core_CephFSPersistentVolumeSource(in *v1.CephFSPersistentVolumeSource, out *core.CephFSPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CephFSPersistentVolumeSource_To_core_CephFSPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_CephFSPersistentVolumeSource_To_v1_CephFSPersistentVolumeSource(in *core.CephFSPersistentVolumeSource, out *v1.CephFSPersistentVolumeSource, s conversion.Scope) error { - out.Monitors = *(*[]string)(unsafe.Pointer(&in.Monitors)) - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_CephFSPersistentVolumeSource_To_v1_CephFSPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_CephFSPersistentVolumeSource_To_v1_CephFSPersistentVolumeSource(in *core.CephFSPersistentVolumeSource, out *v1.CephFSPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_CephFSPersistentVolumeSource_To_v1_CephFSPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_CephFSVolumeSource_To_core_CephFSVolumeSource(in *v1.CephFSVolumeSource, out *core.CephFSVolumeSource, s conversion.Scope) error { - out.Monitors = *(*[]string)(unsafe.Pointer(&in.Monitors)) - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_CephFSVolumeSource_To_core_CephFSVolumeSource is an autogenerated conversion function. -func Convert_v1_CephFSVolumeSource_To_core_CephFSVolumeSource(in *v1.CephFSVolumeSource, out *core.CephFSVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CephFSVolumeSource_To_core_CephFSVolumeSource(in, out, s) -} - -func autoConvert_core_CephFSVolumeSource_To_v1_CephFSVolumeSource(in *core.CephFSVolumeSource, out *v1.CephFSVolumeSource, s conversion.Scope) error { - out.Monitors = *(*[]string)(unsafe.Pointer(&in.Monitors)) - out.Path = in.Path - out.User = in.User - out.SecretFile = in.SecretFile - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_CephFSVolumeSource_To_v1_CephFSVolumeSource is an autogenerated conversion function. -func Convert_core_CephFSVolumeSource_To_v1_CephFSVolumeSource(in *core.CephFSVolumeSource, out *v1.CephFSVolumeSource, s conversion.Scope) error { - return autoConvert_core_CephFSVolumeSource_To_v1_CephFSVolumeSource(in, out, s) -} - -func autoConvert_v1_CinderPersistentVolumeSource_To_core_CinderPersistentVolumeSource(in *v1.CinderPersistentVolumeSource, out *core.CinderPersistentVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*core.SecretReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_v1_CinderPersistentVolumeSource_To_core_CinderPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_CinderPersistentVolumeSource_To_core_CinderPersistentVolumeSource(in *v1.CinderPersistentVolumeSource, out *core.CinderPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CinderPersistentVolumeSource_To_core_CinderPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_CinderPersistentVolumeSource_To_v1_CinderPersistentVolumeSource(in *core.CinderPersistentVolumeSource, out *v1.CinderPersistentVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_core_CinderPersistentVolumeSource_To_v1_CinderPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_CinderPersistentVolumeSource_To_v1_CinderPersistentVolumeSource(in *core.CinderPersistentVolumeSource, out *v1.CinderPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_CinderPersistentVolumeSource_To_v1_CinderPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_CinderVolumeSource_To_core_CinderVolumeSource(in *v1.CinderVolumeSource, out *core.CinderVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_v1_CinderVolumeSource_To_core_CinderVolumeSource is an autogenerated conversion function. -func Convert_v1_CinderVolumeSource_To_core_CinderVolumeSource(in *v1.CinderVolumeSource, out *core.CinderVolumeSource, s conversion.Scope) error { - return autoConvert_v1_CinderVolumeSource_To_core_CinderVolumeSource(in, out, s) -} - -func autoConvert_core_CinderVolumeSource_To_v1_CinderVolumeSource(in *core.CinderVolumeSource, out *v1.CinderVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_core_CinderVolumeSource_To_v1_CinderVolumeSource is an autogenerated conversion function. -func Convert_core_CinderVolumeSource_To_v1_CinderVolumeSource(in *core.CinderVolumeSource, out *v1.CinderVolumeSource, s conversion.Scope) error { - return autoConvert_core_CinderVolumeSource_To_v1_CinderVolumeSource(in, out, s) -} - -func autoConvert_v1_ClaimSource_To_core_ClaimSource(in *v1.ClaimSource, out *core.ClaimSource, s conversion.Scope) error { - out.ResourceClaimName = (*string)(unsafe.Pointer(in.ResourceClaimName)) - out.ResourceClaimTemplateName = (*string)(unsafe.Pointer(in.ResourceClaimTemplateName)) - return nil -} - -// Convert_v1_ClaimSource_To_core_ClaimSource is an autogenerated conversion function. -func Convert_v1_ClaimSource_To_core_ClaimSource(in *v1.ClaimSource, out *core.ClaimSource, s conversion.Scope) error { - return autoConvert_v1_ClaimSource_To_core_ClaimSource(in, out, s) -} - -func autoConvert_core_ClaimSource_To_v1_ClaimSource(in *core.ClaimSource, out *v1.ClaimSource, s conversion.Scope) error { - out.ResourceClaimName = (*string)(unsafe.Pointer(in.ResourceClaimName)) - out.ResourceClaimTemplateName = (*string)(unsafe.Pointer(in.ResourceClaimTemplateName)) - return nil -} - -// Convert_core_ClaimSource_To_v1_ClaimSource is an autogenerated conversion function. -func Convert_core_ClaimSource_To_v1_ClaimSource(in *core.ClaimSource, out *v1.ClaimSource, s conversion.Scope) error { - return autoConvert_core_ClaimSource_To_v1_ClaimSource(in, out, s) -} - -func autoConvert_v1_ClientIPConfig_To_core_ClientIPConfig(in *v1.ClientIPConfig, out *core.ClientIPConfig, s conversion.Scope) error { - out.TimeoutSeconds = (*int32)(unsafe.Pointer(in.TimeoutSeconds)) - return nil -} - -// Convert_v1_ClientIPConfig_To_core_ClientIPConfig is an autogenerated conversion function. -func Convert_v1_ClientIPConfig_To_core_ClientIPConfig(in *v1.ClientIPConfig, out *core.ClientIPConfig, s conversion.Scope) error { - return autoConvert_v1_ClientIPConfig_To_core_ClientIPConfig(in, out, s) -} - -func autoConvert_core_ClientIPConfig_To_v1_ClientIPConfig(in *core.ClientIPConfig, out *v1.ClientIPConfig, s conversion.Scope) error { - out.TimeoutSeconds = (*int32)(unsafe.Pointer(in.TimeoutSeconds)) - return nil -} - -// Convert_core_ClientIPConfig_To_v1_ClientIPConfig is an autogenerated conversion function. -func Convert_core_ClientIPConfig_To_v1_ClientIPConfig(in *core.ClientIPConfig, out *v1.ClientIPConfig, s conversion.Scope) error { - return autoConvert_core_ClientIPConfig_To_v1_ClientIPConfig(in, out, s) -} - -func autoConvert_v1_ClusterTrustBundleProjection_To_core_ClusterTrustBundleProjection(in *v1.ClusterTrustBundleProjection, out *core.ClusterTrustBundleProjection, s conversion.Scope) error { - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.SignerName = (*string)(unsafe.Pointer(in.SignerName)) - out.LabelSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.LabelSelector)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - out.Path = in.Path - return nil -} - -// Convert_v1_ClusterTrustBundleProjection_To_core_ClusterTrustBundleProjection is an autogenerated conversion function. -func Convert_v1_ClusterTrustBundleProjection_To_core_ClusterTrustBundleProjection(in *v1.ClusterTrustBundleProjection, out *core.ClusterTrustBundleProjection, s conversion.Scope) error { - return autoConvert_v1_ClusterTrustBundleProjection_To_core_ClusterTrustBundleProjection(in, out, s) -} - -func autoConvert_core_ClusterTrustBundleProjection_To_v1_ClusterTrustBundleProjection(in *core.ClusterTrustBundleProjection, out *v1.ClusterTrustBundleProjection, s conversion.Scope) error { - out.Name = (*string)(unsafe.Pointer(in.Name)) - out.SignerName = (*string)(unsafe.Pointer(in.SignerName)) - out.LabelSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.LabelSelector)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - out.Path = in.Path - return nil -} - -// Convert_core_ClusterTrustBundleProjection_To_v1_ClusterTrustBundleProjection is an autogenerated conversion function. -func Convert_core_ClusterTrustBundleProjection_To_v1_ClusterTrustBundleProjection(in *core.ClusterTrustBundleProjection, out *v1.ClusterTrustBundleProjection, s conversion.Scope) error { - return autoConvert_core_ClusterTrustBundleProjection_To_v1_ClusterTrustBundleProjection(in, out, s) -} - -func autoConvert_v1_ComponentCondition_To_core_ComponentCondition(in *v1.ComponentCondition, out *core.ComponentCondition, s conversion.Scope) error { - out.Type = core.ComponentConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.Message = in.Message - out.Error = in.Error - return nil -} - -// Convert_v1_ComponentCondition_To_core_ComponentCondition is an autogenerated conversion function. -func Convert_v1_ComponentCondition_To_core_ComponentCondition(in *v1.ComponentCondition, out *core.ComponentCondition, s conversion.Scope) error { - return autoConvert_v1_ComponentCondition_To_core_ComponentCondition(in, out, s) -} - -func autoConvert_core_ComponentCondition_To_v1_ComponentCondition(in *core.ComponentCondition, out *v1.ComponentCondition, s conversion.Scope) error { - out.Type = v1.ComponentConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Message = in.Message - out.Error = in.Error - return nil -} - -// Convert_core_ComponentCondition_To_v1_ComponentCondition is an autogenerated conversion function. -func Convert_core_ComponentCondition_To_v1_ComponentCondition(in *core.ComponentCondition, out *v1.ComponentCondition, s conversion.Scope) error { - return autoConvert_core_ComponentCondition_To_v1_ComponentCondition(in, out, s) -} - -func autoConvert_v1_ComponentStatus_To_core_ComponentStatus(in *v1.ComponentStatus, out *core.ComponentStatus, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Conditions = *(*[]core.ComponentCondition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1_ComponentStatus_To_core_ComponentStatus is an autogenerated conversion function. -func Convert_v1_ComponentStatus_To_core_ComponentStatus(in *v1.ComponentStatus, out *core.ComponentStatus, s conversion.Scope) error { - return autoConvert_v1_ComponentStatus_To_core_ComponentStatus(in, out, s) -} - -func autoConvert_core_ComponentStatus_To_v1_ComponentStatus(in *core.ComponentStatus, out *v1.ComponentStatus, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Conditions = *(*[]v1.ComponentCondition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_core_ComponentStatus_To_v1_ComponentStatus is an autogenerated conversion function. -func Convert_core_ComponentStatus_To_v1_ComponentStatus(in *core.ComponentStatus, out *v1.ComponentStatus, s conversion.Scope) error { - return autoConvert_core_ComponentStatus_To_v1_ComponentStatus(in, out, s) -} - -func autoConvert_v1_ComponentStatusList_To_core_ComponentStatusList(in *v1.ComponentStatusList, out *core.ComponentStatusList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.ComponentStatus)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_ComponentStatusList_To_core_ComponentStatusList is an autogenerated conversion function. -func Convert_v1_ComponentStatusList_To_core_ComponentStatusList(in *v1.ComponentStatusList, out *core.ComponentStatusList, s conversion.Scope) error { - return autoConvert_v1_ComponentStatusList_To_core_ComponentStatusList(in, out, s) -} - -func autoConvert_core_ComponentStatusList_To_v1_ComponentStatusList(in *core.ComponentStatusList, out *v1.ComponentStatusList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.ComponentStatus)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_ComponentStatusList_To_v1_ComponentStatusList is an autogenerated conversion function. -func Convert_core_ComponentStatusList_To_v1_ComponentStatusList(in *core.ComponentStatusList, out *v1.ComponentStatusList, s conversion.Scope) error { - return autoConvert_core_ComponentStatusList_To_v1_ComponentStatusList(in, out, s) -} - -func autoConvert_v1_ConfigMap_To_core_ConfigMap(in *v1.ConfigMap, out *core.ConfigMap, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Immutable = (*bool)(unsafe.Pointer(in.Immutable)) - out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data)) - out.BinaryData = *(*map[string][]byte)(unsafe.Pointer(&in.BinaryData)) - return nil -} - -// Convert_v1_ConfigMap_To_core_ConfigMap is an autogenerated conversion function. -func Convert_v1_ConfigMap_To_core_ConfigMap(in *v1.ConfigMap, out *core.ConfigMap, s conversion.Scope) error { - return autoConvert_v1_ConfigMap_To_core_ConfigMap(in, out, s) -} - -func autoConvert_core_ConfigMap_To_v1_ConfigMap(in *core.ConfigMap, out *v1.ConfigMap, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Immutable = (*bool)(unsafe.Pointer(in.Immutable)) - out.Data = *(*map[string]string)(unsafe.Pointer(&in.Data)) - out.BinaryData = *(*map[string][]byte)(unsafe.Pointer(&in.BinaryData)) - return nil -} - -// Convert_core_ConfigMap_To_v1_ConfigMap is an autogenerated conversion function. -func Convert_core_ConfigMap_To_v1_ConfigMap(in *core.ConfigMap, out *v1.ConfigMap, s conversion.Scope) error { - return autoConvert_core_ConfigMap_To_v1_ConfigMap(in, out, s) -} - -func autoConvert_v1_ConfigMapEnvSource_To_core_ConfigMapEnvSource(in *v1.ConfigMapEnvSource, out *core.ConfigMapEnvSource, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_ConfigMapEnvSource_To_core_ConfigMapEnvSource is an autogenerated conversion function. -func Convert_v1_ConfigMapEnvSource_To_core_ConfigMapEnvSource(in *v1.ConfigMapEnvSource, out *core.ConfigMapEnvSource, s conversion.Scope) error { - return autoConvert_v1_ConfigMapEnvSource_To_core_ConfigMapEnvSource(in, out, s) -} - -func autoConvert_core_ConfigMapEnvSource_To_v1_ConfigMapEnvSource(in *core.ConfigMapEnvSource, out *v1.ConfigMapEnvSource, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_ConfigMapEnvSource_To_v1_ConfigMapEnvSource is an autogenerated conversion function. -func Convert_core_ConfigMapEnvSource_To_v1_ConfigMapEnvSource(in *core.ConfigMapEnvSource, out *v1.ConfigMapEnvSource, s conversion.Scope) error { - return autoConvert_core_ConfigMapEnvSource_To_v1_ConfigMapEnvSource(in, out, s) -} - -func autoConvert_v1_ConfigMapKeySelector_To_core_ConfigMapKeySelector(in *v1.ConfigMapKeySelector, out *core.ConfigMapKeySelector, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_ConfigMapKeySelector_To_core_ConfigMapKeySelector is an autogenerated conversion function. -func Convert_v1_ConfigMapKeySelector_To_core_ConfigMapKeySelector(in *v1.ConfigMapKeySelector, out *core.ConfigMapKeySelector, s conversion.Scope) error { - return autoConvert_v1_ConfigMapKeySelector_To_core_ConfigMapKeySelector(in, out, s) -} - -func autoConvert_core_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in *core.ConfigMapKeySelector, out *v1.ConfigMapKeySelector, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_ConfigMapKeySelector_To_v1_ConfigMapKeySelector is an autogenerated conversion function. -func Convert_core_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in *core.ConfigMapKeySelector, out *v1.ConfigMapKeySelector, s conversion.Scope) error { - return autoConvert_core_ConfigMapKeySelector_To_v1_ConfigMapKeySelector(in, out, s) -} - -func autoConvert_v1_ConfigMapList_To_core_ConfigMapList(in *v1.ConfigMapList, out *core.ConfigMapList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.ConfigMap)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_ConfigMapList_To_core_ConfigMapList is an autogenerated conversion function. -func Convert_v1_ConfigMapList_To_core_ConfigMapList(in *v1.ConfigMapList, out *core.ConfigMapList, s conversion.Scope) error { - return autoConvert_v1_ConfigMapList_To_core_ConfigMapList(in, out, s) -} - -func autoConvert_core_ConfigMapList_To_v1_ConfigMapList(in *core.ConfigMapList, out *v1.ConfigMapList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.ConfigMap)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_ConfigMapList_To_v1_ConfigMapList is an autogenerated conversion function. -func Convert_core_ConfigMapList_To_v1_ConfigMapList(in *core.ConfigMapList, out *v1.ConfigMapList, s conversion.Scope) error { - return autoConvert_core_ConfigMapList_To_v1_ConfigMapList(in, out, s) -} - -func autoConvert_v1_ConfigMapNodeConfigSource_To_core_ConfigMapNodeConfigSource(in *v1.ConfigMapNodeConfigSource, out *core.ConfigMapNodeConfigSource, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = types.UID(in.UID) - out.ResourceVersion = in.ResourceVersion - out.KubeletConfigKey = in.KubeletConfigKey - return nil -} - -// Convert_v1_ConfigMapNodeConfigSource_To_core_ConfigMapNodeConfigSource is an autogenerated conversion function. -func Convert_v1_ConfigMapNodeConfigSource_To_core_ConfigMapNodeConfigSource(in *v1.ConfigMapNodeConfigSource, out *core.ConfigMapNodeConfigSource, s conversion.Scope) error { - return autoConvert_v1_ConfigMapNodeConfigSource_To_core_ConfigMapNodeConfigSource(in, out, s) -} - -func autoConvert_core_ConfigMapNodeConfigSource_To_v1_ConfigMapNodeConfigSource(in *core.ConfigMapNodeConfigSource, out *v1.ConfigMapNodeConfigSource, s conversion.Scope) error { - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = types.UID(in.UID) - out.ResourceVersion = in.ResourceVersion - out.KubeletConfigKey = in.KubeletConfigKey - return nil -} - -// Convert_core_ConfigMapNodeConfigSource_To_v1_ConfigMapNodeConfigSource is an autogenerated conversion function. -func Convert_core_ConfigMapNodeConfigSource_To_v1_ConfigMapNodeConfigSource(in *core.ConfigMapNodeConfigSource, out *v1.ConfigMapNodeConfigSource, s conversion.Scope) error { - return autoConvert_core_ConfigMapNodeConfigSource_To_v1_ConfigMapNodeConfigSource(in, out, s) -} - -func autoConvert_v1_ConfigMapProjection_To_core_ConfigMapProjection(in *v1.ConfigMapProjection, out *core.ConfigMapProjection, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Items = *(*[]core.KeyToPath)(unsafe.Pointer(&in.Items)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_ConfigMapProjection_To_core_ConfigMapProjection is an autogenerated conversion function. -func Convert_v1_ConfigMapProjection_To_core_ConfigMapProjection(in *v1.ConfigMapProjection, out *core.ConfigMapProjection, s conversion.Scope) error { - return autoConvert_v1_ConfigMapProjection_To_core_ConfigMapProjection(in, out, s) -} - -func autoConvert_core_ConfigMapProjection_To_v1_ConfigMapProjection(in *core.ConfigMapProjection, out *v1.ConfigMapProjection, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Items = *(*[]v1.KeyToPath)(unsafe.Pointer(&in.Items)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_ConfigMapProjection_To_v1_ConfigMapProjection is an autogenerated conversion function. -func Convert_core_ConfigMapProjection_To_v1_ConfigMapProjection(in *core.ConfigMapProjection, out *v1.ConfigMapProjection, s conversion.Scope) error { - return autoConvert_core_ConfigMapProjection_To_v1_ConfigMapProjection(in, out, s) -} - -func autoConvert_v1_ConfigMapVolumeSource_To_core_ConfigMapVolumeSource(in *v1.ConfigMapVolumeSource, out *core.ConfigMapVolumeSource, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Items = *(*[]core.KeyToPath)(unsafe.Pointer(&in.Items)) - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_ConfigMapVolumeSource_To_core_ConfigMapVolumeSource is an autogenerated conversion function. -func Convert_v1_ConfigMapVolumeSource_To_core_ConfigMapVolumeSource(in *v1.ConfigMapVolumeSource, out *core.ConfigMapVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ConfigMapVolumeSource_To_core_ConfigMapVolumeSource(in, out, s) -} - -func autoConvert_core_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *core.ConfigMapVolumeSource, out *v1.ConfigMapVolumeSource, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Items = *(*[]v1.KeyToPath)(unsafe.Pointer(&in.Items)) - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource is an autogenerated conversion function. -func Convert_core_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in *core.ConfigMapVolumeSource, out *v1.ConfigMapVolumeSource, s conversion.Scope) error { - return autoConvert_core_ConfigMapVolumeSource_To_v1_ConfigMapVolumeSource(in, out, s) -} - -func autoConvert_v1_Container_To_core_Container(in *v1.Container, out *core.Container, s conversion.Scope) error { - out.Name = in.Name - out.Image = in.Image - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) - out.WorkingDir = in.WorkingDir - out.Ports = *(*[]core.ContainerPort)(unsafe.Pointer(&in.Ports)) - out.EnvFrom = *(*[]core.EnvFromSource)(unsafe.Pointer(&in.EnvFrom)) - out.Env = *(*[]core.EnvVar)(unsafe.Pointer(&in.Env)) - if err := Convert_v1_ResourceRequirements_To_core_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.ResizePolicy = *(*[]core.ContainerResizePolicy)(unsafe.Pointer(&in.ResizePolicy)) - out.RestartPolicy = (*core.ContainerRestartPolicy)(unsafe.Pointer(in.RestartPolicy)) - out.VolumeMounts = *(*[]core.VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) - out.VolumeDevices = *(*[]core.VolumeDevice)(unsafe.Pointer(&in.VolumeDevices)) - out.LivenessProbe = (*core.Probe)(unsafe.Pointer(in.LivenessProbe)) - out.ReadinessProbe = (*core.Probe)(unsafe.Pointer(in.ReadinessProbe)) - out.StartupProbe = (*core.Probe)(unsafe.Pointer(in.StartupProbe)) - out.Lifecycle = (*core.Lifecycle)(unsafe.Pointer(in.Lifecycle)) - out.TerminationMessagePath = in.TerminationMessagePath - out.TerminationMessagePolicy = core.TerminationMessagePolicy(in.TerminationMessagePolicy) - out.ImagePullPolicy = core.PullPolicy(in.ImagePullPolicy) - out.SecurityContext = (*core.SecurityContext)(unsafe.Pointer(in.SecurityContext)) - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil -} - -// Convert_v1_Container_To_core_Container is an autogenerated conversion function. -func Convert_v1_Container_To_core_Container(in *v1.Container, out *core.Container, s conversion.Scope) error { - return autoConvert_v1_Container_To_core_Container(in, out, s) -} - -func autoConvert_core_Container_To_v1_Container(in *core.Container, out *v1.Container, s conversion.Scope) error { - out.Name = in.Name - out.Image = in.Image - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) - out.WorkingDir = in.WorkingDir - out.Ports = *(*[]v1.ContainerPort)(unsafe.Pointer(&in.Ports)) - out.EnvFrom = *(*[]v1.EnvFromSource)(unsafe.Pointer(&in.EnvFrom)) - out.Env = *(*[]v1.EnvVar)(unsafe.Pointer(&in.Env)) - if err := Convert_core_ResourceRequirements_To_v1_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.ResizePolicy = *(*[]v1.ContainerResizePolicy)(unsafe.Pointer(&in.ResizePolicy)) - out.RestartPolicy = (*v1.ContainerRestartPolicy)(unsafe.Pointer(in.RestartPolicy)) - out.VolumeMounts = *(*[]v1.VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) - out.VolumeDevices = *(*[]v1.VolumeDevice)(unsafe.Pointer(&in.VolumeDevices)) - out.LivenessProbe = (*v1.Probe)(unsafe.Pointer(in.LivenessProbe)) - out.ReadinessProbe = (*v1.Probe)(unsafe.Pointer(in.ReadinessProbe)) - out.StartupProbe = (*v1.Probe)(unsafe.Pointer(in.StartupProbe)) - out.Lifecycle = (*v1.Lifecycle)(unsafe.Pointer(in.Lifecycle)) - out.TerminationMessagePath = in.TerminationMessagePath - out.TerminationMessagePolicy = v1.TerminationMessagePolicy(in.TerminationMessagePolicy) - out.ImagePullPolicy = v1.PullPolicy(in.ImagePullPolicy) - out.SecurityContext = (*v1.SecurityContext)(unsafe.Pointer(in.SecurityContext)) - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil -} - -// Convert_core_Container_To_v1_Container is an autogenerated conversion function. -func Convert_core_Container_To_v1_Container(in *core.Container, out *v1.Container, s conversion.Scope) error { - return autoConvert_core_Container_To_v1_Container(in, out, s) -} - -func autoConvert_v1_ContainerImage_To_core_ContainerImage(in *v1.ContainerImage, out *core.ContainerImage, s conversion.Scope) error { - out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) - out.SizeBytes = in.SizeBytes - return nil -} - -// Convert_v1_ContainerImage_To_core_ContainerImage is an autogenerated conversion function. -func Convert_v1_ContainerImage_To_core_ContainerImage(in *v1.ContainerImage, out *core.ContainerImage, s conversion.Scope) error { - return autoConvert_v1_ContainerImage_To_core_ContainerImage(in, out, s) -} - -func autoConvert_core_ContainerImage_To_v1_ContainerImage(in *core.ContainerImage, out *v1.ContainerImage, s conversion.Scope) error { - out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) - out.SizeBytes = in.SizeBytes - return nil -} - -// Convert_core_ContainerImage_To_v1_ContainerImage is an autogenerated conversion function. -func Convert_core_ContainerImage_To_v1_ContainerImage(in *core.ContainerImage, out *v1.ContainerImage, s conversion.Scope) error { - return autoConvert_core_ContainerImage_To_v1_ContainerImage(in, out, s) -} - -func autoConvert_v1_ContainerPort_To_core_ContainerPort(in *v1.ContainerPort, out *core.ContainerPort, s conversion.Scope) error { - out.Name = in.Name - out.HostPort = in.HostPort - out.ContainerPort = in.ContainerPort - out.Protocol = core.Protocol(in.Protocol) - out.HostIP = in.HostIP - return nil -} - -// Convert_v1_ContainerPort_To_core_ContainerPort is an autogenerated conversion function. -func Convert_v1_ContainerPort_To_core_ContainerPort(in *v1.ContainerPort, out *core.ContainerPort, s conversion.Scope) error { - return autoConvert_v1_ContainerPort_To_core_ContainerPort(in, out, s) -} - -func autoConvert_core_ContainerPort_To_v1_ContainerPort(in *core.ContainerPort, out *v1.ContainerPort, s conversion.Scope) error { - out.Name = in.Name - out.HostPort = in.HostPort - out.ContainerPort = in.ContainerPort - out.Protocol = v1.Protocol(in.Protocol) - out.HostIP = in.HostIP - return nil -} - -// Convert_core_ContainerPort_To_v1_ContainerPort is an autogenerated conversion function. -func Convert_core_ContainerPort_To_v1_ContainerPort(in *core.ContainerPort, out *v1.ContainerPort, s conversion.Scope) error { - return autoConvert_core_ContainerPort_To_v1_ContainerPort(in, out, s) -} - -func autoConvert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(in *v1.ContainerResizePolicy, out *core.ContainerResizePolicy, s conversion.Scope) error { - out.ResourceName = core.ResourceName(in.ResourceName) - out.RestartPolicy = core.ResourceResizeRestartPolicy(in.RestartPolicy) - return nil -} - -// Convert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy is an autogenerated conversion function. -func Convert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(in *v1.ContainerResizePolicy, out *core.ContainerResizePolicy, s conversion.Scope) error { - return autoConvert_v1_ContainerResizePolicy_To_core_ContainerResizePolicy(in, out, s) -} - -func autoConvert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(in *core.ContainerResizePolicy, out *v1.ContainerResizePolicy, s conversion.Scope) error { - out.ResourceName = v1.ResourceName(in.ResourceName) - out.RestartPolicy = v1.ResourceResizeRestartPolicy(in.RestartPolicy) - return nil -} - -// Convert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy is an autogenerated conversion function. -func Convert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(in *core.ContainerResizePolicy, out *v1.ContainerResizePolicy, s conversion.Scope) error { - return autoConvert_core_ContainerResizePolicy_To_v1_ContainerResizePolicy(in, out, s) -} - -func autoConvert_v1_ContainerState_To_core_ContainerState(in *v1.ContainerState, out *core.ContainerState, s conversion.Scope) error { - out.Waiting = (*core.ContainerStateWaiting)(unsafe.Pointer(in.Waiting)) - out.Running = (*core.ContainerStateRunning)(unsafe.Pointer(in.Running)) - out.Terminated = (*core.ContainerStateTerminated)(unsafe.Pointer(in.Terminated)) - return nil -} - -// Convert_v1_ContainerState_To_core_ContainerState is an autogenerated conversion function. -func Convert_v1_ContainerState_To_core_ContainerState(in *v1.ContainerState, out *core.ContainerState, s conversion.Scope) error { - return autoConvert_v1_ContainerState_To_core_ContainerState(in, out, s) -} - -func autoConvert_core_ContainerState_To_v1_ContainerState(in *core.ContainerState, out *v1.ContainerState, s conversion.Scope) error { - out.Waiting = (*v1.ContainerStateWaiting)(unsafe.Pointer(in.Waiting)) - out.Running = (*v1.ContainerStateRunning)(unsafe.Pointer(in.Running)) - out.Terminated = (*v1.ContainerStateTerminated)(unsafe.Pointer(in.Terminated)) - return nil -} - -// Convert_core_ContainerState_To_v1_ContainerState is an autogenerated conversion function. -func Convert_core_ContainerState_To_v1_ContainerState(in *core.ContainerState, out *v1.ContainerState, s conversion.Scope) error { - return autoConvert_core_ContainerState_To_v1_ContainerState(in, out, s) -} - -func autoConvert_v1_ContainerStateRunning_To_core_ContainerStateRunning(in *v1.ContainerStateRunning, out *core.ContainerStateRunning, s conversion.Scope) error { - out.StartedAt = in.StartedAt - return nil -} - -// Convert_v1_ContainerStateRunning_To_core_ContainerStateRunning is an autogenerated conversion function. -func Convert_v1_ContainerStateRunning_To_core_ContainerStateRunning(in *v1.ContainerStateRunning, out *core.ContainerStateRunning, s conversion.Scope) error { - return autoConvert_v1_ContainerStateRunning_To_core_ContainerStateRunning(in, out, s) -} - -func autoConvert_core_ContainerStateRunning_To_v1_ContainerStateRunning(in *core.ContainerStateRunning, out *v1.ContainerStateRunning, s conversion.Scope) error { - out.StartedAt = in.StartedAt - return nil -} - -// Convert_core_ContainerStateRunning_To_v1_ContainerStateRunning is an autogenerated conversion function. -func Convert_core_ContainerStateRunning_To_v1_ContainerStateRunning(in *core.ContainerStateRunning, out *v1.ContainerStateRunning, s conversion.Scope) error { - return autoConvert_core_ContainerStateRunning_To_v1_ContainerStateRunning(in, out, s) -} - -func autoConvert_v1_ContainerStateTerminated_To_core_ContainerStateTerminated(in *v1.ContainerStateTerminated, out *core.ContainerStateTerminated, s conversion.Scope) error { - out.ExitCode = in.ExitCode - out.Signal = in.Signal - out.Reason = in.Reason - out.Message = in.Message - out.StartedAt = in.StartedAt - out.FinishedAt = in.FinishedAt - out.ContainerID = in.ContainerID - return nil -} - -// Convert_v1_ContainerStateTerminated_To_core_ContainerStateTerminated is an autogenerated conversion function. -func Convert_v1_ContainerStateTerminated_To_core_ContainerStateTerminated(in *v1.ContainerStateTerminated, out *core.ContainerStateTerminated, s conversion.Scope) error { - return autoConvert_v1_ContainerStateTerminated_To_core_ContainerStateTerminated(in, out, s) -} - -func autoConvert_core_ContainerStateTerminated_To_v1_ContainerStateTerminated(in *core.ContainerStateTerminated, out *v1.ContainerStateTerminated, s conversion.Scope) error { - out.ExitCode = in.ExitCode - out.Signal = in.Signal - out.Reason = in.Reason - out.Message = in.Message - out.StartedAt = in.StartedAt - out.FinishedAt = in.FinishedAt - out.ContainerID = in.ContainerID - return nil -} - -// Convert_core_ContainerStateTerminated_To_v1_ContainerStateTerminated is an autogenerated conversion function. -func Convert_core_ContainerStateTerminated_To_v1_ContainerStateTerminated(in *core.ContainerStateTerminated, out *v1.ContainerStateTerminated, s conversion.Scope) error { - return autoConvert_core_ContainerStateTerminated_To_v1_ContainerStateTerminated(in, out, s) -} - -func autoConvert_v1_ContainerStateWaiting_To_core_ContainerStateWaiting(in *v1.ContainerStateWaiting, out *core.ContainerStateWaiting, s conversion.Scope) error { - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_ContainerStateWaiting_To_core_ContainerStateWaiting is an autogenerated conversion function. -func Convert_v1_ContainerStateWaiting_To_core_ContainerStateWaiting(in *v1.ContainerStateWaiting, out *core.ContainerStateWaiting, s conversion.Scope) error { - return autoConvert_v1_ContainerStateWaiting_To_core_ContainerStateWaiting(in, out, s) -} - -func autoConvert_core_ContainerStateWaiting_To_v1_ContainerStateWaiting(in *core.ContainerStateWaiting, out *v1.ContainerStateWaiting, s conversion.Scope) error { - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_ContainerStateWaiting_To_v1_ContainerStateWaiting is an autogenerated conversion function. -func Convert_core_ContainerStateWaiting_To_v1_ContainerStateWaiting(in *core.ContainerStateWaiting, out *v1.ContainerStateWaiting, s conversion.Scope) error { - return autoConvert_core_ContainerStateWaiting_To_v1_ContainerStateWaiting(in, out, s) -} - -func autoConvert_v1_ContainerStatus_To_core_ContainerStatus(in *v1.ContainerStatus, out *core.ContainerStatus, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1_ContainerState_To_core_ContainerState(&in.State, &out.State, s); err != nil { - return err - } - if err := Convert_v1_ContainerState_To_core_ContainerState(&in.LastTerminationState, &out.LastTerminationState, s); err != nil { - return err - } - out.Ready = in.Ready - out.RestartCount = in.RestartCount - out.Image = in.Image - out.ImageID = in.ImageID - out.ContainerID = in.ContainerID - out.Started = (*bool)(unsafe.Pointer(in.Started)) - out.AllocatedResources = *(*core.ResourceList)(unsafe.Pointer(&in.AllocatedResources)) - out.Resources = (*core.ResourceRequirements)(unsafe.Pointer(in.Resources)) - return nil -} - -// Convert_v1_ContainerStatus_To_core_ContainerStatus is an autogenerated conversion function. -func Convert_v1_ContainerStatus_To_core_ContainerStatus(in *v1.ContainerStatus, out *core.ContainerStatus, s conversion.Scope) error { - return autoConvert_v1_ContainerStatus_To_core_ContainerStatus(in, out, s) -} - -func autoConvert_core_ContainerStatus_To_v1_ContainerStatus(in *core.ContainerStatus, out *v1.ContainerStatus, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_core_ContainerState_To_v1_ContainerState(&in.State, &out.State, s); err != nil { - return err - } - if err := Convert_core_ContainerState_To_v1_ContainerState(&in.LastTerminationState, &out.LastTerminationState, s); err != nil { - return err - } - out.Ready = in.Ready - out.RestartCount = in.RestartCount - out.Image = in.Image - out.ImageID = in.ImageID - out.ContainerID = in.ContainerID - out.Started = (*bool)(unsafe.Pointer(in.Started)) - out.AllocatedResources = *(*v1.ResourceList)(unsafe.Pointer(&in.AllocatedResources)) - out.Resources = (*v1.ResourceRequirements)(unsafe.Pointer(in.Resources)) - return nil -} - -// Convert_core_ContainerStatus_To_v1_ContainerStatus is an autogenerated conversion function. -func Convert_core_ContainerStatus_To_v1_ContainerStatus(in *core.ContainerStatus, out *v1.ContainerStatus, s conversion.Scope) error { - return autoConvert_core_ContainerStatus_To_v1_ContainerStatus(in, out, s) -} - -func autoConvert_v1_DaemonEndpoint_To_core_DaemonEndpoint(in *v1.DaemonEndpoint, out *core.DaemonEndpoint, s conversion.Scope) error { - out.Port = in.Port - return nil -} - -// Convert_v1_DaemonEndpoint_To_core_DaemonEndpoint is an autogenerated conversion function. -func Convert_v1_DaemonEndpoint_To_core_DaemonEndpoint(in *v1.DaemonEndpoint, out *core.DaemonEndpoint, s conversion.Scope) error { - return autoConvert_v1_DaemonEndpoint_To_core_DaemonEndpoint(in, out, s) -} - -func autoConvert_core_DaemonEndpoint_To_v1_DaemonEndpoint(in *core.DaemonEndpoint, out *v1.DaemonEndpoint, s conversion.Scope) error { - out.Port = in.Port - return nil -} - -// Convert_core_DaemonEndpoint_To_v1_DaemonEndpoint is an autogenerated conversion function. -func Convert_core_DaemonEndpoint_To_v1_DaemonEndpoint(in *core.DaemonEndpoint, out *v1.DaemonEndpoint, s conversion.Scope) error { - return autoConvert_core_DaemonEndpoint_To_v1_DaemonEndpoint(in, out, s) -} - -func autoConvert_v1_DownwardAPIProjection_To_core_DownwardAPIProjection(in *v1.DownwardAPIProjection, out *core.DownwardAPIProjection, s conversion.Scope) error { - out.Items = *(*[]core.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_DownwardAPIProjection_To_core_DownwardAPIProjection is an autogenerated conversion function. -func Convert_v1_DownwardAPIProjection_To_core_DownwardAPIProjection(in *v1.DownwardAPIProjection, out *core.DownwardAPIProjection, s conversion.Scope) error { - return autoConvert_v1_DownwardAPIProjection_To_core_DownwardAPIProjection(in, out, s) -} - -func autoConvert_core_DownwardAPIProjection_To_v1_DownwardAPIProjection(in *core.DownwardAPIProjection, out *v1.DownwardAPIProjection, s conversion.Scope) error { - out.Items = *(*[]v1.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_DownwardAPIProjection_To_v1_DownwardAPIProjection is an autogenerated conversion function. -func Convert_core_DownwardAPIProjection_To_v1_DownwardAPIProjection(in *core.DownwardAPIProjection, out *v1.DownwardAPIProjection, s conversion.Scope) error { - return autoConvert_core_DownwardAPIProjection_To_v1_DownwardAPIProjection(in, out, s) -} - -func autoConvert_v1_DownwardAPIVolumeFile_To_core_DownwardAPIVolumeFile(in *v1.DownwardAPIVolumeFile, out *core.DownwardAPIVolumeFile, s conversion.Scope) error { - out.Path = in.Path - out.FieldRef = (*core.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) - out.ResourceFieldRef = (*core.ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) - out.Mode = (*int32)(unsafe.Pointer(in.Mode)) - return nil -} - -// Convert_v1_DownwardAPIVolumeFile_To_core_DownwardAPIVolumeFile is an autogenerated conversion function. -func Convert_v1_DownwardAPIVolumeFile_To_core_DownwardAPIVolumeFile(in *v1.DownwardAPIVolumeFile, out *core.DownwardAPIVolumeFile, s conversion.Scope) error { - return autoConvert_v1_DownwardAPIVolumeFile_To_core_DownwardAPIVolumeFile(in, out, s) -} - -func autoConvert_core_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *core.DownwardAPIVolumeFile, out *v1.DownwardAPIVolumeFile, s conversion.Scope) error { - out.Path = in.Path - out.FieldRef = (*v1.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) - out.ResourceFieldRef = (*v1.ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) - out.Mode = (*int32)(unsafe.Pointer(in.Mode)) - return nil -} - -// Convert_core_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile is an autogenerated conversion function. -func Convert_core_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in *core.DownwardAPIVolumeFile, out *v1.DownwardAPIVolumeFile, s conversion.Scope) error { - return autoConvert_core_DownwardAPIVolumeFile_To_v1_DownwardAPIVolumeFile(in, out, s) -} - -func autoConvert_v1_DownwardAPIVolumeSource_To_core_DownwardAPIVolumeSource(in *v1.DownwardAPIVolumeSource, out *core.DownwardAPIVolumeSource, s conversion.Scope) error { - out.Items = *(*[]core.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items)) - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - return nil -} - -// Convert_v1_DownwardAPIVolumeSource_To_core_DownwardAPIVolumeSource is an autogenerated conversion function. -func Convert_v1_DownwardAPIVolumeSource_To_core_DownwardAPIVolumeSource(in *v1.DownwardAPIVolumeSource, out *core.DownwardAPIVolumeSource, s conversion.Scope) error { - return autoConvert_v1_DownwardAPIVolumeSource_To_core_DownwardAPIVolumeSource(in, out, s) -} - -func autoConvert_core_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in *core.DownwardAPIVolumeSource, out *v1.DownwardAPIVolumeSource, s conversion.Scope) error { - out.Items = *(*[]v1.DownwardAPIVolumeFile)(unsafe.Pointer(&in.Items)) - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - return nil -} - -// Convert_core_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource is an autogenerated conversion function. -func Convert_core_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in *core.DownwardAPIVolumeSource, out *v1.DownwardAPIVolumeSource, s conversion.Scope) error { - return autoConvert_core_DownwardAPIVolumeSource_To_v1_DownwardAPIVolumeSource(in, out, s) -} - -func autoConvert_v1_EmptyDirVolumeSource_To_core_EmptyDirVolumeSource(in *v1.EmptyDirVolumeSource, out *core.EmptyDirVolumeSource, s conversion.Scope) error { - out.Medium = core.StorageMedium(in.Medium) - out.SizeLimit = (*resource.Quantity)(unsafe.Pointer(in.SizeLimit)) - return nil -} - -// Convert_v1_EmptyDirVolumeSource_To_core_EmptyDirVolumeSource is an autogenerated conversion function. -func Convert_v1_EmptyDirVolumeSource_To_core_EmptyDirVolumeSource(in *v1.EmptyDirVolumeSource, out *core.EmptyDirVolumeSource, s conversion.Scope) error { - return autoConvert_v1_EmptyDirVolumeSource_To_core_EmptyDirVolumeSource(in, out, s) -} - -func autoConvert_core_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in *core.EmptyDirVolumeSource, out *v1.EmptyDirVolumeSource, s conversion.Scope) error { - out.Medium = v1.StorageMedium(in.Medium) - out.SizeLimit = (*resource.Quantity)(unsafe.Pointer(in.SizeLimit)) - return nil -} - -// Convert_core_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource is an autogenerated conversion function. -func Convert_core_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in *core.EmptyDirVolumeSource, out *v1.EmptyDirVolumeSource, s conversion.Scope) error { - return autoConvert_core_EmptyDirVolumeSource_To_v1_EmptyDirVolumeSource(in, out, s) -} - -func autoConvert_v1_EndpointAddress_To_core_EndpointAddress(in *v1.EndpointAddress, out *core.EndpointAddress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) - out.TargetRef = (*core.ObjectReference)(unsafe.Pointer(in.TargetRef)) - return nil -} - -// Convert_v1_EndpointAddress_To_core_EndpointAddress is an autogenerated conversion function. -func Convert_v1_EndpointAddress_To_core_EndpointAddress(in *v1.EndpointAddress, out *core.EndpointAddress, s conversion.Scope) error { - return autoConvert_v1_EndpointAddress_To_core_EndpointAddress(in, out, s) -} - -func autoConvert_core_EndpointAddress_To_v1_EndpointAddress(in *core.EndpointAddress, out *v1.EndpointAddress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - out.NodeName = (*string)(unsafe.Pointer(in.NodeName)) - out.TargetRef = (*v1.ObjectReference)(unsafe.Pointer(in.TargetRef)) - return nil -} - -// Convert_core_EndpointAddress_To_v1_EndpointAddress is an autogenerated conversion function. -func Convert_core_EndpointAddress_To_v1_EndpointAddress(in *core.EndpointAddress, out *v1.EndpointAddress, s conversion.Scope) error { - return autoConvert_core_EndpointAddress_To_v1_EndpointAddress(in, out, s) -} - -func autoConvert_v1_EndpointPort_To_core_EndpointPort(in *v1.EndpointPort, out *core.EndpointPort, s conversion.Scope) error { - out.Name = in.Name - out.Port = in.Port - out.Protocol = core.Protocol(in.Protocol) - out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol)) - return nil -} - -// Convert_v1_EndpointPort_To_core_EndpointPort is an autogenerated conversion function. -func Convert_v1_EndpointPort_To_core_EndpointPort(in *v1.EndpointPort, out *core.EndpointPort, s conversion.Scope) error { - return autoConvert_v1_EndpointPort_To_core_EndpointPort(in, out, s) -} - -func autoConvert_core_EndpointPort_To_v1_EndpointPort(in *core.EndpointPort, out *v1.EndpointPort, s conversion.Scope) error { - out.Name = in.Name - out.Port = in.Port - out.Protocol = v1.Protocol(in.Protocol) - out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol)) - return nil -} - -// Convert_core_EndpointPort_To_v1_EndpointPort is an autogenerated conversion function. -func Convert_core_EndpointPort_To_v1_EndpointPort(in *core.EndpointPort, out *v1.EndpointPort, s conversion.Scope) error { - return autoConvert_core_EndpointPort_To_v1_EndpointPort(in, out, s) -} - -func autoConvert_v1_EndpointSubset_To_core_EndpointSubset(in *v1.EndpointSubset, out *core.EndpointSubset, s conversion.Scope) error { - out.Addresses = *(*[]core.EndpointAddress)(unsafe.Pointer(&in.Addresses)) - out.NotReadyAddresses = *(*[]core.EndpointAddress)(unsafe.Pointer(&in.NotReadyAddresses)) - out.Ports = *(*[]core.EndpointPort)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_v1_EndpointSubset_To_core_EndpointSubset is an autogenerated conversion function. -func Convert_v1_EndpointSubset_To_core_EndpointSubset(in *v1.EndpointSubset, out *core.EndpointSubset, s conversion.Scope) error { - return autoConvert_v1_EndpointSubset_To_core_EndpointSubset(in, out, s) -} - -func autoConvert_core_EndpointSubset_To_v1_EndpointSubset(in *core.EndpointSubset, out *v1.EndpointSubset, s conversion.Scope) error { - out.Addresses = *(*[]v1.EndpointAddress)(unsafe.Pointer(&in.Addresses)) - out.NotReadyAddresses = *(*[]v1.EndpointAddress)(unsafe.Pointer(&in.NotReadyAddresses)) - out.Ports = *(*[]v1.EndpointPort)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_core_EndpointSubset_To_v1_EndpointSubset is an autogenerated conversion function. -func Convert_core_EndpointSubset_To_v1_EndpointSubset(in *core.EndpointSubset, out *v1.EndpointSubset, s conversion.Scope) error { - return autoConvert_core_EndpointSubset_To_v1_EndpointSubset(in, out, s) -} - -func autoConvert_v1_Endpoints_To_core_Endpoints(in *v1.Endpoints, out *core.Endpoints, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Subsets = *(*[]core.EndpointSubset)(unsafe.Pointer(&in.Subsets)) - return nil -} - -// Convert_v1_Endpoints_To_core_Endpoints is an autogenerated conversion function. -func Convert_v1_Endpoints_To_core_Endpoints(in *v1.Endpoints, out *core.Endpoints, s conversion.Scope) error { - return autoConvert_v1_Endpoints_To_core_Endpoints(in, out, s) -} - -func autoConvert_core_Endpoints_To_v1_Endpoints(in *core.Endpoints, out *v1.Endpoints, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Subsets = *(*[]v1.EndpointSubset)(unsafe.Pointer(&in.Subsets)) - return nil -} - -// Convert_core_Endpoints_To_v1_Endpoints is an autogenerated conversion function. -func Convert_core_Endpoints_To_v1_Endpoints(in *core.Endpoints, out *v1.Endpoints, s conversion.Scope) error { - return autoConvert_core_Endpoints_To_v1_Endpoints(in, out, s) -} - -func autoConvert_v1_EndpointsList_To_core_EndpointsList(in *v1.EndpointsList, out *core.EndpointsList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.Endpoints)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_EndpointsList_To_core_EndpointsList is an autogenerated conversion function. -func Convert_v1_EndpointsList_To_core_EndpointsList(in *v1.EndpointsList, out *core.EndpointsList, s conversion.Scope) error { - return autoConvert_v1_EndpointsList_To_core_EndpointsList(in, out, s) -} - -func autoConvert_core_EndpointsList_To_v1_EndpointsList(in *core.EndpointsList, out *v1.EndpointsList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.Endpoints)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_EndpointsList_To_v1_EndpointsList is an autogenerated conversion function. -func Convert_core_EndpointsList_To_v1_EndpointsList(in *core.EndpointsList, out *v1.EndpointsList, s conversion.Scope) error { - return autoConvert_core_EndpointsList_To_v1_EndpointsList(in, out, s) -} - -func autoConvert_v1_EnvFromSource_To_core_EnvFromSource(in *v1.EnvFromSource, out *core.EnvFromSource, s conversion.Scope) error { - out.Prefix = in.Prefix - out.ConfigMapRef = (*core.ConfigMapEnvSource)(unsafe.Pointer(in.ConfigMapRef)) - out.SecretRef = (*core.SecretEnvSource)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_v1_EnvFromSource_To_core_EnvFromSource is an autogenerated conversion function. -func Convert_v1_EnvFromSource_To_core_EnvFromSource(in *v1.EnvFromSource, out *core.EnvFromSource, s conversion.Scope) error { - return autoConvert_v1_EnvFromSource_To_core_EnvFromSource(in, out, s) -} - -func autoConvert_core_EnvFromSource_To_v1_EnvFromSource(in *core.EnvFromSource, out *v1.EnvFromSource, s conversion.Scope) error { - out.Prefix = in.Prefix - out.ConfigMapRef = (*v1.ConfigMapEnvSource)(unsafe.Pointer(in.ConfigMapRef)) - out.SecretRef = (*v1.SecretEnvSource)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_core_EnvFromSource_To_v1_EnvFromSource is an autogenerated conversion function. -func Convert_core_EnvFromSource_To_v1_EnvFromSource(in *core.EnvFromSource, out *v1.EnvFromSource, s conversion.Scope) error { - return autoConvert_core_EnvFromSource_To_v1_EnvFromSource(in, out, s) -} - -func autoConvert_v1_EnvVar_To_core_EnvVar(in *v1.EnvVar, out *core.EnvVar, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - out.ValueFrom = (*core.EnvVarSource)(unsafe.Pointer(in.ValueFrom)) - return nil -} - -// Convert_v1_EnvVar_To_core_EnvVar is an autogenerated conversion function. -func Convert_v1_EnvVar_To_core_EnvVar(in *v1.EnvVar, out *core.EnvVar, s conversion.Scope) error { - return autoConvert_v1_EnvVar_To_core_EnvVar(in, out, s) -} - -func autoConvert_core_EnvVar_To_v1_EnvVar(in *core.EnvVar, out *v1.EnvVar, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - out.ValueFrom = (*v1.EnvVarSource)(unsafe.Pointer(in.ValueFrom)) - return nil -} - -// Convert_core_EnvVar_To_v1_EnvVar is an autogenerated conversion function. -func Convert_core_EnvVar_To_v1_EnvVar(in *core.EnvVar, out *v1.EnvVar, s conversion.Scope) error { - return autoConvert_core_EnvVar_To_v1_EnvVar(in, out, s) -} - -func autoConvert_v1_EnvVarSource_To_core_EnvVarSource(in *v1.EnvVarSource, out *core.EnvVarSource, s conversion.Scope) error { - out.FieldRef = (*core.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) - out.ResourceFieldRef = (*core.ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) - out.ConfigMapKeyRef = (*core.ConfigMapKeySelector)(unsafe.Pointer(in.ConfigMapKeyRef)) - out.SecretKeyRef = (*core.SecretKeySelector)(unsafe.Pointer(in.SecretKeyRef)) - return nil -} - -// Convert_v1_EnvVarSource_To_core_EnvVarSource is an autogenerated conversion function. -func Convert_v1_EnvVarSource_To_core_EnvVarSource(in *v1.EnvVarSource, out *core.EnvVarSource, s conversion.Scope) error { - return autoConvert_v1_EnvVarSource_To_core_EnvVarSource(in, out, s) -} - -func autoConvert_core_EnvVarSource_To_v1_EnvVarSource(in *core.EnvVarSource, out *v1.EnvVarSource, s conversion.Scope) error { - out.FieldRef = (*v1.ObjectFieldSelector)(unsafe.Pointer(in.FieldRef)) - out.ResourceFieldRef = (*v1.ResourceFieldSelector)(unsafe.Pointer(in.ResourceFieldRef)) - out.ConfigMapKeyRef = (*v1.ConfigMapKeySelector)(unsafe.Pointer(in.ConfigMapKeyRef)) - out.SecretKeyRef = (*v1.SecretKeySelector)(unsafe.Pointer(in.SecretKeyRef)) - return nil -} - -// Convert_core_EnvVarSource_To_v1_EnvVarSource is an autogenerated conversion function. -func Convert_core_EnvVarSource_To_v1_EnvVarSource(in *core.EnvVarSource, out *v1.EnvVarSource, s conversion.Scope) error { - return autoConvert_core_EnvVarSource_To_v1_EnvVarSource(in, out, s) -} - -func autoConvert_v1_EphemeralContainer_To_core_EphemeralContainer(in *v1.EphemeralContainer, out *core.EphemeralContainer, s conversion.Scope) error { - if err := Convert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon(&in.EphemeralContainerCommon, &out.EphemeralContainerCommon, s); err != nil { - return err - } - out.TargetContainerName = in.TargetContainerName - return nil -} - -// Convert_v1_EphemeralContainer_To_core_EphemeralContainer is an autogenerated conversion function. -func Convert_v1_EphemeralContainer_To_core_EphemeralContainer(in *v1.EphemeralContainer, out *core.EphemeralContainer, s conversion.Scope) error { - return autoConvert_v1_EphemeralContainer_To_core_EphemeralContainer(in, out, s) -} - -func autoConvert_core_EphemeralContainer_To_v1_EphemeralContainer(in *core.EphemeralContainer, out *v1.EphemeralContainer, s conversion.Scope) error { - if err := Convert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(&in.EphemeralContainerCommon, &out.EphemeralContainerCommon, s); err != nil { - return err - } - out.TargetContainerName = in.TargetContainerName - return nil -} - -// Convert_core_EphemeralContainer_To_v1_EphemeralContainer is an autogenerated conversion function. -func Convert_core_EphemeralContainer_To_v1_EphemeralContainer(in *core.EphemeralContainer, out *v1.EphemeralContainer, s conversion.Scope) error { - return autoConvert_core_EphemeralContainer_To_v1_EphemeralContainer(in, out, s) -} - -func autoConvert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon(in *v1.EphemeralContainerCommon, out *core.EphemeralContainerCommon, s conversion.Scope) error { - out.Name = in.Name - out.Image = in.Image - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) - out.WorkingDir = in.WorkingDir - out.Ports = *(*[]core.ContainerPort)(unsafe.Pointer(&in.Ports)) - out.EnvFrom = *(*[]core.EnvFromSource)(unsafe.Pointer(&in.EnvFrom)) - out.Env = *(*[]core.EnvVar)(unsafe.Pointer(&in.Env)) - if err := Convert_v1_ResourceRequirements_To_core_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.ResizePolicy = *(*[]core.ContainerResizePolicy)(unsafe.Pointer(&in.ResizePolicy)) - out.RestartPolicy = (*core.ContainerRestartPolicy)(unsafe.Pointer(in.RestartPolicy)) - out.VolumeMounts = *(*[]core.VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) - out.VolumeDevices = *(*[]core.VolumeDevice)(unsafe.Pointer(&in.VolumeDevices)) - out.LivenessProbe = (*core.Probe)(unsafe.Pointer(in.LivenessProbe)) - out.ReadinessProbe = (*core.Probe)(unsafe.Pointer(in.ReadinessProbe)) - out.StartupProbe = (*core.Probe)(unsafe.Pointer(in.StartupProbe)) - out.Lifecycle = (*core.Lifecycle)(unsafe.Pointer(in.Lifecycle)) - out.TerminationMessagePath = in.TerminationMessagePath - out.TerminationMessagePolicy = core.TerminationMessagePolicy(in.TerminationMessagePolicy) - out.ImagePullPolicy = core.PullPolicy(in.ImagePullPolicy) - out.SecurityContext = (*core.SecurityContext)(unsafe.Pointer(in.SecurityContext)) - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil -} - -// Convert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon is an autogenerated conversion function. -func Convert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon(in *v1.EphemeralContainerCommon, out *core.EphemeralContainerCommon, s conversion.Scope) error { - return autoConvert_v1_EphemeralContainerCommon_To_core_EphemeralContainerCommon(in, out, s) -} - -func autoConvert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(in *core.EphemeralContainerCommon, out *v1.EphemeralContainerCommon, s conversion.Scope) error { - out.Name = in.Name - out.Image = in.Image - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - out.Args = *(*[]string)(unsafe.Pointer(&in.Args)) - out.WorkingDir = in.WorkingDir - out.Ports = *(*[]v1.ContainerPort)(unsafe.Pointer(&in.Ports)) - out.EnvFrom = *(*[]v1.EnvFromSource)(unsafe.Pointer(&in.EnvFrom)) - out.Env = *(*[]v1.EnvVar)(unsafe.Pointer(&in.Env)) - if err := Convert_core_ResourceRequirements_To_v1_ResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.ResizePolicy = *(*[]v1.ContainerResizePolicy)(unsafe.Pointer(&in.ResizePolicy)) - out.RestartPolicy = (*v1.ContainerRestartPolicy)(unsafe.Pointer(in.RestartPolicy)) - out.VolumeMounts = *(*[]v1.VolumeMount)(unsafe.Pointer(&in.VolumeMounts)) - out.VolumeDevices = *(*[]v1.VolumeDevice)(unsafe.Pointer(&in.VolumeDevices)) - out.LivenessProbe = (*v1.Probe)(unsafe.Pointer(in.LivenessProbe)) - out.ReadinessProbe = (*v1.Probe)(unsafe.Pointer(in.ReadinessProbe)) - out.StartupProbe = (*v1.Probe)(unsafe.Pointer(in.StartupProbe)) - out.Lifecycle = (*v1.Lifecycle)(unsafe.Pointer(in.Lifecycle)) - out.TerminationMessagePath = in.TerminationMessagePath - out.TerminationMessagePolicy = v1.TerminationMessagePolicy(in.TerminationMessagePolicy) - out.ImagePullPolicy = v1.PullPolicy(in.ImagePullPolicy) - out.SecurityContext = (*v1.SecurityContext)(unsafe.Pointer(in.SecurityContext)) - out.Stdin = in.Stdin - out.StdinOnce = in.StdinOnce - out.TTY = in.TTY - return nil -} - -// Convert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon is an autogenerated conversion function. -func Convert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(in *core.EphemeralContainerCommon, out *v1.EphemeralContainerCommon, s conversion.Scope) error { - return autoConvert_core_EphemeralContainerCommon_To_v1_EphemeralContainerCommon(in, out, s) -} - -func autoConvert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(in *v1.EphemeralVolumeSource, out *core.EphemeralVolumeSource, s conversion.Scope) error { - out.VolumeClaimTemplate = (*core.PersistentVolumeClaimTemplate)(unsafe.Pointer(in.VolumeClaimTemplate)) - return nil -} - -// Convert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource is an autogenerated conversion function. -func Convert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(in *v1.EphemeralVolumeSource, out *core.EphemeralVolumeSource, s conversion.Scope) error { - return autoConvert_v1_EphemeralVolumeSource_To_core_EphemeralVolumeSource(in, out, s) -} - -func autoConvert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource(in *core.EphemeralVolumeSource, out *v1.EphemeralVolumeSource, s conversion.Scope) error { - out.VolumeClaimTemplate = (*v1.PersistentVolumeClaimTemplate)(unsafe.Pointer(in.VolumeClaimTemplate)) - return nil -} - -// Convert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource is an autogenerated conversion function. -func Convert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource(in *core.EphemeralVolumeSource, out *v1.EphemeralVolumeSource, s conversion.Scope) error { - return autoConvert_core_EphemeralVolumeSource_To_v1_EphemeralVolumeSource(in, out, s) -} - -func autoConvert_v1_Event_To_core_Event(in *v1.Event, out *core.Event, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_ObjectReference_To_core_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - if err := Convert_v1_EventSource_To_core_EventSource(&in.Source, &out.Source, s); err != nil { - return err - } - out.FirstTimestamp = in.FirstTimestamp - out.LastTimestamp = in.LastTimestamp - out.Count = in.Count - out.Type = in.Type - out.EventTime = in.EventTime - out.Series = (*core.EventSeries)(unsafe.Pointer(in.Series)) - out.Action = in.Action - out.Related = (*core.ObjectReference)(unsafe.Pointer(in.Related)) - out.ReportingController = in.ReportingController - out.ReportingInstance = in.ReportingInstance - return nil -} - -// Convert_v1_Event_To_core_Event is an autogenerated conversion function. -func Convert_v1_Event_To_core_Event(in *v1.Event, out *core.Event, s conversion.Scope) error { - return autoConvert_v1_Event_To_core_Event(in, out, s) -} - -func autoConvert_core_Event_To_v1_Event(in *core.Event, out *v1.Event, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_ObjectReference_To_v1_ObjectReference(&in.InvolvedObject, &out.InvolvedObject, s); err != nil { - return err - } - out.Reason = in.Reason - out.Message = in.Message - if err := Convert_core_EventSource_To_v1_EventSource(&in.Source, &out.Source, s); err != nil { - return err - } - out.FirstTimestamp = in.FirstTimestamp - out.LastTimestamp = in.LastTimestamp - out.Count = in.Count - out.Type = in.Type - out.EventTime = in.EventTime - out.Series = (*v1.EventSeries)(unsafe.Pointer(in.Series)) - out.Action = in.Action - out.Related = (*v1.ObjectReference)(unsafe.Pointer(in.Related)) - out.ReportingController = in.ReportingController - out.ReportingInstance = in.ReportingInstance - return nil -} - -// Convert_core_Event_To_v1_Event is an autogenerated conversion function. -func Convert_core_Event_To_v1_Event(in *core.Event, out *v1.Event, s conversion.Scope) error { - return autoConvert_core_Event_To_v1_Event(in, out, s) -} - -func autoConvert_v1_EventList_To_core_EventList(in *v1.EventList, out *core.EventList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.Event)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_EventList_To_core_EventList is an autogenerated conversion function. -func Convert_v1_EventList_To_core_EventList(in *v1.EventList, out *core.EventList, s conversion.Scope) error { - return autoConvert_v1_EventList_To_core_EventList(in, out, s) -} - -func autoConvert_core_EventList_To_v1_EventList(in *core.EventList, out *v1.EventList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.Event)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_EventList_To_v1_EventList is an autogenerated conversion function. -func Convert_core_EventList_To_v1_EventList(in *core.EventList, out *v1.EventList, s conversion.Scope) error { - return autoConvert_core_EventList_To_v1_EventList(in, out, s) -} - -func autoConvert_v1_EventSeries_To_core_EventSeries(in *v1.EventSeries, out *core.EventSeries, s conversion.Scope) error { - out.Count = in.Count - out.LastObservedTime = in.LastObservedTime - return nil -} - -// Convert_v1_EventSeries_To_core_EventSeries is an autogenerated conversion function. -func Convert_v1_EventSeries_To_core_EventSeries(in *v1.EventSeries, out *core.EventSeries, s conversion.Scope) error { - return autoConvert_v1_EventSeries_To_core_EventSeries(in, out, s) -} - -func autoConvert_core_EventSeries_To_v1_EventSeries(in *core.EventSeries, out *v1.EventSeries, s conversion.Scope) error { - out.Count = in.Count - out.LastObservedTime = in.LastObservedTime - return nil -} - -// Convert_core_EventSeries_To_v1_EventSeries is an autogenerated conversion function. -func Convert_core_EventSeries_To_v1_EventSeries(in *core.EventSeries, out *v1.EventSeries, s conversion.Scope) error { - return autoConvert_core_EventSeries_To_v1_EventSeries(in, out, s) -} - -func autoConvert_v1_EventSource_To_core_EventSource(in *v1.EventSource, out *core.EventSource, s conversion.Scope) error { - out.Component = in.Component - out.Host = in.Host - return nil -} - -// Convert_v1_EventSource_To_core_EventSource is an autogenerated conversion function. -func Convert_v1_EventSource_To_core_EventSource(in *v1.EventSource, out *core.EventSource, s conversion.Scope) error { - return autoConvert_v1_EventSource_To_core_EventSource(in, out, s) -} - -func autoConvert_core_EventSource_To_v1_EventSource(in *core.EventSource, out *v1.EventSource, s conversion.Scope) error { - out.Component = in.Component - out.Host = in.Host - return nil -} - -// Convert_core_EventSource_To_v1_EventSource is an autogenerated conversion function. -func Convert_core_EventSource_To_v1_EventSource(in *core.EventSource, out *v1.EventSource, s conversion.Scope) error { - return autoConvert_core_EventSource_To_v1_EventSource(in, out, s) -} - -func autoConvert_v1_ExecAction_To_core_ExecAction(in *v1.ExecAction, out *core.ExecAction, s conversion.Scope) error { - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - return nil -} - -// Convert_v1_ExecAction_To_core_ExecAction is an autogenerated conversion function. -func Convert_v1_ExecAction_To_core_ExecAction(in *v1.ExecAction, out *core.ExecAction, s conversion.Scope) error { - return autoConvert_v1_ExecAction_To_core_ExecAction(in, out, s) -} - -func autoConvert_core_ExecAction_To_v1_ExecAction(in *core.ExecAction, out *v1.ExecAction, s conversion.Scope) error { - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - return nil -} - -// Convert_core_ExecAction_To_v1_ExecAction is an autogenerated conversion function. -func Convert_core_ExecAction_To_v1_ExecAction(in *core.ExecAction, out *v1.ExecAction, s conversion.Scope) error { - return autoConvert_core_ExecAction_To_v1_ExecAction(in, out, s) -} - -func autoConvert_v1_FCVolumeSource_To_core_FCVolumeSource(in *v1.FCVolumeSource, out *core.FCVolumeSource, s conversion.Scope) error { - out.TargetWWNs = *(*[]string)(unsafe.Pointer(&in.TargetWWNs)) - out.Lun = (*int32)(unsafe.Pointer(in.Lun)) - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.WWIDs = *(*[]string)(unsafe.Pointer(&in.WWIDs)) - return nil -} - -// Convert_v1_FCVolumeSource_To_core_FCVolumeSource is an autogenerated conversion function. -func Convert_v1_FCVolumeSource_To_core_FCVolumeSource(in *v1.FCVolumeSource, out *core.FCVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FCVolumeSource_To_core_FCVolumeSource(in, out, s) -} - -func autoConvert_core_FCVolumeSource_To_v1_FCVolumeSource(in *core.FCVolumeSource, out *v1.FCVolumeSource, s conversion.Scope) error { - out.TargetWWNs = *(*[]string)(unsafe.Pointer(&in.TargetWWNs)) - out.Lun = (*int32)(unsafe.Pointer(in.Lun)) - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.WWIDs = *(*[]string)(unsafe.Pointer(&in.WWIDs)) - return nil -} - -// Convert_core_FCVolumeSource_To_v1_FCVolumeSource is an autogenerated conversion function. -func Convert_core_FCVolumeSource_To_v1_FCVolumeSource(in *core.FCVolumeSource, out *v1.FCVolumeSource, s conversion.Scope) error { - return autoConvert_core_FCVolumeSource_To_v1_FCVolumeSource(in, out, s) -} - -func autoConvert_v1_FlexPersistentVolumeSource_To_core_FlexPersistentVolumeSource(in *v1.FlexPersistentVolumeSource, out *core.FlexPersistentVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.FSType = in.FSType - out.SecretRef = (*core.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - out.Options = *(*map[string]string)(unsafe.Pointer(&in.Options)) - return nil -} - -// Convert_v1_FlexPersistentVolumeSource_To_core_FlexPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_FlexPersistentVolumeSource_To_core_FlexPersistentVolumeSource(in *v1.FlexPersistentVolumeSource, out *core.FlexPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FlexPersistentVolumeSource_To_core_FlexPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_FlexPersistentVolumeSource_To_v1_FlexPersistentVolumeSource(in *core.FlexPersistentVolumeSource, out *v1.FlexPersistentVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.FSType = in.FSType - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - out.Options = *(*map[string]string)(unsafe.Pointer(&in.Options)) - return nil -} - -// Convert_core_FlexPersistentVolumeSource_To_v1_FlexPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_FlexPersistentVolumeSource_To_v1_FlexPersistentVolumeSource(in *core.FlexPersistentVolumeSource, out *v1.FlexPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_FlexPersistentVolumeSource_To_v1_FlexPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_FlexVolumeSource_To_core_FlexVolumeSource(in *v1.FlexVolumeSource, out *core.FlexVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.FSType = in.FSType - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - out.Options = *(*map[string]string)(unsafe.Pointer(&in.Options)) - return nil -} - -// Convert_v1_FlexVolumeSource_To_core_FlexVolumeSource is an autogenerated conversion function. -func Convert_v1_FlexVolumeSource_To_core_FlexVolumeSource(in *v1.FlexVolumeSource, out *core.FlexVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FlexVolumeSource_To_core_FlexVolumeSource(in, out, s) -} - -func autoConvert_core_FlexVolumeSource_To_v1_FlexVolumeSource(in *core.FlexVolumeSource, out *v1.FlexVolumeSource, s conversion.Scope) error { - out.Driver = in.Driver - out.FSType = in.FSType - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - out.Options = *(*map[string]string)(unsafe.Pointer(&in.Options)) - return nil -} - -// Convert_core_FlexVolumeSource_To_v1_FlexVolumeSource is an autogenerated conversion function. -func Convert_core_FlexVolumeSource_To_v1_FlexVolumeSource(in *core.FlexVolumeSource, out *v1.FlexVolumeSource, s conversion.Scope) error { - return autoConvert_core_FlexVolumeSource_To_v1_FlexVolumeSource(in, out, s) -} - -func autoConvert_v1_FlockerVolumeSource_To_core_FlockerVolumeSource(in *v1.FlockerVolumeSource, out *core.FlockerVolumeSource, s conversion.Scope) error { - out.DatasetName = in.DatasetName - out.DatasetUUID = in.DatasetUUID - return nil -} - -// Convert_v1_FlockerVolumeSource_To_core_FlockerVolumeSource is an autogenerated conversion function. -func Convert_v1_FlockerVolumeSource_To_core_FlockerVolumeSource(in *v1.FlockerVolumeSource, out *core.FlockerVolumeSource, s conversion.Scope) error { - return autoConvert_v1_FlockerVolumeSource_To_core_FlockerVolumeSource(in, out, s) -} - -func autoConvert_core_FlockerVolumeSource_To_v1_FlockerVolumeSource(in *core.FlockerVolumeSource, out *v1.FlockerVolumeSource, s conversion.Scope) error { - out.DatasetName = in.DatasetName - out.DatasetUUID = in.DatasetUUID - return nil -} - -// Convert_core_FlockerVolumeSource_To_v1_FlockerVolumeSource is an autogenerated conversion function. -func Convert_core_FlockerVolumeSource_To_v1_FlockerVolumeSource(in *core.FlockerVolumeSource, out *v1.FlockerVolumeSource, s conversion.Scope) error { - return autoConvert_core_FlockerVolumeSource_To_v1_FlockerVolumeSource(in, out, s) -} - -func autoConvert_v1_GCEPersistentDiskVolumeSource_To_core_GCEPersistentDiskVolumeSource(in *v1.GCEPersistentDiskVolumeSource, out *core.GCEPersistentDiskVolumeSource, s conversion.Scope) error { - out.PDName = in.PDName - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_GCEPersistentDiskVolumeSource_To_core_GCEPersistentDiskVolumeSource is an autogenerated conversion function. -func Convert_v1_GCEPersistentDiskVolumeSource_To_core_GCEPersistentDiskVolumeSource(in *v1.GCEPersistentDiskVolumeSource, out *core.GCEPersistentDiskVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GCEPersistentDiskVolumeSource_To_core_GCEPersistentDiskVolumeSource(in, out, s) -} - -func autoConvert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in *core.GCEPersistentDiskVolumeSource, out *v1.GCEPersistentDiskVolumeSource, s conversion.Scope) error { - out.PDName = in.PDName - out.FSType = in.FSType - out.Partition = in.Partition - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource is an autogenerated conversion function. -func Convert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in *core.GCEPersistentDiskVolumeSource, out *v1.GCEPersistentDiskVolumeSource, s conversion.Scope) error { - return autoConvert_core_GCEPersistentDiskVolumeSource_To_v1_GCEPersistentDiskVolumeSource(in, out, s) -} - -func autoConvert_v1_GRPCAction_To_core_GRPCAction(in *v1.GRPCAction, out *core.GRPCAction, s conversion.Scope) error { - out.Port = in.Port - out.Service = (*string)(unsafe.Pointer(in.Service)) - return nil -} - -// Convert_v1_GRPCAction_To_core_GRPCAction is an autogenerated conversion function. -func Convert_v1_GRPCAction_To_core_GRPCAction(in *v1.GRPCAction, out *core.GRPCAction, s conversion.Scope) error { - return autoConvert_v1_GRPCAction_To_core_GRPCAction(in, out, s) -} - -func autoConvert_core_GRPCAction_To_v1_GRPCAction(in *core.GRPCAction, out *v1.GRPCAction, s conversion.Scope) error { - out.Port = in.Port - out.Service = (*string)(unsafe.Pointer(in.Service)) - return nil -} - -// Convert_core_GRPCAction_To_v1_GRPCAction is an autogenerated conversion function. -func Convert_core_GRPCAction_To_v1_GRPCAction(in *core.GRPCAction, out *v1.GRPCAction, s conversion.Scope) error { - return autoConvert_core_GRPCAction_To_v1_GRPCAction(in, out, s) -} - -func autoConvert_v1_GitRepoVolumeSource_To_core_GitRepoVolumeSource(in *v1.GitRepoVolumeSource, out *core.GitRepoVolumeSource, s conversion.Scope) error { - out.Repository = in.Repository - out.Revision = in.Revision - out.Directory = in.Directory - return nil -} - -// Convert_v1_GitRepoVolumeSource_To_core_GitRepoVolumeSource is an autogenerated conversion function. -func Convert_v1_GitRepoVolumeSource_To_core_GitRepoVolumeSource(in *v1.GitRepoVolumeSource, out *core.GitRepoVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GitRepoVolumeSource_To_core_GitRepoVolumeSource(in, out, s) -} - -func autoConvert_core_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(in *core.GitRepoVolumeSource, out *v1.GitRepoVolumeSource, s conversion.Scope) error { - out.Repository = in.Repository - out.Revision = in.Revision - out.Directory = in.Directory - return nil -} - -// Convert_core_GitRepoVolumeSource_To_v1_GitRepoVolumeSource is an autogenerated conversion function. -func Convert_core_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(in *core.GitRepoVolumeSource, out *v1.GitRepoVolumeSource, s conversion.Scope) error { - return autoConvert_core_GitRepoVolumeSource_To_v1_GitRepoVolumeSource(in, out, s) -} - -func autoConvert_v1_GlusterfsPersistentVolumeSource_To_core_GlusterfsPersistentVolumeSource(in *v1.GlusterfsPersistentVolumeSource, out *core.GlusterfsPersistentVolumeSource, s conversion.Scope) error { - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - out.EndpointsNamespace = (*string)(unsafe.Pointer(in.EndpointsNamespace)) - return nil -} - -// Convert_v1_GlusterfsPersistentVolumeSource_To_core_GlusterfsPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_GlusterfsPersistentVolumeSource_To_core_GlusterfsPersistentVolumeSource(in *v1.GlusterfsPersistentVolumeSource, out *core.GlusterfsPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GlusterfsPersistentVolumeSource_To_core_GlusterfsPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_GlusterfsPersistentVolumeSource_To_v1_GlusterfsPersistentVolumeSource(in *core.GlusterfsPersistentVolumeSource, out *v1.GlusterfsPersistentVolumeSource, s conversion.Scope) error { - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - out.EndpointsNamespace = (*string)(unsafe.Pointer(in.EndpointsNamespace)) - return nil -} - -// Convert_core_GlusterfsPersistentVolumeSource_To_v1_GlusterfsPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_GlusterfsPersistentVolumeSource_To_v1_GlusterfsPersistentVolumeSource(in *core.GlusterfsPersistentVolumeSource, out *v1.GlusterfsPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_GlusterfsPersistentVolumeSource_To_v1_GlusterfsPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_GlusterfsVolumeSource_To_core_GlusterfsVolumeSource(in *v1.GlusterfsVolumeSource, out *core.GlusterfsVolumeSource, s conversion.Scope) error { - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_GlusterfsVolumeSource_To_core_GlusterfsVolumeSource is an autogenerated conversion function. -func Convert_v1_GlusterfsVolumeSource_To_core_GlusterfsVolumeSource(in *v1.GlusterfsVolumeSource, out *core.GlusterfsVolumeSource, s conversion.Scope) error { - return autoConvert_v1_GlusterfsVolumeSource_To_core_GlusterfsVolumeSource(in, out, s) -} - -func autoConvert_core_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(in *core.GlusterfsVolumeSource, out *v1.GlusterfsVolumeSource, s conversion.Scope) error { - out.EndpointsName = in.EndpointsName - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource is an autogenerated conversion function. -func Convert_core_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(in *core.GlusterfsVolumeSource, out *v1.GlusterfsVolumeSource, s conversion.Scope) error { - return autoConvert_core_GlusterfsVolumeSource_To_v1_GlusterfsVolumeSource(in, out, s) -} - -func autoConvert_v1_HTTPGetAction_To_core_HTTPGetAction(in *v1.HTTPGetAction, out *core.HTTPGetAction, s conversion.Scope) error { - out.Path = in.Path - out.Port = in.Port - out.Host = in.Host - out.Scheme = core.URIScheme(in.Scheme) - out.HTTPHeaders = *(*[]core.HTTPHeader)(unsafe.Pointer(&in.HTTPHeaders)) - return nil -} - -// Convert_v1_HTTPGetAction_To_core_HTTPGetAction is an autogenerated conversion function. -func Convert_v1_HTTPGetAction_To_core_HTTPGetAction(in *v1.HTTPGetAction, out *core.HTTPGetAction, s conversion.Scope) error { - return autoConvert_v1_HTTPGetAction_To_core_HTTPGetAction(in, out, s) -} - -func autoConvert_core_HTTPGetAction_To_v1_HTTPGetAction(in *core.HTTPGetAction, out *v1.HTTPGetAction, s conversion.Scope) error { - out.Path = in.Path - out.Port = in.Port - out.Host = in.Host - out.Scheme = v1.URIScheme(in.Scheme) - out.HTTPHeaders = *(*[]v1.HTTPHeader)(unsafe.Pointer(&in.HTTPHeaders)) - return nil -} - -// Convert_core_HTTPGetAction_To_v1_HTTPGetAction is an autogenerated conversion function. -func Convert_core_HTTPGetAction_To_v1_HTTPGetAction(in *core.HTTPGetAction, out *v1.HTTPGetAction, s conversion.Scope) error { - return autoConvert_core_HTTPGetAction_To_v1_HTTPGetAction(in, out, s) -} - -func autoConvert_v1_HTTPHeader_To_core_HTTPHeader(in *v1.HTTPHeader, out *core.HTTPHeader, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - return nil -} - -// Convert_v1_HTTPHeader_To_core_HTTPHeader is an autogenerated conversion function. -func Convert_v1_HTTPHeader_To_core_HTTPHeader(in *v1.HTTPHeader, out *core.HTTPHeader, s conversion.Scope) error { - return autoConvert_v1_HTTPHeader_To_core_HTTPHeader(in, out, s) -} - -func autoConvert_core_HTTPHeader_To_v1_HTTPHeader(in *core.HTTPHeader, out *v1.HTTPHeader, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - return nil -} - -// Convert_core_HTTPHeader_To_v1_HTTPHeader is an autogenerated conversion function. -func Convert_core_HTTPHeader_To_v1_HTTPHeader(in *core.HTTPHeader, out *v1.HTTPHeader, s conversion.Scope) error { - return autoConvert_core_HTTPHeader_To_v1_HTTPHeader(in, out, s) -} - -func autoConvert_v1_HostAlias_To_core_HostAlias(in *v1.HostAlias, out *core.HostAlias, s conversion.Scope) error { - out.IP = in.IP - out.Hostnames = *(*[]string)(unsafe.Pointer(&in.Hostnames)) - return nil -} - -// Convert_v1_HostAlias_To_core_HostAlias is an autogenerated conversion function. -func Convert_v1_HostAlias_To_core_HostAlias(in *v1.HostAlias, out *core.HostAlias, s conversion.Scope) error { - return autoConvert_v1_HostAlias_To_core_HostAlias(in, out, s) -} - -func autoConvert_core_HostAlias_To_v1_HostAlias(in *core.HostAlias, out *v1.HostAlias, s conversion.Scope) error { - out.IP = in.IP - out.Hostnames = *(*[]string)(unsafe.Pointer(&in.Hostnames)) - return nil -} - -// Convert_core_HostAlias_To_v1_HostAlias is an autogenerated conversion function. -func Convert_core_HostAlias_To_v1_HostAlias(in *core.HostAlias, out *v1.HostAlias, s conversion.Scope) error { - return autoConvert_core_HostAlias_To_v1_HostAlias(in, out, s) -} - -func autoConvert_v1_HostIP_To_core_HostIP(in *v1.HostIP, out *core.HostIP, s conversion.Scope) error { - out.IP = in.IP - return nil -} - -// Convert_v1_HostIP_To_core_HostIP is an autogenerated conversion function. -func Convert_v1_HostIP_To_core_HostIP(in *v1.HostIP, out *core.HostIP, s conversion.Scope) error { - return autoConvert_v1_HostIP_To_core_HostIP(in, out, s) -} - -func autoConvert_core_HostIP_To_v1_HostIP(in *core.HostIP, out *v1.HostIP, s conversion.Scope) error { - out.IP = in.IP - return nil -} - -// Convert_core_HostIP_To_v1_HostIP is an autogenerated conversion function. -func Convert_core_HostIP_To_v1_HostIP(in *core.HostIP, out *v1.HostIP, s conversion.Scope) error { - return autoConvert_core_HostIP_To_v1_HostIP(in, out, s) -} - -func autoConvert_v1_HostPathVolumeSource_To_core_HostPathVolumeSource(in *v1.HostPathVolumeSource, out *core.HostPathVolumeSource, s conversion.Scope) error { - out.Path = in.Path - out.Type = (*core.HostPathType)(unsafe.Pointer(in.Type)) - return nil -} - -// Convert_v1_HostPathVolumeSource_To_core_HostPathVolumeSource is an autogenerated conversion function. -func Convert_v1_HostPathVolumeSource_To_core_HostPathVolumeSource(in *v1.HostPathVolumeSource, out *core.HostPathVolumeSource, s conversion.Scope) error { - return autoConvert_v1_HostPathVolumeSource_To_core_HostPathVolumeSource(in, out, s) -} - -func autoConvert_core_HostPathVolumeSource_To_v1_HostPathVolumeSource(in *core.HostPathVolumeSource, out *v1.HostPathVolumeSource, s conversion.Scope) error { - out.Path = in.Path - out.Type = (*v1.HostPathType)(unsafe.Pointer(in.Type)) - return nil -} - -// Convert_core_HostPathVolumeSource_To_v1_HostPathVolumeSource is an autogenerated conversion function. -func Convert_core_HostPathVolumeSource_To_v1_HostPathVolumeSource(in *core.HostPathVolumeSource, out *v1.HostPathVolumeSource, s conversion.Scope) error { - return autoConvert_core_HostPathVolumeSource_To_v1_HostPathVolumeSource(in, out, s) -} - -func autoConvert_v1_ISCSIPersistentVolumeSource_To_core_ISCSIPersistentVolumeSource(in *v1.ISCSIPersistentVolumeSource, out *core.ISCSIPersistentVolumeSource, s conversion.Scope) error { - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.Portals = *(*[]string)(unsafe.Pointer(&in.Portals)) - out.DiscoveryCHAPAuth = in.DiscoveryCHAPAuth - out.SessionCHAPAuth = in.SessionCHAPAuth - out.SecretRef = (*core.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.InitiatorName = (*string)(unsafe.Pointer(in.InitiatorName)) - return nil -} - -// Convert_v1_ISCSIPersistentVolumeSource_To_core_ISCSIPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_ISCSIPersistentVolumeSource_To_core_ISCSIPersistentVolumeSource(in *v1.ISCSIPersistentVolumeSource, out *core.ISCSIPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ISCSIPersistentVolumeSource_To_core_ISCSIPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_ISCSIPersistentVolumeSource_To_v1_ISCSIPersistentVolumeSource(in *core.ISCSIPersistentVolumeSource, out *v1.ISCSIPersistentVolumeSource, s conversion.Scope) error { - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.Portals = *(*[]string)(unsafe.Pointer(&in.Portals)) - out.DiscoveryCHAPAuth = in.DiscoveryCHAPAuth - out.SessionCHAPAuth = in.SessionCHAPAuth - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.InitiatorName = (*string)(unsafe.Pointer(in.InitiatorName)) - return nil -} - -// Convert_core_ISCSIPersistentVolumeSource_To_v1_ISCSIPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_ISCSIPersistentVolumeSource_To_v1_ISCSIPersistentVolumeSource(in *core.ISCSIPersistentVolumeSource, out *v1.ISCSIPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_ISCSIPersistentVolumeSource_To_v1_ISCSIPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_ISCSIVolumeSource_To_core_ISCSIVolumeSource(in *v1.ISCSIVolumeSource, out *core.ISCSIVolumeSource, s conversion.Scope) error { - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.Portals = *(*[]string)(unsafe.Pointer(&in.Portals)) - out.DiscoveryCHAPAuth = in.DiscoveryCHAPAuth - out.SessionCHAPAuth = in.SessionCHAPAuth - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.InitiatorName = (*string)(unsafe.Pointer(in.InitiatorName)) - return nil -} - -// Convert_v1_ISCSIVolumeSource_To_core_ISCSIVolumeSource is an autogenerated conversion function. -func Convert_v1_ISCSIVolumeSource_To_core_ISCSIVolumeSource(in *v1.ISCSIVolumeSource, out *core.ISCSIVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ISCSIVolumeSource_To_core_ISCSIVolumeSource(in, out, s) -} - -func autoConvert_core_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *core.ISCSIVolumeSource, out *v1.ISCSIVolumeSource, s conversion.Scope) error { - out.TargetPortal = in.TargetPortal - out.IQN = in.IQN - out.Lun = in.Lun - out.ISCSIInterface = in.ISCSIInterface - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.Portals = *(*[]string)(unsafe.Pointer(&in.Portals)) - out.DiscoveryCHAPAuth = in.DiscoveryCHAPAuth - out.SessionCHAPAuth = in.SessionCHAPAuth - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.InitiatorName = (*string)(unsafe.Pointer(in.InitiatorName)) - return nil -} - -// Convert_core_ISCSIVolumeSource_To_v1_ISCSIVolumeSource is an autogenerated conversion function. -func Convert_core_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in *core.ISCSIVolumeSource, out *v1.ISCSIVolumeSource, s conversion.Scope) error { - return autoConvert_core_ISCSIVolumeSource_To_v1_ISCSIVolumeSource(in, out, s) -} - -func autoConvert_v1_KeyToPath_To_core_KeyToPath(in *v1.KeyToPath, out *core.KeyToPath, s conversion.Scope) error { - out.Key = in.Key - out.Path = in.Path - out.Mode = (*int32)(unsafe.Pointer(in.Mode)) - return nil -} - -// Convert_v1_KeyToPath_To_core_KeyToPath is an autogenerated conversion function. -func Convert_v1_KeyToPath_To_core_KeyToPath(in *v1.KeyToPath, out *core.KeyToPath, s conversion.Scope) error { - return autoConvert_v1_KeyToPath_To_core_KeyToPath(in, out, s) -} - -func autoConvert_core_KeyToPath_To_v1_KeyToPath(in *core.KeyToPath, out *v1.KeyToPath, s conversion.Scope) error { - out.Key = in.Key - out.Path = in.Path - out.Mode = (*int32)(unsafe.Pointer(in.Mode)) - return nil -} - -// Convert_core_KeyToPath_To_v1_KeyToPath is an autogenerated conversion function. -func Convert_core_KeyToPath_To_v1_KeyToPath(in *core.KeyToPath, out *v1.KeyToPath, s conversion.Scope) error { - return autoConvert_core_KeyToPath_To_v1_KeyToPath(in, out, s) -} - -func autoConvert_v1_Lifecycle_To_core_Lifecycle(in *v1.Lifecycle, out *core.Lifecycle, s conversion.Scope) error { - out.PostStart = (*core.LifecycleHandler)(unsafe.Pointer(in.PostStart)) - out.PreStop = (*core.LifecycleHandler)(unsafe.Pointer(in.PreStop)) - return nil -} - -// Convert_v1_Lifecycle_To_core_Lifecycle is an autogenerated conversion function. -func Convert_v1_Lifecycle_To_core_Lifecycle(in *v1.Lifecycle, out *core.Lifecycle, s conversion.Scope) error { - return autoConvert_v1_Lifecycle_To_core_Lifecycle(in, out, s) -} - -func autoConvert_core_Lifecycle_To_v1_Lifecycle(in *core.Lifecycle, out *v1.Lifecycle, s conversion.Scope) error { - out.PostStart = (*v1.LifecycleHandler)(unsafe.Pointer(in.PostStart)) - out.PreStop = (*v1.LifecycleHandler)(unsafe.Pointer(in.PreStop)) - return nil -} - -// Convert_core_Lifecycle_To_v1_Lifecycle is an autogenerated conversion function. -func Convert_core_Lifecycle_To_v1_Lifecycle(in *core.Lifecycle, out *v1.Lifecycle, s conversion.Scope) error { - return autoConvert_core_Lifecycle_To_v1_Lifecycle(in, out, s) -} - -func autoConvert_v1_LifecycleHandler_To_core_LifecycleHandler(in *v1.LifecycleHandler, out *core.LifecycleHandler, s conversion.Scope) error { - out.Exec = (*core.ExecAction)(unsafe.Pointer(in.Exec)) - out.HTTPGet = (*core.HTTPGetAction)(unsafe.Pointer(in.HTTPGet)) - out.TCPSocket = (*core.TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) - out.Sleep = (*core.SleepAction)(unsafe.Pointer(in.Sleep)) - return nil -} - -// Convert_v1_LifecycleHandler_To_core_LifecycleHandler is an autogenerated conversion function. -func Convert_v1_LifecycleHandler_To_core_LifecycleHandler(in *v1.LifecycleHandler, out *core.LifecycleHandler, s conversion.Scope) error { - return autoConvert_v1_LifecycleHandler_To_core_LifecycleHandler(in, out, s) -} - -func autoConvert_core_LifecycleHandler_To_v1_LifecycleHandler(in *core.LifecycleHandler, out *v1.LifecycleHandler, s conversion.Scope) error { - out.Exec = (*v1.ExecAction)(unsafe.Pointer(in.Exec)) - out.HTTPGet = (*v1.HTTPGetAction)(unsafe.Pointer(in.HTTPGet)) - out.TCPSocket = (*v1.TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) - out.Sleep = (*v1.SleepAction)(unsafe.Pointer(in.Sleep)) - return nil -} - -// Convert_core_LifecycleHandler_To_v1_LifecycleHandler is an autogenerated conversion function. -func Convert_core_LifecycleHandler_To_v1_LifecycleHandler(in *core.LifecycleHandler, out *v1.LifecycleHandler, s conversion.Scope) error { - return autoConvert_core_LifecycleHandler_To_v1_LifecycleHandler(in, out, s) -} - -func autoConvert_v1_LimitRange_To_core_LimitRange(in *v1.LimitRange, out *core.LimitRange, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_LimitRangeSpec_To_core_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1_LimitRange_To_core_LimitRange is an autogenerated conversion function. -func Convert_v1_LimitRange_To_core_LimitRange(in *v1.LimitRange, out *core.LimitRange, s conversion.Scope) error { - return autoConvert_v1_LimitRange_To_core_LimitRange(in, out, s) -} - -func autoConvert_core_LimitRange_To_v1_LimitRange(in *core.LimitRange, out *v1.LimitRange, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_LimitRangeSpec_To_v1_LimitRangeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_core_LimitRange_To_v1_LimitRange is an autogenerated conversion function. -func Convert_core_LimitRange_To_v1_LimitRange(in *core.LimitRange, out *v1.LimitRange, s conversion.Scope) error { - return autoConvert_core_LimitRange_To_v1_LimitRange(in, out, s) -} - -func autoConvert_v1_LimitRangeItem_To_core_LimitRangeItem(in *v1.LimitRangeItem, out *core.LimitRangeItem, s conversion.Scope) error { - out.Type = core.LimitType(in.Type) - out.Max = *(*core.ResourceList)(unsafe.Pointer(&in.Max)) - out.Min = *(*core.ResourceList)(unsafe.Pointer(&in.Min)) - out.Default = *(*core.ResourceList)(unsafe.Pointer(&in.Default)) - out.DefaultRequest = *(*core.ResourceList)(unsafe.Pointer(&in.DefaultRequest)) - out.MaxLimitRequestRatio = *(*core.ResourceList)(unsafe.Pointer(&in.MaxLimitRequestRatio)) - return nil -} - -// Convert_v1_LimitRangeItem_To_core_LimitRangeItem is an autogenerated conversion function. -func Convert_v1_LimitRangeItem_To_core_LimitRangeItem(in *v1.LimitRangeItem, out *core.LimitRangeItem, s conversion.Scope) error { - return autoConvert_v1_LimitRangeItem_To_core_LimitRangeItem(in, out, s) -} - -func autoConvert_core_LimitRangeItem_To_v1_LimitRangeItem(in *core.LimitRangeItem, out *v1.LimitRangeItem, s conversion.Scope) error { - out.Type = v1.LimitType(in.Type) - out.Max = *(*v1.ResourceList)(unsafe.Pointer(&in.Max)) - out.Min = *(*v1.ResourceList)(unsafe.Pointer(&in.Min)) - out.Default = *(*v1.ResourceList)(unsafe.Pointer(&in.Default)) - out.DefaultRequest = *(*v1.ResourceList)(unsafe.Pointer(&in.DefaultRequest)) - out.MaxLimitRequestRatio = *(*v1.ResourceList)(unsafe.Pointer(&in.MaxLimitRequestRatio)) - return nil -} - -// Convert_core_LimitRangeItem_To_v1_LimitRangeItem is an autogenerated conversion function. -func Convert_core_LimitRangeItem_To_v1_LimitRangeItem(in *core.LimitRangeItem, out *v1.LimitRangeItem, s conversion.Scope) error { - return autoConvert_core_LimitRangeItem_To_v1_LimitRangeItem(in, out, s) -} - -func autoConvert_v1_LimitRangeList_To_core_LimitRangeList(in *v1.LimitRangeList, out *core.LimitRangeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.LimitRange)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_LimitRangeList_To_core_LimitRangeList is an autogenerated conversion function. -func Convert_v1_LimitRangeList_To_core_LimitRangeList(in *v1.LimitRangeList, out *core.LimitRangeList, s conversion.Scope) error { - return autoConvert_v1_LimitRangeList_To_core_LimitRangeList(in, out, s) -} - -func autoConvert_core_LimitRangeList_To_v1_LimitRangeList(in *core.LimitRangeList, out *v1.LimitRangeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.LimitRange)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_LimitRangeList_To_v1_LimitRangeList is an autogenerated conversion function. -func Convert_core_LimitRangeList_To_v1_LimitRangeList(in *core.LimitRangeList, out *v1.LimitRangeList, s conversion.Scope) error { - return autoConvert_core_LimitRangeList_To_v1_LimitRangeList(in, out, s) -} - -func autoConvert_v1_LimitRangeSpec_To_core_LimitRangeSpec(in *v1.LimitRangeSpec, out *core.LimitRangeSpec, s conversion.Scope) error { - out.Limits = *(*[]core.LimitRangeItem)(unsafe.Pointer(&in.Limits)) - return nil -} - -// Convert_v1_LimitRangeSpec_To_core_LimitRangeSpec is an autogenerated conversion function. -func Convert_v1_LimitRangeSpec_To_core_LimitRangeSpec(in *v1.LimitRangeSpec, out *core.LimitRangeSpec, s conversion.Scope) error { - return autoConvert_v1_LimitRangeSpec_To_core_LimitRangeSpec(in, out, s) -} - -func autoConvert_core_LimitRangeSpec_To_v1_LimitRangeSpec(in *core.LimitRangeSpec, out *v1.LimitRangeSpec, s conversion.Scope) error { - out.Limits = *(*[]v1.LimitRangeItem)(unsafe.Pointer(&in.Limits)) - return nil -} - -// Convert_core_LimitRangeSpec_To_v1_LimitRangeSpec is an autogenerated conversion function. -func Convert_core_LimitRangeSpec_To_v1_LimitRangeSpec(in *core.LimitRangeSpec, out *v1.LimitRangeSpec, s conversion.Scope) error { - return autoConvert_core_LimitRangeSpec_To_v1_LimitRangeSpec(in, out, s) -} - -func autoConvert_v1_List_To_core_List(in *v1.List, out *core.List, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]runtime.Object, len(*in)) - for i := range *in { - if err := runtime.Convert_runtime_RawExtension_To_runtime_Object(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_List_To_core_List is an autogenerated conversion function. -func Convert_v1_List_To_core_List(in *v1.List, out *core.List, s conversion.Scope) error { - return autoConvert_v1_List_To_core_List(in, out, s) -} - -func autoConvert_core_List_To_v1_List(in *core.List, out *v1.List, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]runtime.RawExtension, len(*in)) - for i := range *in { - if err := runtime.Convert_runtime_Object_To_runtime_RawExtension(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_List_To_v1_List is an autogenerated conversion function. -func Convert_core_List_To_v1_List(in *core.List, out *v1.List, s conversion.Scope) error { - return autoConvert_core_List_To_v1_List(in, out, s) -} - -func autoConvert_v1_LoadBalancerIngress_To_core_LoadBalancerIngress(in *v1.LoadBalancerIngress, out *core.LoadBalancerIngress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - out.IPMode = (*core.LoadBalancerIPMode)(unsafe.Pointer(in.IPMode)) - out.Ports = *(*[]core.PortStatus)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_v1_LoadBalancerIngress_To_core_LoadBalancerIngress is an autogenerated conversion function. -func Convert_v1_LoadBalancerIngress_To_core_LoadBalancerIngress(in *v1.LoadBalancerIngress, out *core.LoadBalancerIngress, s conversion.Scope) error { - return autoConvert_v1_LoadBalancerIngress_To_core_LoadBalancerIngress(in, out, s) -} - -func autoConvert_core_LoadBalancerIngress_To_v1_LoadBalancerIngress(in *core.LoadBalancerIngress, out *v1.LoadBalancerIngress, s conversion.Scope) error { - out.IP = in.IP - out.Hostname = in.Hostname - out.IPMode = (*v1.LoadBalancerIPMode)(unsafe.Pointer(in.IPMode)) - out.Ports = *(*[]v1.PortStatus)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_core_LoadBalancerIngress_To_v1_LoadBalancerIngress is an autogenerated conversion function. -func Convert_core_LoadBalancerIngress_To_v1_LoadBalancerIngress(in *core.LoadBalancerIngress, out *v1.LoadBalancerIngress, s conversion.Scope) error { - return autoConvert_core_LoadBalancerIngress_To_v1_LoadBalancerIngress(in, out, s) -} - -func autoConvert_v1_LoadBalancerStatus_To_core_LoadBalancerStatus(in *v1.LoadBalancerStatus, out *core.LoadBalancerStatus, s conversion.Scope) error { - out.Ingress = *(*[]core.LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) - return nil -} - -func autoConvert_core_LoadBalancerStatus_To_v1_LoadBalancerStatus(in *core.LoadBalancerStatus, out *v1.LoadBalancerStatus, s conversion.Scope) error { - out.Ingress = *(*[]v1.LoadBalancerIngress)(unsafe.Pointer(&in.Ingress)) - return nil -} - -func autoConvert_v1_LocalObjectReference_To_core_LocalObjectReference(in *v1.LocalObjectReference, out *core.LocalObjectReference, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_v1_LocalObjectReference_To_core_LocalObjectReference is an autogenerated conversion function. -func Convert_v1_LocalObjectReference_To_core_LocalObjectReference(in *v1.LocalObjectReference, out *core.LocalObjectReference, s conversion.Scope) error { - return autoConvert_v1_LocalObjectReference_To_core_LocalObjectReference(in, out, s) -} - -func autoConvert_core_LocalObjectReference_To_v1_LocalObjectReference(in *core.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_core_LocalObjectReference_To_v1_LocalObjectReference is an autogenerated conversion function. -func Convert_core_LocalObjectReference_To_v1_LocalObjectReference(in *core.LocalObjectReference, out *v1.LocalObjectReference, s conversion.Scope) error { - return autoConvert_core_LocalObjectReference_To_v1_LocalObjectReference(in, out, s) -} - -func autoConvert_v1_LocalVolumeSource_To_core_LocalVolumeSource(in *v1.LocalVolumeSource, out *core.LocalVolumeSource, s conversion.Scope) error { - out.Path = in.Path - out.FSType = (*string)(unsafe.Pointer(in.FSType)) - return nil -} - -// Convert_v1_LocalVolumeSource_To_core_LocalVolumeSource is an autogenerated conversion function. -func Convert_v1_LocalVolumeSource_To_core_LocalVolumeSource(in *v1.LocalVolumeSource, out *core.LocalVolumeSource, s conversion.Scope) error { - return autoConvert_v1_LocalVolumeSource_To_core_LocalVolumeSource(in, out, s) -} - -func autoConvert_core_LocalVolumeSource_To_v1_LocalVolumeSource(in *core.LocalVolumeSource, out *v1.LocalVolumeSource, s conversion.Scope) error { - out.Path = in.Path - out.FSType = (*string)(unsafe.Pointer(in.FSType)) - return nil -} - -// Convert_core_LocalVolumeSource_To_v1_LocalVolumeSource is an autogenerated conversion function. -func Convert_core_LocalVolumeSource_To_v1_LocalVolumeSource(in *core.LocalVolumeSource, out *v1.LocalVolumeSource, s conversion.Scope) error { - return autoConvert_core_LocalVolumeSource_To_v1_LocalVolumeSource(in, out, s) -} - -func autoConvert_v1_ModifyVolumeStatus_To_core_ModifyVolumeStatus(in *v1.ModifyVolumeStatus, out *core.ModifyVolumeStatus, s conversion.Scope) error { - out.TargetVolumeAttributesClassName = in.TargetVolumeAttributesClassName - out.Status = core.PersistentVolumeClaimModifyVolumeStatus(in.Status) - return nil -} - -// Convert_v1_ModifyVolumeStatus_To_core_ModifyVolumeStatus is an autogenerated conversion function. -func Convert_v1_ModifyVolumeStatus_To_core_ModifyVolumeStatus(in *v1.ModifyVolumeStatus, out *core.ModifyVolumeStatus, s conversion.Scope) error { - return autoConvert_v1_ModifyVolumeStatus_To_core_ModifyVolumeStatus(in, out, s) -} - -func autoConvert_core_ModifyVolumeStatus_To_v1_ModifyVolumeStatus(in *core.ModifyVolumeStatus, out *v1.ModifyVolumeStatus, s conversion.Scope) error { - out.TargetVolumeAttributesClassName = in.TargetVolumeAttributesClassName - out.Status = v1.PersistentVolumeClaimModifyVolumeStatus(in.Status) - return nil -} - -// Convert_core_ModifyVolumeStatus_To_v1_ModifyVolumeStatus is an autogenerated conversion function. -func Convert_core_ModifyVolumeStatus_To_v1_ModifyVolumeStatus(in *core.ModifyVolumeStatus, out *v1.ModifyVolumeStatus, s conversion.Scope) error { - return autoConvert_core_ModifyVolumeStatus_To_v1_ModifyVolumeStatus(in, out, s) -} - -func autoConvert_v1_NFSVolumeSource_To_core_NFSVolumeSource(in *v1.NFSVolumeSource, out *core.NFSVolumeSource, s conversion.Scope) error { - out.Server = in.Server - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_NFSVolumeSource_To_core_NFSVolumeSource is an autogenerated conversion function. -func Convert_v1_NFSVolumeSource_To_core_NFSVolumeSource(in *v1.NFSVolumeSource, out *core.NFSVolumeSource, s conversion.Scope) error { - return autoConvert_v1_NFSVolumeSource_To_core_NFSVolumeSource(in, out, s) -} - -func autoConvert_core_NFSVolumeSource_To_v1_NFSVolumeSource(in *core.NFSVolumeSource, out *v1.NFSVolumeSource, s conversion.Scope) error { - out.Server = in.Server - out.Path = in.Path - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_NFSVolumeSource_To_v1_NFSVolumeSource is an autogenerated conversion function. -func Convert_core_NFSVolumeSource_To_v1_NFSVolumeSource(in *core.NFSVolumeSource, out *v1.NFSVolumeSource, s conversion.Scope) error { - return autoConvert_core_NFSVolumeSource_To_v1_NFSVolumeSource(in, out, s) -} - -func autoConvert_v1_Namespace_To_core_Namespace(in *v1.Namespace, out *core.Namespace, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_NamespaceSpec_To_core_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_NamespaceStatus_To_core_NamespaceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_Namespace_To_core_Namespace is an autogenerated conversion function. -func Convert_v1_Namespace_To_core_Namespace(in *v1.Namespace, out *core.Namespace, s conversion.Scope) error { - return autoConvert_v1_Namespace_To_core_Namespace(in, out, s) -} - -func autoConvert_core_Namespace_To_v1_Namespace(in *core.Namespace, out *v1.Namespace, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_NamespaceSpec_To_v1_NamespaceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_NamespaceStatus_To_v1_NamespaceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_Namespace_To_v1_Namespace is an autogenerated conversion function. -func Convert_core_Namespace_To_v1_Namespace(in *core.Namespace, out *v1.Namespace, s conversion.Scope) error { - return autoConvert_core_Namespace_To_v1_Namespace(in, out, s) -} - -func autoConvert_v1_NamespaceCondition_To_core_NamespaceCondition(in *v1.NamespaceCondition, out *core.NamespaceCondition, s conversion.Scope) error { - out.Type = core.NamespaceConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_NamespaceCondition_To_core_NamespaceCondition is an autogenerated conversion function. -func Convert_v1_NamespaceCondition_To_core_NamespaceCondition(in *v1.NamespaceCondition, out *core.NamespaceCondition, s conversion.Scope) error { - return autoConvert_v1_NamespaceCondition_To_core_NamespaceCondition(in, out, s) -} - -func autoConvert_core_NamespaceCondition_To_v1_NamespaceCondition(in *core.NamespaceCondition, out *v1.NamespaceCondition, s conversion.Scope) error { - out.Type = v1.NamespaceConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_NamespaceCondition_To_v1_NamespaceCondition is an autogenerated conversion function. -func Convert_core_NamespaceCondition_To_v1_NamespaceCondition(in *core.NamespaceCondition, out *v1.NamespaceCondition, s conversion.Scope) error { - return autoConvert_core_NamespaceCondition_To_v1_NamespaceCondition(in, out, s) -} - -func autoConvert_v1_NamespaceList_To_core_NamespaceList(in *v1.NamespaceList, out *core.NamespaceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.Namespace)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_NamespaceList_To_core_NamespaceList is an autogenerated conversion function. -func Convert_v1_NamespaceList_To_core_NamespaceList(in *v1.NamespaceList, out *core.NamespaceList, s conversion.Scope) error { - return autoConvert_v1_NamespaceList_To_core_NamespaceList(in, out, s) -} - -func autoConvert_core_NamespaceList_To_v1_NamespaceList(in *core.NamespaceList, out *v1.NamespaceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.Namespace)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_NamespaceList_To_v1_NamespaceList is an autogenerated conversion function. -func Convert_core_NamespaceList_To_v1_NamespaceList(in *core.NamespaceList, out *v1.NamespaceList, s conversion.Scope) error { - return autoConvert_core_NamespaceList_To_v1_NamespaceList(in, out, s) -} - -func autoConvert_v1_NamespaceSpec_To_core_NamespaceSpec(in *v1.NamespaceSpec, out *core.NamespaceSpec, s conversion.Scope) error { - out.Finalizers = *(*[]core.FinalizerName)(unsafe.Pointer(&in.Finalizers)) - return nil -} - -// Convert_v1_NamespaceSpec_To_core_NamespaceSpec is an autogenerated conversion function. -func Convert_v1_NamespaceSpec_To_core_NamespaceSpec(in *v1.NamespaceSpec, out *core.NamespaceSpec, s conversion.Scope) error { - return autoConvert_v1_NamespaceSpec_To_core_NamespaceSpec(in, out, s) -} - -func autoConvert_core_NamespaceSpec_To_v1_NamespaceSpec(in *core.NamespaceSpec, out *v1.NamespaceSpec, s conversion.Scope) error { - out.Finalizers = *(*[]v1.FinalizerName)(unsafe.Pointer(&in.Finalizers)) - return nil -} - -// Convert_core_NamespaceSpec_To_v1_NamespaceSpec is an autogenerated conversion function. -func Convert_core_NamespaceSpec_To_v1_NamespaceSpec(in *core.NamespaceSpec, out *v1.NamespaceSpec, s conversion.Scope) error { - return autoConvert_core_NamespaceSpec_To_v1_NamespaceSpec(in, out, s) -} - -func autoConvert_v1_NamespaceStatus_To_core_NamespaceStatus(in *v1.NamespaceStatus, out *core.NamespaceStatus, s conversion.Scope) error { - out.Phase = core.NamespacePhase(in.Phase) - out.Conditions = *(*[]core.NamespaceCondition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1_NamespaceStatus_To_core_NamespaceStatus is an autogenerated conversion function. -func Convert_v1_NamespaceStatus_To_core_NamespaceStatus(in *v1.NamespaceStatus, out *core.NamespaceStatus, s conversion.Scope) error { - return autoConvert_v1_NamespaceStatus_To_core_NamespaceStatus(in, out, s) -} - -func autoConvert_core_NamespaceStatus_To_v1_NamespaceStatus(in *core.NamespaceStatus, out *v1.NamespaceStatus, s conversion.Scope) error { - out.Phase = v1.NamespacePhase(in.Phase) - out.Conditions = *(*[]v1.NamespaceCondition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_core_NamespaceStatus_To_v1_NamespaceStatus is an autogenerated conversion function. -func Convert_core_NamespaceStatus_To_v1_NamespaceStatus(in *core.NamespaceStatus, out *v1.NamespaceStatus, s conversion.Scope) error { - return autoConvert_core_NamespaceStatus_To_v1_NamespaceStatus(in, out, s) -} - -func autoConvert_v1_Node_To_core_Node(in *v1.Node, out *core.Node, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_NodeSpec_To_core_NodeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_NodeStatus_To_core_NodeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_Node_To_core_Node is an autogenerated conversion function. -func Convert_v1_Node_To_core_Node(in *v1.Node, out *core.Node, s conversion.Scope) error { - return autoConvert_v1_Node_To_core_Node(in, out, s) -} - -func autoConvert_core_Node_To_v1_Node(in *core.Node, out *v1.Node, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_NodeSpec_To_v1_NodeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_NodeStatus_To_v1_NodeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_Node_To_v1_Node is an autogenerated conversion function. -func Convert_core_Node_To_v1_Node(in *core.Node, out *v1.Node, s conversion.Scope) error { - return autoConvert_core_Node_To_v1_Node(in, out, s) -} - -func autoConvert_v1_NodeAddress_To_core_NodeAddress(in *v1.NodeAddress, out *core.NodeAddress, s conversion.Scope) error { - out.Type = core.NodeAddressType(in.Type) - out.Address = in.Address - return nil -} - -// Convert_v1_NodeAddress_To_core_NodeAddress is an autogenerated conversion function. -func Convert_v1_NodeAddress_To_core_NodeAddress(in *v1.NodeAddress, out *core.NodeAddress, s conversion.Scope) error { - return autoConvert_v1_NodeAddress_To_core_NodeAddress(in, out, s) -} - -func autoConvert_core_NodeAddress_To_v1_NodeAddress(in *core.NodeAddress, out *v1.NodeAddress, s conversion.Scope) error { - out.Type = v1.NodeAddressType(in.Type) - out.Address = in.Address - return nil -} - -// Convert_core_NodeAddress_To_v1_NodeAddress is an autogenerated conversion function. -func Convert_core_NodeAddress_To_v1_NodeAddress(in *core.NodeAddress, out *v1.NodeAddress, s conversion.Scope) error { - return autoConvert_core_NodeAddress_To_v1_NodeAddress(in, out, s) -} - -func autoConvert_v1_NodeAffinity_To_core_NodeAffinity(in *v1.NodeAffinity, out *core.NodeAffinity, s conversion.Scope) error { - out.RequiredDuringSchedulingIgnoredDuringExecution = (*core.NodeSelector)(unsafe.Pointer(in.RequiredDuringSchedulingIgnoredDuringExecution)) - out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]core.PreferredSchedulingTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) - return nil -} - -// Convert_v1_NodeAffinity_To_core_NodeAffinity is an autogenerated conversion function. -func Convert_v1_NodeAffinity_To_core_NodeAffinity(in *v1.NodeAffinity, out *core.NodeAffinity, s conversion.Scope) error { - return autoConvert_v1_NodeAffinity_To_core_NodeAffinity(in, out, s) -} - -func autoConvert_core_NodeAffinity_To_v1_NodeAffinity(in *core.NodeAffinity, out *v1.NodeAffinity, s conversion.Scope) error { - out.RequiredDuringSchedulingIgnoredDuringExecution = (*v1.NodeSelector)(unsafe.Pointer(in.RequiredDuringSchedulingIgnoredDuringExecution)) - out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]v1.PreferredSchedulingTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) - return nil -} - -// Convert_core_NodeAffinity_To_v1_NodeAffinity is an autogenerated conversion function. -func Convert_core_NodeAffinity_To_v1_NodeAffinity(in *core.NodeAffinity, out *v1.NodeAffinity, s conversion.Scope) error { - return autoConvert_core_NodeAffinity_To_v1_NodeAffinity(in, out, s) -} - -func autoConvert_v1_NodeCondition_To_core_NodeCondition(in *v1.NodeCondition, out *core.NodeCondition, s conversion.Scope) error { - out.Type = core.NodeConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.LastHeartbeatTime = in.LastHeartbeatTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_NodeCondition_To_core_NodeCondition is an autogenerated conversion function. -func Convert_v1_NodeCondition_To_core_NodeCondition(in *v1.NodeCondition, out *core.NodeCondition, s conversion.Scope) error { - return autoConvert_v1_NodeCondition_To_core_NodeCondition(in, out, s) -} - -func autoConvert_core_NodeCondition_To_v1_NodeCondition(in *core.NodeCondition, out *v1.NodeCondition, s conversion.Scope) error { - out.Type = v1.NodeConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastHeartbeatTime = in.LastHeartbeatTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_NodeCondition_To_v1_NodeCondition is an autogenerated conversion function. -func Convert_core_NodeCondition_To_v1_NodeCondition(in *core.NodeCondition, out *v1.NodeCondition, s conversion.Scope) error { - return autoConvert_core_NodeCondition_To_v1_NodeCondition(in, out, s) -} - -func autoConvert_v1_NodeConfigSource_To_core_NodeConfigSource(in *v1.NodeConfigSource, out *core.NodeConfigSource, s conversion.Scope) error { - out.ConfigMap = (*core.ConfigMapNodeConfigSource)(unsafe.Pointer(in.ConfigMap)) - return nil -} - -// Convert_v1_NodeConfigSource_To_core_NodeConfigSource is an autogenerated conversion function. -func Convert_v1_NodeConfigSource_To_core_NodeConfigSource(in *v1.NodeConfigSource, out *core.NodeConfigSource, s conversion.Scope) error { - return autoConvert_v1_NodeConfigSource_To_core_NodeConfigSource(in, out, s) -} - -func autoConvert_core_NodeConfigSource_To_v1_NodeConfigSource(in *core.NodeConfigSource, out *v1.NodeConfigSource, s conversion.Scope) error { - out.ConfigMap = (*v1.ConfigMapNodeConfigSource)(unsafe.Pointer(in.ConfigMap)) - return nil -} - -// Convert_core_NodeConfigSource_To_v1_NodeConfigSource is an autogenerated conversion function. -func Convert_core_NodeConfigSource_To_v1_NodeConfigSource(in *core.NodeConfigSource, out *v1.NodeConfigSource, s conversion.Scope) error { - return autoConvert_core_NodeConfigSource_To_v1_NodeConfigSource(in, out, s) -} - -func autoConvert_v1_NodeConfigStatus_To_core_NodeConfigStatus(in *v1.NodeConfigStatus, out *core.NodeConfigStatus, s conversion.Scope) error { - out.Assigned = (*core.NodeConfigSource)(unsafe.Pointer(in.Assigned)) - out.Active = (*core.NodeConfigSource)(unsafe.Pointer(in.Active)) - out.LastKnownGood = (*core.NodeConfigSource)(unsafe.Pointer(in.LastKnownGood)) - out.Error = in.Error - return nil -} - -// Convert_v1_NodeConfigStatus_To_core_NodeConfigStatus is an autogenerated conversion function. -func Convert_v1_NodeConfigStatus_To_core_NodeConfigStatus(in *v1.NodeConfigStatus, out *core.NodeConfigStatus, s conversion.Scope) error { - return autoConvert_v1_NodeConfigStatus_To_core_NodeConfigStatus(in, out, s) -} - -func autoConvert_core_NodeConfigStatus_To_v1_NodeConfigStatus(in *core.NodeConfigStatus, out *v1.NodeConfigStatus, s conversion.Scope) error { - out.Assigned = (*v1.NodeConfigSource)(unsafe.Pointer(in.Assigned)) - out.Active = (*v1.NodeConfigSource)(unsafe.Pointer(in.Active)) - out.LastKnownGood = (*v1.NodeConfigSource)(unsafe.Pointer(in.LastKnownGood)) - out.Error = in.Error - return nil -} - -// Convert_core_NodeConfigStatus_To_v1_NodeConfigStatus is an autogenerated conversion function. -func Convert_core_NodeConfigStatus_To_v1_NodeConfigStatus(in *core.NodeConfigStatus, out *v1.NodeConfigStatus, s conversion.Scope) error { - return autoConvert_core_NodeConfigStatus_To_v1_NodeConfigStatus(in, out, s) -} - -func autoConvert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints(in *v1.NodeDaemonEndpoints, out *core.NodeDaemonEndpoints, s conversion.Scope) error { - if err := Convert_v1_DaemonEndpoint_To_core_DaemonEndpoint(&in.KubeletEndpoint, &out.KubeletEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints is an autogenerated conversion function. -func Convert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints(in *v1.NodeDaemonEndpoints, out *core.NodeDaemonEndpoints, s conversion.Scope) error { - return autoConvert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints(in, out, s) -} - -func autoConvert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in *core.NodeDaemonEndpoints, out *v1.NodeDaemonEndpoints, s conversion.Scope) error { - if err := Convert_core_DaemonEndpoint_To_v1_DaemonEndpoint(&in.KubeletEndpoint, &out.KubeletEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints is an autogenerated conversion function. -func Convert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in *core.NodeDaemonEndpoints, out *v1.NodeDaemonEndpoints, s conversion.Scope) error { - return autoConvert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(in, out, s) -} - -func autoConvert_v1_NodeList_To_core_NodeList(in *v1.NodeList, out *core.NodeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.Node, len(*in)) - for i := range *in { - if err := Convert_v1_Node_To_core_Node(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_NodeList_To_core_NodeList is an autogenerated conversion function. -func Convert_v1_NodeList_To_core_NodeList(in *v1.NodeList, out *core.NodeList, s conversion.Scope) error { - return autoConvert_v1_NodeList_To_core_NodeList(in, out, s) -} - -func autoConvert_core_NodeList_To_v1_NodeList(in *core.NodeList, out *v1.NodeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.Node, len(*in)) - for i := range *in { - if err := Convert_core_Node_To_v1_Node(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_NodeList_To_v1_NodeList is an autogenerated conversion function. -func Convert_core_NodeList_To_v1_NodeList(in *core.NodeList, out *v1.NodeList, s conversion.Scope) error { - return autoConvert_core_NodeList_To_v1_NodeList(in, out, s) -} - -func autoConvert_v1_NodeProxyOptions_To_core_NodeProxyOptions(in *v1.NodeProxyOptions, out *core.NodeProxyOptions, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -// Convert_v1_NodeProxyOptions_To_core_NodeProxyOptions is an autogenerated conversion function. -func Convert_v1_NodeProxyOptions_To_core_NodeProxyOptions(in *v1.NodeProxyOptions, out *core.NodeProxyOptions, s conversion.Scope) error { - return autoConvert_v1_NodeProxyOptions_To_core_NodeProxyOptions(in, out, s) -} - -func autoConvert_core_NodeProxyOptions_To_v1_NodeProxyOptions(in *core.NodeProxyOptions, out *v1.NodeProxyOptions, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -// Convert_core_NodeProxyOptions_To_v1_NodeProxyOptions is an autogenerated conversion function. -func Convert_core_NodeProxyOptions_To_v1_NodeProxyOptions(in *core.NodeProxyOptions, out *v1.NodeProxyOptions, s conversion.Scope) error { - return autoConvert_core_NodeProxyOptions_To_v1_NodeProxyOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_NodeProxyOptions(in *url.Values, out *v1.NodeProxyOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["path"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_string(&values, &out.Path, s); err != nil { - return err - } - } else { - out.Path = "" - } - return nil -} - -// Convert_url_Values_To_v1_NodeProxyOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_NodeProxyOptions(in *url.Values, out *v1.NodeProxyOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_NodeProxyOptions(in, out, s) -} - -func autoConvert_v1_NodeResources_To_core_NodeResources(in *v1.NodeResources, out *core.NodeResources, s conversion.Scope) error { - out.Capacity = *(*core.ResourceList)(unsafe.Pointer(&in.Capacity)) - return nil -} - -// Convert_v1_NodeResources_To_core_NodeResources is an autogenerated conversion function. -func Convert_v1_NodeResources_To_core_NodeResources(in *v1.NodeResources, out *core.NodeResources, s conversion.Scope) error { - return autoConvert_v1_NodeResources_To_core_NodeResources(in, out, s) -} - -func autoConvert_core_NodeResources_To_v1_NodeResources(in *core.NodeResources, out *v1.NodeResources, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - return nil -} - -// Convert_core_NodeResources_To_v1_NodeResources is an autogenerated conversion function. -func Convert_core_NodeResources_To_v1_NodeResources(in *core.NodeResources, out *v1.NodeResources, s conversion.Scope) error { - return autoConvert_core_NodeResources_To_v1_NodeResources(in, out, s) -} - -func autoConvert_v1_NodeSelector_To_core_NodeSelector(in *v1.NodeSelector, out *core.NodeSelector, s conversion.Scope) error { - out.NodeSelectorTerms = *(*[]core.NodeSelectorTerm)(unsafe.Pointer(&in.NodeSelectorTerms)) - return nil -} - -// Convert_v1_NodeSelector_To_core_NodeSelector is an autogenerated conversion function. -func Convert_v1_NodeSelector_To_core_NodeSelector(in *v1.NodeSelector, out *core.NodeSelector, s conversion.Scope) error { - return autoConvert_v1_NodeSelector_To_core_NodeSelector(in, out, s) -} - -func autoConvert_core_NodeSelector_To_v1_NodeSelector(in *core.NodeSelector, out *v1.NodeSelector, s conversion.Scope) error { - out.NodeSelectorTerms = *(*[]v1.NodeSelectorTerm)(unsafe.Pointer(&in.NodeSelectorTerms)) - return nil -} - -// Convert_core_NodeSelector_To_v1_NodeSelector is an autogenerated conversion function. -func Convert_core_NodeSelector_To_v1_NodeSelector(in *core.NodeSelector, out *v1.NodeSelector, s conversion.Scope) error { - return autoConvert_core_NodeSelector_To_v1_NodeSelector(in, out, s) -} - -func autoConvert_v1_NodeSelectorRequirement_To_core_NodeSelectorRequirement(in *v1.NodeSelectorRequirement, out *core.NodeSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = core.NodeSelectorOperator(in.Operator) - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_v1_NodeSelectorRequirement_To_core_NodeSelectorRequirement is an autogenerated conversion function. -func Convert_v1_NodeSelectorRequirement_To_core_NodeSelectorRequirement(in *v1.NodeSelectorRequirement, out *core.NodeSelectorRequirement, s conversion.Scope) error { - return autoConvert_v1_NodeSelectorRequirement_To_core_NodeSelectorRequirement(in, out, s) -} - -func autoConvert_core_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in *core.NodeSelectorRequirement, out *v1.NodeSelectorRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Operator = v1.NodeSelectorOperator(in.Operator) - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_core_NodeSelectorRequirement_To_v1_NodeSelectorRequirement is an autogenerated conversion function. -func Convert_core_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in *core.NodeSelectorRequirement, out *v1.NodeSelectorRequirement, s conversion.Scope) error { - return autoConvert_core_NodeSelectorRequirement_To_v1_NodeSelectorRequirement(in, out, s) -} - -func autoConvert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm(in *v1.NodeSelectorTerm, out *core.NodeSelectorTerm, s conversion.Scope) error { - out.MatchExpressions = *(*[]core.NodeSelectorRequirement)(unsafe.Pointer(&in.MatchExpressions)) - out.MatchFields = *(*[]core.NodeSelectorRequirement)(unsafe.Pointer(&in.MatchFields)) - return nil -} - -// Convert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm is an autogenerated conversion function. -func Convert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm(in *v1.NodeSelectorTerm, out *core.NodeSelectorTerm, s conversion.Scope) error { - return autoConvert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm(in, out, s) -} - -func autoConvert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm(in *core.NodeSelectorTerm, out *v1.NodeSelectorTerm, s conversion.Scope) error { - out.MatchExpressions = *(*[]v1.NodeSelectorRequirement)(unsafe.Pointer(&in.MatchExpressions)) - out.MatchFields = *(*[]v1.NodeSelectorRequirement)(unsafe.Pointer(&in.MatchFields)) - return nil -} - -// Convert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm is an autogenerated conversion function. -func Convert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm(in *core.NodeSelectorTerm, out *v1.NodeSelectorTerm, s conversion.Scope) error { - return autoConvert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm(in, out, s) -} - -func autoConvert_v1_NodeSpec_To_core_NodeSpec(in *v1.NodeSpec, out *core.NodeSpec, s conversion.Scope) error { - // WARNING: in.PodCIDR requires manual conversion: does not exist in peer-type - out.PodCIDRs = *(*[]string)(unsafe.Pointer(&in.PodCIDRs)) - out.ProviderID = in.ProviderID - out.Unschedulable = in.Unschedulable - out.Taints = *(*[]core.Taint)(unsafe.Pointer(&in.Taints)) - out.ConfigSource = (*core.NodeConfigSource)(unsafe.Pointer(in.ConfigSource)) - out.DoNotUseExternalID = in.DoNotUseExternalID - return nil -} - -func autoConvert_core_NodeSpec_To_v1_NodeSpec(in *core.NodeSpec, out *v1.NodeSpec, s conversion.Scope) error { - out.PodCIDRs = *(*[]string)(unsafe.Pointer(&in.PodCIDRs)) - out.ProviderID = in.ProviderID - out.Unschedulable = in.Unschedulable - out.Taints = *(*[]v1.Taint)(unsafe.Pointer(&in.Taints)) - out.ConfigSource = (*v1.NodeConfigSource)(unsafe.Pointer(in.ConfigSource)) - out.DoNotUseExternalID = in.DoNotUseExternalID - return nil -} - -func autoConvert_v1_NodeStatus_To_core_NodeStatus(in *v1.NodeStatus, out *core.NodeStatus, s conversion.Scope) error { - out.Capacity = *(*core.ResourceList)(unsafe.Pointer(&in.Capacity)) - out.Allocatable = *(*core.ResourceList)(unsafe.Pointer(&in.Allocatable)) - out.Phase = core.NodePhase(in.Phase) - out.Conditions = *(*[]core.NodeCondition)(unsafe.Pointer(&in.Conditions)) - out.Addresses = *(*[]core.NodeAddress)(unsafe.Pointer(&in.Addresses)) - if err := Convert_v1_NodeDaemonEndpoints_To_core_NodeDaemonEndpoints(&in.DaemonEndpoints, &out.DaemonEndpoints, s); err != nil { - return err - } - if err := Convert_v1_NodeSystemInfo_To_core_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil { - return err - } - out.Images = *(*[]core.ContainerImage)(unsafe.Pointer(&in.Images)) - out.VolumesInUse = *(*[]core.UniqueVolumeName)(unsafe.Pointer(&in.VolumesInUse)) - out.VolumesAttached = *(*[]core.AttachedVolume)(unsafe.Pointer(&in.VolumesAttached)) - out.Config = (*core.NodeConfigStatus)(unsafe.Pointer(in.Config)) - return nil -} - -// Convert_v1_NodeStatus_To_core_NodeStatus is an autogenerated conversion function. -func Convert_v1_NodeStatus_To_core_NodeStatus(in *v1.NodeStatus, out *core.NodeStatus, s conversion.Scope) error { - return autoConvert_v1_NodeStatus_To_core_NodeStatus(in, out, s) -} - -func autoConvert_core_NodeStatus_To_v1_NodeStatus(in *core.NodeStatus, out *v1.NodeStatus, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - out.Allocatable = *(*v1.ResourceList)(unsafe.Pointer(&in.Allocatable)) - out.Phase = v1.NodePhase(in.Phase) - out.Conditions = *(*[]v1.NodeCondition)(unsafe.Pointer(&in.Conditions)) - out.Addresses = *(*[]v1.NodeAddress)(unsafe.Pointer(&in.Addresses)) - if err := Convert_core_NodeDaemonEndpoints_To_v1_NodeDaemonEndpoints(&in.DaemonEndpoints, &out.DaemonEndpoints, s); err != nil { - return err - } - if err := Convert_core_NodeSystemInfo_To_v1_NodeSystemInfo(&in.NodeInfo, &out.NodeInfo, s); err != nil { - return err - } - out.Images = *(*[]v1.ContainerImage)(unsafe.Pointer(&in.Images)) - out.VolumesInUse = *(*[]v1.UniqueVolumeName)(unsafe.Pointer(&in.VolumesInUse)) - out.VolumesAttached = *(*[]v1.AttachedVolume)(unsafe.Pointer(&in.VolumesAttached)) - out.Config = (*v1.NodeConfigStatus)(unsafe.Pointer(in.Config)) - return nil -} - -// Convert_core_NodeStatus_To_v1_NodeStatus is an autogenerated conversion function. -func Convert_core_NodeStatus_To_v1_NodeStatus(in *core.NodeStatus, out *v1.NodeStatus, s conversion.Scope) error { - return autoConvert_core_NodeStatus_To_v1_NodeStatus(in, out, s) -} - -func autoConvert_v1_NodeSystemInfo_To_core_NodeSystemInfo(in *v1.NodeSystemInfo, out *core.NodeSystemInfo, s conversion.Scope) error { - out.MachineID = in.MachineID - out.SystemUUID = in.SystemUUID - out.BootID = in.BootID - out.KernelVersion = in.KernelVersion - out.OSImage = in.OSImage - out.ContainerRuntimeVersion = in.ContainerRuntimeVersion - out.KubeletVersion = in.KubeletVersion - out.KubeProxyVersion = in.KubeProxyVersion - out.OperatingSystem = in.OperatingSystem - out.Architecture = in.Architecture - return nil -} - -// Convert_v1_NodeSystemInfo_To_core_NodeSystemInfo is an autogenerated conversion function. -func Convert_v1_NodeSystemInfo_To_core_NodeSystemInfo(in *v1.NodeSystemInfo, out *core.NodeSystemInfo, s conversion.Scope) error { - return autoConvert_v1_NodeSystemInfo_To_core_NodeSystemInfo(in, out, s) -} - -func autoConvert_core_NodeSystemInfo_To_v1_NodeSystemInfo(in *core.NodeSystemInfo, out *v1.NodeSystemInfo, s conversion.Scope) error { - out.MachineID = in.MachineID - out.SystemUUID = in.SystemUUID - out.BootID = in.BootID - out.KernelVersion = in.KernelVersion - out.OSImage = in.OSImage - out.ContainerRuntimeVersion = in.ContainerRuntimeVersion - out.KubeletVersion = in.KubeletVersion - out.KubeProxyVersion = in.KubeProxyVersion - out.OperatingSystem = in.OperatingSystem - out.Architecture = in.Architecture - return nil -} - -// Convert_core_NodeSystemInfo_To_v1_NodeSystemInfo is an autogenerated conversion function. -func Convert_core_NodeSystemInfo_To_v1_NodeSystemInfo(in *core.NodeSystemInfo, out *v1.NodeSystemInfo, s conversion.Scope) error { - return autoConvert_core_NodeSystemInfo_To_v1_NodeSystemInfo(in, out, s) -} - -func autoConvert_v1_ObjectFieldSelector_To_core_ObjectFieldSelector(in *v1.ObjectFieldSelector, out *core.ObjectFieldSelector, s conversion.Scope) error { - out.APIVersion = in.APIVersion - out.FieldPath = in.FieldPath - return nil -} - -// Convert_v1_ObjectFieldSelector_To_core_ObjectFieldSelector is an autogenerated conversion function. -func Convert_v1_ObjectFieldSelector_To_core_ObjectFieldSelector(in *v1.ObjectFieldSelector, out *core.ObjectFieldSelector, s conversion.Scope) error { - return autoConvert_v1_ObjectFieldSelector_To_core_ObjectFieldSelector(in, out, s) -} - -func autoConvert_core_ObjectFieldSelector_To_v1_ObjectFieldSelector(in *core.ObjectFieldSelector, out *v1.ObjectFieldSelector, s conversion.Scope) error { - out.APIVersion = in.APIVersion - out.FieldPath = in.FieldPath - return nil -} - -// Convert_core_ObjectFieldSelector_To_v1_ObjectFieldSelector is an autogenerated conversion function. -func Convert_core_ObjectFieldSelector_To_v1_ObjectFieldSelector(in *core.ObjectFieldSelector, out *v1.ObjectFieldSelector, s conversion.Scope) error { - return autoConvert_core_ObjectFieldSelector_To_v1_ObjectFieldSelector(in, out, s) -} - -func autoConvert_v1_ObjectReference_To_core_ObjectReference(in *v1.ObjectReference, out *core.ObjectReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = types.UID(in.UID) - out.APIVersion = in.APIVersion - out.ResourceVersion = in.ResourceVersion - out.FieldPath = in.FieldPath - return nil -} - -// Convert_v1_ObjectReference_To_core_ObjectReference is an autogenerated conversion function. -func Convert_v1_ObjectReference_To_core_ObjectReference(in *v1.ObjectReference, out *core.ObjectReference, s conversion.Scope) error { - return autoConvert_v1_ObjectReference_To_core_ObjectReference(in, out, s) -} - -func autoConvert_core_ObjectReference_To_v1_ObjectReference(in *core.ObjectReference, out *v1.ObjectReference, s conversion.Scope) error { - out.Kind = in.Kind - out.Namespace = in.Namespace - out.Name = in.Name - out.UID = types.UID(in.UID) - out.APIVersion = in.APIVersion - out.ResourceVersion = in.ResourceVersion - out.FieldPath = in.FieldPath - return nil -} - -// Convert_core_ObjectReference_To_v1_ObjectReference is an autogenerated conversion function. -func Convert_core_ObjectReference_To_v1_ObjectReference(in *core.ObjectReference, out *v1.ObjectReference, s conversion.Scope) error { - return autoConvert_core_ObjectReference_To_v1_ObjectReference(in, out, s) -} - -func autoConvert_v1_PersistentVolume_To_core_PersistentVolume(in *v1.PersistentVolume, out *core.PersistentVolume, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_PersistentVolumeSpec_To_core_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PersistentVolume_To_core_PersistentVolume is an autogenerated conversion function. -func Convert_v1_PersistentVolume_To_core_PersistentVolume(in *v1.PersistentVolume, out *core.PersistentVolume, s conversion.Scope) error { - return autoConvert_v1_PersistentVolume_To_core_PersistentVolume(in, out, s) -} - -func autoConvert_core_PersistentVolume_To_v1_PersistentVolume(in *core.PersistentVolume, out *v1.PersistentVolume, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_PersistentVolume_To_v1_PersistentVolume is an autogenerated conversion function. -func Convert_core_PersistentVolume_To_v1_PersistentVolume(in *core.PersistentVolume, out *v1.PersistentVolume, s conversion.Scope) error { - return autoConvert_core_PersistentVolume_To_v1_PersistentVolume(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaim_To_core_PersistentVolumeClaim(in *v1.PersistentVolumeClaim, out *core.PersistentVolumeClaim, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PersistentVolumeClaim_To_core_PersistentVolumeClaim is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaim_To_core_PersistentVolumeClaim(in *v1.PersistentVolumeClaim, out *core.PersistentVolumeClaim, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaim_To_core_PersistentVolumeClaim(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in *core.PersistentVolumeClaim, out *v1.PersistentVolumeClaim, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_PersistentVolumeClaim_To_v1_PersistentVolumeClaim is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in *core.PersistentVolumeClaim, out *v1.PersistentVolumeClaim, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaim_To_v1_PersistentVolumeClaim(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimCondition_To_core_PersistentVolumeClaimCondition(in *v1.PersistentVolumeClaimCondition, out *core.PersistentVolumeClaimCondition, s conversion.Scope) error { - out.Type = core.PersistentVolumeClaimConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_PersistentVolumeClaimCondition_To_core_PersistentVolumeClaimCondition is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaimCondition_To_core_PersistentVolumeClaimCondition(in *v1.PersistentVolumeClaimCondition, out *core.PersistentVolumeClaimCondition, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimCondition_To_core_PersistentVolumeClaimCondition(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaimCondition_To_v1_PersistentVolumeClaimCondition(in *core.PersistentVolumeClaimCondition, out *v1.PersistentVolumeClaimCondition, s conversion.Scope) error { - out.Type = v1.PersistentVolumeClaimConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_PersistentVolumeClaimCondition_To_v1_PersistentVolumeClaimCondition is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaimCondition_To_v1_PersistentVolumeClaimCondition(in *core.PersistentVolumeClaimCondition, out *v1.PersistentVolumeClaimCondition, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaimCondition_To_v1_PersistentVolumeClaimCondition(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimList_To_core_PersistentVolumeClaimList(in *v1.PersistentVolumeClaimList, out *core.PersistentVolumeClaimList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.PersistentVolumeClaim)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_PersistentVolumeClaimList_To_core_PersistentVolumeClaimList is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaimList_To_core_PersistentVolumeClaimList(in *v1.PersistentVolumeClaimList, out *core.PersistentVolumeClaimList, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimList_To_core_PersistentVolumeClaimList(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in *core.PersistentVolumeClaimList, out *v1.PersistentVolumeClaimList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.PersistentVolumeClaim)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in *core.PersistentVolumeClaimList, out *v1.PersistentVolumeClaimList, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaimList_To_v1_PersistentVolumeClaimList(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(in *v1.PersistentVolumeClaimSpec, out *core.PersistentVolumeClaimSpec, s conversion.Scope) error { - out.AccessModes = *(*[]core.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) - out.Selector = (*metav1.LabelSelector)(unsafe.Pointer(in.Selector)) - if err := Convert_v1_VolumeResourceRequirements_To_core_VolumeResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.VolumeName = in.VolumeName - out.StorageClassName = (*string)(unsafe.Pointer(in.StorageClassName)) - out.VolumeMode = (*core.PersistentVolumeMode)(unsafe.Pointer(in.VolumeMode)) - out.DataSource = (*core.TypedLocalObjectReference)(unsafe.Pointer(in.DataSource)) - out.DataSourceRef = (*core.TypedObjectReference)(unsafe.Pointer(in.DataSourceRef)) - out.VolumeAttributesClassName = (*string)(unsafe.Pointer(in.VolumeAttributesClassName)) - return nil -} - -// Convert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(in *v1.PersistentVolumeClaimSpec, out *core.PersistentVolumeClaimSpec, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in *core.PersistentVolumeClaimSpec, out *v1.PersistentVolumeClaimSpec, s conversion.Scope) error { - out.AccessModes = *(*[]v1.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) - out.Selector = (*metav1.LabelSelector)(unsafe.Pointer(in.Selector)) - if err := Convert_core_VolumeResourceRequirements_To_v1_VolumeResourceRequirements(&in.Resources, &out.Resources, s); err != nil { - return err - } - out.VolumeName = in.VolumeName - out.StorageClassName = (*string)(unsafe.Pointer(in.StorageClassName)) - out.VolumeMode = (*v1.PersistentVolumeMode)(unsafe.Pointer(in.VolumeMode)) - out.DataSource = (*v1.TypedLocalObjectReference)(unsafe.Pointer(in.DataSource)) - out.DataSourceRef = (*v1.TypedObjectReference)(unsafe.Pointer(in.DataSourceRef)) - out.VolumeAttributesClassName = (*string)(unsafe.Pointer(in.VolumeAttributesClassName)) - return nil -} - -// Convert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in *core.PersistentVolumeClaimSpec, out *v1.PersistentVolumeClaimSpec, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus(in *v1.PersistentVolumeClaimStatus, out *core.PersistentVolumeClaimStatus, s conversion.Scope) error { - out.Phase = core.PersistentVolumeClaimPhase(in.Phase) - out.AccessModes = *(*[]core.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) - out.Capacity = *(*core.ResourceList)(unsafe.Pointer(&in.Capacity)) - out.Conditions = *(*[]core.PersistentVolumeClaimCondition)(unsafe.Pointer(&in.Conditions)) - out.AllocatedResources = *(*core.ResourceList)(unsafe.Pointer(&in.AllocatedResources)) - out.AllocatedResourceStatuses = *(*map[core.ResourceName]core.ClaimResourceStatus)(unsafe.Pointer(&in.AllocatedResourceStatuses)) - out.CurrentVolumeAttributesClassName = (*string)(unsafe.Pointer(in.CurrentVolumeAttributesClassName)) - out.ModifyVolumeStatus = (*core.ModifyVolumeStatus)(unsafe.Pointer(in.ModifyVolumeStatus)) - return nil -} - -// Convert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus(in *v1.PersistentVolumeClaimStatus, out *core.PersistentVolumeClaimStatus, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimStatus_To_core_PersistentVolumeClaimStatus(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in *core.PersistentVolumeClaimStatus, out *v1.PersistentVolumeClaimStatus, s conversion.Scope) error { - out.Phase = v1.PersistentVolumeClaimPhase(in.Phase) - out.AccessModes = *(*[]v1.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - out.Conditions = *(*[]v1.PersistentVolumeClaimCondition)(unsafe.Pointer(&in.Conditions)) - out.AllocatedResources = *(*v1.ResourceList)(unsafe.Pointer(&in.AllocatedResources)) - out.AllocatedResourceStatuses = *(*map[v1.ResourceName]v1.ClaimResourceStatus)(unsafe.Pointer(&in.AllocatedResourceStatuses)) - out.CurrentVolumeAttributesClassName = (*string)(unsafe.Pointer(in.CurrentVolumeAttributesClassName)) - out.ModifyVolumeStatus = (*v1.ModifyVolumeStatus)(unsafe.Pointer(in.ModifyVolumeStatus)) - return nil -} - -// Convert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in *core.PersistentVolumeClaimStatus, out *v1.PersistentVolumeClaimStatus, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaimStatus_To_v1_PersistentVolumeClaimStatus(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimTemplate_To_core_PersistentVolumeClaimTemplate(in *v1.PersistentVolumeClaimTemplate, out *core.PersistentVolumeClaimTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_PersistentVolumeClaimSpec_To_core_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PersistentVolumeClaimTemplate_To_core_PersistentVolumeClaimTemplate is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaimTemplate_To_core_PersistentVolumeClaimTemplate(in *v1.PersistentVolumeClaimTemplate, out *core.PersistentVolumeClaimTemplate, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimTemplate_To_core_PersistentVolumeClaimTemplate(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaimTemplate_To_v1_PersistentVolumeClaimTemplate(in *core.PersistentVolumeClaimTemplate, out *v1.PersistentVolumeClaimTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_PersistentVolumeClaimSpec_To_v1_PersistentVolumeClaimSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_core_PersistentVolumeClaimTemplate_To_v1_PersistentVolumeClaimTemplate is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaimTemplate_To_v1_PersistentVolumeClaimTemplate(in *core.PersistentVolumeClaimTemplate, out *v1.PersistentVolumeClaimTemplate, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaimTemplate_To_v1_PersistentVolumeClaimTemplate(in, out, s) -} - -func autoConvert_v1_PersistentVolumeClaimVolumeSource_To_core_PersistentVolumeClaimVolumeSource(in *v1.PersistentVolumeClaimVolumeSource, out *core.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - out.ClaimName = in.ClaimName - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_PersistentVolumeClaimVolumeSource_To_core_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. -func Convert_v1_PersistentVolumeClaimVolumeSource_To_core_PersistentVolumeClaimVolumeSource(in *v1.PersistentVolumeClaimVolumeSource, out *core.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeClaimVolumeSource_To_core_PersistentVolumeClaimVolumeSource(in, out, s) -} - -func autoConvert_core_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(in *core.PersistentVolumeClaimVolumeSource, out *v1.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - out.ClaimName = in.ClaimName - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource is an autogenerated conversion function. -func Convert_core_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(in *core.PersistentVolumeClaimVolumeSource, out *v1.PersistentVolumeClaimVolumeSource, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeClaimVolumeSource_To_v1_PersistentVolumeClaimVolumeSource(in, out, s) -} - -func autoConvert_v1_PersistentVolumeList_To_core_PersistentVolumeList(in *v1.PersistentVolumeList, out *core.PersistentVolumeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.PersistentVolume, len(*in)) - for i := range *in { - if err := Convert_v1_PersistentVolume_To_core_PersistentVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_PersistentVolumeList_To_core_PersistentVolumeList is an autogenerated conversion function. -func Convert_v1_PersistentVolumeList_To_core_PersistentVolumeList(in *v1.PersistentVolumeList, out *core.PersistentVolumeList, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeList_To_core_PersistentVolumeList(in, out, s) -} - -func autoConvert_core_PersistentVolumeList_To_v1_PersistentVolumeList(in *core.PersistentVolumeList, out *v1.PersistentVolumeList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.PersistentVolume, len(*in)) - for i := range *in { - if err := Convert_core_PersistentVolume_To_v1_PersistentVolume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_PersistentVolumeList_To_v1_PersistentVolumeList is an autogenerated conversion function. -func Convert_core_PersistentVolumeList_To_v1_PersistentVolumeList(in *core.PersistentVolumeList, out *v1.PersistentVolumeList, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeList_To_v1_PersistentVolumeList(in, out, s) -} - -func autoConvert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource(in *v1.PersistentVolumeSource, out *core.PersistentVolumeSource, s conversion.Scope) error { - out.GCEPersistentDisk = (*core.GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) - out.AWSElasticBlockStore = (*core.AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) - out.HostPath = (*core.HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) - out.Glusterfs = (*core.GlusterfsPersistentVolumeSource)(unsafe.Pointer(in.Glusterfs)) - out.NFS = (*core.NFSVolumeSource)(unsafe.Pointer(in.NFS)) - out.RBD = (*core.RBDPersistentVolumeSource)(unsafe.Pointer(in.RBD)) - out.ISCSI = (*core.ISCSIPersistentVolumeSource)(unsafe.Pointer(in.ISCSI)) - out.Cinder = (*core.CinderPersistentVolumeSource)(unsafe.Pointer(in.Cinder)) - out.CephFS = (*core.CephFSPersistentVolumeSource)(unsafe.Pointer(in.CephFS)) - out.FC = (*core.FCVolumeSource)(unsafe.Pointer(in.FC)) - out.Flocker = (*core.FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) - out.FlexVolume = (*core.FlexPersistentVolumeSource)(unsafe.Pointer(in.FlexVolume)) - out.AzureFile = (*core.AzureFilePersistentVolumeSource)(unsafe.Pointer(in.AzureFile)) - out.VsphereVolume = (*core.VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) - out.Quobyte = (*core.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) - out.AzureDisk = (*core.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) - out.PhotonPersistentDisk = (*core.PhotonPersistentDiskVolumeSource)(unsafe.Pointer(in.PhotonPersistentDisk)) - out.PortworxVolume = (*core.PortworxVolumeSource)(unsafe.Pointer(in.PortworxVolume)) - out.ScaleIO = (*core.ScaleIOPersistentVolumeSource)(unsafe.Pointer(in.ScaleIO)) - out.Local = (*core.LocalVolumeSource)(unsafe.Pointer(in.Local)) - out.StorageOS = (*core.StorageOSPersistentVolumeSource)(unsafe.Pointer(in.StorageOS)) - out.CSI = (*core.CSIPersistentVolumeSource)(unsafe.Pointer(in.CSI)) - return nil -} - -// Convert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource(in *v1.PersistentVolumeSource, out *core.PersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource(in, out, s) -} - -func autoConvert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *core.PersistentVolumeSource, out *v1.PersistentVolumeSource, s conversion.Scope) error { - out.GCEPersistentDisk = (*v1.GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) - out.AWSElasticBlockStore = (*v1.AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) - out.HostPath = (*v1.HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) - out.Glusterfs = (*v1.GlusterfsPersistentVolumeSource)(unsafe.Pointer(in.Glusterfs)) - out.NFS = (*v1.NFSVolumeSource)(unsafe.Pointer(in.NFS)) - out.RBD = (*v1.RBDPersistentVolumeSource)(unsafe.Pointer(in.RBD)) - out.Quobyte = (*v1.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) - out.ISCSI = (*v1.ISCSIPersistentVolumeSource)(unsafe.Pointer(in.ISCSI)) - out.FlexVolume = (*v1.FlexPersistentVolumeSource)(unsafe.Pointer(in.FlexVolume)) - out.Cinder = (*v1.CinderPersistentVolumeSource)(unsafe.Pointer(in.Cinder)) - out.CephFS = (*v1.CephFSPersistentVolumeSource)(unsafe.Pointer(in.CephFS)) - out.FC = (*v1.FCVolumeSource)(unsafe.Pointer(in.FC)) - out.Flocker = (*v1.FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) - out.AzureFile = (*v1.AzureFilePersistentVolumeSource)(unsafe.Pointer(in.AzureFile)) - out.VsphereVolume = (*v1.VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) - out.AzureDisk = (*v1.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) - out.PhotonPersistentDisk = (*v1.PhotonPersistentDiskVolumeSource)(unsafe.Pointer(in.PhotonPersistentDisk)) - out.PortworxVolume = (*v1.PortworxVolumeSource)(unsafe.Pointer(in.PortworxVolume)) - out.ScaleIO = (*v1.ScaleIOPersistentVolumeSource)(unsafe.Pointer(in.ScaleIO)) - out.Local = (*v1.LocalVolumeSource)(unsafe.Pointer(in.Local)) - out.StorageOS = (*v1.StorageOSPersistentVolumeSource)(unsafe.Pointer(in.StorageOS)) - out.CSI = (*v1.CSIPersistentVolumeSource)(unsafe.Pointer(in.CSI)) - return nil -} - -// Convert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource is an autogenerated conversion function. -func Convert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource(in *core.PersistentVolumeSource, out *v1.PersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_PersistentVolumeSpec_To_core_PersistentVolumeSpec(in *v1.PersistentVolumeSpec, out *core.PersistentVolumeSpec, s conversion.Scope) error { - out.Capacity = *(*core.ResourceList)(unsafe.Pointer(&in.Capacity)) - if err := Convert_v1_PersistentVolumeSource_To_core_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil { - return err - } - out.AccessModes = *(*[]core.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) - out.ClaimRef = (*core.ObjectReference)(unsafe.Pointer(in.ClaimRef)) - out.PersistentVolumeReclaimPolicy = core.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) - out.StorageClassName = in.StorageClassName - out.MountOptions = *(*[]string)(unsafe.Pointer(&in.MountOptions)) - out.VolumeMode = (*core.PersistentVolumeMode)(unsafe.Pointer(in.VolumeMode)) - out.NodeAffinity = (*core.VolumeNodeAffinity)(unsafe.Pointer(in.NodeAffinity)) - out.VolumeAttributesClassName = (*string)(unsafe.Pointer(in.VolumeAttributesClassName)) - return nil -} - -func autoConvert_core_PersistentVolumeSpec_To_v1_PersistentVolumeSpec(in *core.PersistentVolumeSpec, out *v1.PersistentVolumeSpec, s conversion.Scope) error { - out.Capacity = *(*v1.ResourceList)(unsafe.Pointer(&in.Capacity)) - if err := Convert_core_PersistentVolumeSource_To_v1_PersistentVolumeSource(&in.PersistentVolumeSource, &out.PersistentVolumeSource, s); err != nil { - return err - } - out.AccessModes = *(*[]v1.PersistentVolumeAccessMode)(unsafe.Pointer(&in.AccessModes)) - out.ClaimRef = (*v1.ObjectReference)(unsafe.Pointer(in.ClaimRef)) - out.PersistentVolumeReclaimPolicy = v1.PersistentVolumeReclaimPolicy(in.PersistentVolumeReclaimPolicy) - out.StorageClassName = in.StorageClassName - out.MountOptions = *(*[]string)(unsafe.Pointer(&in.MountOptions)) - out.VolumeMode = (*v1.PersistentVolumeMode)(unsafe.Pointer(in.VolumeMode)) - out.NodeAffinity = (*v1.VolumeNodeAffinity)(unsafe.Pointer(in.NodeAffinity)) - out.VolumeAttributesClassName = (*string)(unsafe.Pointer(in.VolumeAttributesClassName)) - return nil -} - -func autoConvert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus(in *v1.PersistentVolumeStatus, out *core.PersistentVolumeStatus, s conversion.Scope) error { - out.Phase = core.PersistentVolumePhase(in.Phase) - out.Message = in.Message - out.Reason = in.Reason - out.LastPhaseTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastPhaseTransitionTime)) - return nil -} - -// Convert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus is an autogenerated conversion function. -func Convert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus(in *v1.PersistentVolumeStatus, out *core.PersistentVolumeStatus, s conversion.Scope) error { - return autoConvert_v1_PersistentVolumeStatus_To_core_PersistentVolumeStatus(in, out, s) -} - -func autoConvert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(in *core.PersistentVolumeStatus, out *v1.PersistentVolumeStatus, s conversion.Scope) error { - out.Phase = v1.PersistentVolumePhase(in.Phase) - out.Message = in.Message - out.Reason = in.Reason - out.LastPhaseTransitionTime = (*metav1.Time)(unsafe.Pointer(in.LastPhaseTransitionTime)) - return nil -} - -// Convert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus is an autogenerated conversion function. -func Convert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(in *core.PersistentVolumeStatus, out *v1.PersistentVolumeStatus, s conversion.Scope) error { - return autoConvert_core_PersistentVolumeStatus_To_v1_PersistentVolumeStatus(in, out, s) -} - -func autoConvert_v1_PhotonPersistentDiskVolumeSource_To_core_PhotonPersistentDiskVolumeSource(in *v1.PhotonPersistentDiskVolumeSource, out *core.PhotonPersistentDiskVolumeSource, s conversion.Scope) error { - out.PdID = in.PdID - out.FSType = in.FSType - return nil -} - -// Convert_v1_PhotonPersistentDiskVolumeSource_To_core_PhotonPersistentDiskVolumeSource is an autogenerated conversion function. -func Convert_v1_PhotonPersistentDiskVolumeSource_To_core_PhotonPersistentDiskVolumeSource(in *v1.PhotonPersistentDiskVolumeSource, out *core.PhotonPersistentDiskVolumeSource, s conversion.Scope) error { - return autoConvert_v1_PhotonPersistentDiskVolumeSource_To_core_PhotonPersistentDiskVolumeSource(in, out, s) -} - -func autoConvert_core_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolumeSource(in *core.PhotonPersistentDiskVolumeSource, out *v1.PhotonPersistentDiskVolumeSource, s conversion.Scope) error { - out.PdID = in.PdID - out.FSType = in.FSType - return nil -} - -// Convert_core_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolumeSource is an autogenerated conversion function. -func Convert_core_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolumeSource(in *core.PhotonPersistentDiskVolumeSource, out *v1.PhotonPersistentDiskVolumeSource, s conversion.Scope) error { - return autoConvert_core_PhotonPersistentDiskVolumeSource_To_v1_PhotonPersistentDiskVolumeSource(in, out, s) -} - -func autoConvert_v1_Pod_To_core_Pod(in *v1.Pod, out *core.Pod, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_PodSpec_To_core_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := corev1.Convert_v1_PodStatus_To_core_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func autoConvert_core_Pod_To_v1_Pod(in *core.Pod, out *v1.Pod, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := corev1.Convert_core_PodStatus_To_v1_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_PodAffinity_To_core_PodAffinity(in *v1.PodAffinity, out *core.PodAffinity, s conversion.Scope) error { - out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]core.PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) - out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]core.WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) - return nil -} - -// Convert_v1_PodAffinity_To_core_PodAffinity is an autogenerated conversion function. -func Convert_v1_PodAffinity_To_core_PodAffinity(in *v1.PodAffinity, out *core.PodAffinity, s conversion.Scope) error { - return autoConvert_v1_PodAffinity_To_core_PodAffinity(in, out, s) -} - -func autoConvert_core_PodAffinity_To_v1_PodAffinity(in *core.PodAffinity, out *v1.PodAffinity, s conversion.Scope) error { - out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]v1.PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) - out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]v1.WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) - return nil -} - -// Convert_core_PodAffinity_To_v1_PodAffinity is an autogenerated conversion function. -func Convert_core_PodAffinity_To_v1_PodAffinity(in *core.PodAffinity, out *v1.PodAffinity, s conversion.Scope) error { - return autoConvert_core_PodAffinity_To_v1_PodAffinity(in, out, s) -} - -func autoConvert_v1_PodAffinityTerm_To_core_PodAffinityTerm(in *v1.PodAffinityTerm, out *core.PodAffinityTerm, s conversion.Scope) error { - out.LabelSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.LabelSelector)) - out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces)) - out.TopologyKey = in.TopologyKey - out.NamespaceSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) - out.MatchLabelKeys = *(*[]string)(unsafe.Pointer(&in.MatchLabelKeys)) - out.MismatchLabelKeys = *(*[]string)(unsafe.Pointer(&in.MismatchLabelKeys)) - return nil -} - -// Convert_v1_PodAffinityTerm_To_core_PodAffinityTerm is an autogenerated conversion function. -func Convert_v1_PodAffinityTerm_To_core_PodAffinityTerm(in *v1.PodAffinityTerm, out *core.PodAffinityTerm, s conversion.Scope) error { - return autoConvert_v1_PodAffinityTerm_To_core_PodAffinityTerm(in, out, s) -} - -func autoConvert_core_PodAffinityTerm_To_v1_PodAffinityTerm(in *core.PodAffinityTerm, out *v1.PodAffinityTerm, s conversion.Scope) error { - out.LabelSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.LabelSelector)) - out.Namespaces = *(*[]string)(unsafe.Pointer(&in.Namespaces)) - out.TopologyKey = in.TopologyKey - out.NamespaceSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) - out.MatchLabelKeys = *(*[]string)(unsafe.Pointer(&in.MatchLabelKeys)) - out.MismatchLabelKeys = *(*[]string)(unsafe.Pointer(&in.MismatchLabelKeys)) - return nil -} - -// Convert_core_PodAffinityTerm_To_v1_PodAffinityTerm is an autogenerated conversion function. -func Convert_core_PodAffinityTerm_To_v1_PodAffinityTerm(in *core.PodAffinityTerm, out *v1.PodAffinityTerm, s conversion.Scope) error { - return autoConvert_core_PodAffinityTerm_To_v1_PodAffinityTerm(in, out, s) -} - -func autoConvert_v1_PodAntiAffinity_To_core_PodAntiAffinity(in *v1.PodAntiAffinity, out *core.PodAntiAffinity, s conversion.Scope) error { - out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]core.PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) - out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]core.WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) - return nil -} - -// Convert_v1_PodAntiAffinity_To_core_PodAntiAffinity is an autogenerated conversion function. -func Convert_v1_PodAntiAffinity_To_core_PodAntiAffinity(in *v1.PodAntiAffinity, out *core.PodAntiAffinity, s conversion.Scope) error { - return autoConvert_v1_PodAntiAffinity_To_core_PodAntiAffinity(in, out, s) -} - -func autoConvert_core_PodAntiAffinity_To_v1_PodAntiAffinity(in *core.PodAntiAffinity, out *v1.PodAntiAffinity, s conversion.Scope) error { - out.RequiredDuringSchedulingIgnoredDuringExecution = *(*[]v1.PodAffinityTerm)(unsafe.Pointer(&in.RequiredDuringSchedulingIgnoredDuringExecution)) - out.PreferredDuringSchedulingIgnoredDuringExecution = *(*[]v1.WeightedPodAffinityTerm)(unsafe.Pointer(&in.PreferredDuringSchedulingIgnoredDuringExecution)) - return nil -} - -// Convert_core_PodAntiAffinity_To_v1_PodAntiAffinity is an autogenerated conversion function. -func Convert_core_PodAntiAffinity_To_v1_PodAntiAffinity(in *core.PodAntiAffinity, out *v1.PodAntiAffinity, s conversion.Scope) error { - return autoConvert_core_PodAntiAffinity_To_v1_PodAntiAffinity(in, out, s) -} - -func autoConvert_v1_PodAttachOptions_To_core_PodAttachOptions(in *v1.PodAttachOptions, out *core.PodAttachOptions, s conversion.Scope) error { - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - return nil -} - -// Convert_v1_PodAttachOptions_To_core_PodAttachOptions is an autogenerated conversion function. -func Convert_v1_PodAttachOptions_To_core_PodAttachOptions(in *v1.PodAttachOptions, out *core.PodAttachOptions, s conversion.Scope) error { - return autoConvert_v1_PodAttachOptions_To_core_PodAttachOptions(in, out, s) -} - -func autoConvert_core_PodAttachOptions_To_v1_PodAttachOptions(in *core.PodAttachOptions, out *v1.PodAttachOptions, s conversion.Scope) error { - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - return nil -} - -// Convert_core_PodAttachOptions_To_v1_PodAttachOptions is an autogenerated conversion function. -func Convert_core_PodAttachOptions_To_v1_PodAttachOptions(in *core.PodAttachOptions, out *v1.PodAttachOptions, s conversion.Scope) error { - return autoConvert_core_PodAttachOptions_To_v1_PodAttachOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_PodAttachOptions(in *url.Values, out *v1.PodAttachOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["stdin"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Stdin, s); err != nil { - return err - } - } else { - out.Stdin = false - } - if values, ok := map[string][]string(*in)["stdout"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Stdout, s); err != nil { - return err - } - } else { - out.Stdout = false - } - if values, ok := map[string][]string(*in)["stderr"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Stderr, s); err != nil { - return err - } - } else { - out.Stderr = false - } - if values, ok := map[string][]string(*in)["tty"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.TTY, s); err != nil { - return err - } - } else { - out.TTY = false - } - if values, ok := map[string][]string(*in)["container"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_string(&values, &out.Container, s); err != nil { - return err - } - } else { - out.Container = "" - } - return nil -} - -// Convert_url_Values_To_v1_PodAttachOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_PodAttachOptions(in *url.Values, out *v1.PodAttachOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_PodAttachOptions(in, out, s) -} - -func autoConvert_v1_PodCondition_To_core_PodCondition(in *v1.PodCondition, out *core.PodCondition, s conversion.Scope) error { - out.Type = core.PodConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_PodCondition_To_core_PodCondition is an autogenerated conversion function. -func Convert_v1_PodCondition_To_core_PodCondition(in *v1.PodCondition, out *core.PodCondition, s conversion.Scope) error { - return autoConvert_v1_PodCondition_To_core_PodCondition(in, out, s) -} - -func autoConvert_core_PodCondition_To_v1_PodCondition(in *core.PodCondition, out *v1.PodCondition, s conversion.Scope) error { - out.Type = v1.PodConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastProbeTime = in.LastProbeTime - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_PodCondition_To_v1_PodCondition is an autogenerated conversion function. -func Convert_core_PodCondition_To_v1_PodCondition(in *core.PodCondition, out *v1.PodCondition, s conversion.Scope) error { - return autoConvert_core_PodCondition_To_v1_PodCondition(in, out, s) -} - -func autoConvert_v1_PodDNSConfig_To_core_PodDNSConfig(in *v1.PodDNSConfig, out *core.PodDNSConfig, s conversion.Scope) error { - out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) - out.Searches = *(*[]string)(unsafe.Pointer(&in.Searches)) - out.Options = *(*[]core.PodDNSConfigOption)(unsafe.Pointer(&in.Options)) - return nil -} - -// Convert_v1_PodDNSConfig_To_core_PodDNSConfig is an autogenerated conversion function. -func Convert_v1_PodDNSConfig_To_core_PodDNSConfig(in *v1.PodDNSConfig, out *core.PodDNSConfig, s conversion.Scope) error { - return autoConvert_v1_PodDNSConfig_To_core_PodDNSConfig(in, out, s) -} - -func autoConvert_core_PodDNSConfig_To_v1_PodDNSConfig(in *core.PodDNSConfig, out *v1.PodDNSConfig, s conversion.Scope) error { - out.Nameservers = *(*[]string)(unsafe.Pointer(&in.Nameservers)) - out.Searches = *(*[]string)(unsafe.Pointer(&in.Searches)) - out.Options = *(*[]v1.PodDNSConfigOption)(unsafe.Pointer(&in.Options)) - return nil -} - -// Convert_core_PodDNSConfig_To_v1_PodDNSConfig is an autogenerated conversion function. -func Convert_core_PodDNSConfig_To_v1_PodDNSConfig(in *core.PodDNSConfig, out *v1.PodDNSConfig, s conversion.Scope) error { - return autoConvert_core_PodDNSConfig_To_v1_PodDNSConfig(in, out, s) -} - -func autoConvert_v1_PodDNSConfigOption_To_core_PodDNSConfigOption(in *v1.PodDNSConfigOption, out *core.PodDNSConfigOption, s conversion.Scope) error { - out.Name = in.Name - out.Value = (*string)(unsafe.Pointer(in.Value)) - return nil -} - -// Convert_v1_PodDNSConfigOption_To_core_PodDNSConfigOption is an autogenerated conversion function. -func Convert_v1_PodDNSConfigOption_To_core_PodDNSConfigOption(in *v1.PodDNSConfigOption, out *core.PodDNSConfigOption, s conversion.Scope) error { - return autoConvert_v1_PodDNSConfigOption_To_core_PodDNSConfigOption(in, out, s) -} - -func autoConvert_core_PodDNSConfigOption_To_v1_PodDNSConfigOption(in *core.PodDNSConfigOption, out *v1.PodDNSConfigOption, s conversion.Scope) error { - out.Name = in.Name - out.Value = (*string)(unsafe.Pointer(in.Value)) - return nil -} - -// Convert_core_PodDNSConfigOption_To_v1_PodDNSConfigOption is an autogenerated conversion function. -func Convert_core_PodDNSConfigOption_To_v1_PodDNSConfigOption(in *core.PodDNSConfigOption, out *v1.PodDNSConfigOption, s conversion.Scope) error { - return autoConvert_core_PodDNSConfigOption_To_v1_PodDNSConfigOption(in, out, s) -} - -func autoConvert_v1_PodExecOptions_To_core_PodExecOptions(in *v1.PodExecOptions, out *core.PodExecOptions, s conversion.Scope) error { - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - return nil -} - -// Convert_v1_PodExecOptions_To_core_PodExecOptions is an autogenerated conversion function. -func Convert_v1_PodExecOptions_To_core_PodExecOptions(in *v1.PodExecOptions, out *core.PodExecOptions, s conversion.Scope) error { - return autoConvert_v1_PodExecOptions_To_core_PodExecOptions(in, out, s) -} - -func autoConvert_core_PodExecOptions_To_v1_PodExecOptions(in *core.PodExecOptions, out *v1.PodExecOptions, s conversion.Scope) error { - out.Stdin = in.Stdin - out.Stdout = in.Stdout - out.Stderr = in.Stderr - out.TTY = in.TTY - out.Container = in.Container - out.Command = *(*[]string)(unsafe.Pointer(&in.Command)) - return nil -} - -// Convert_core_PodExecOptions_To_v1_PodExecOptions is an autogenerated conversion function. -func Convert_core_PodExecOptions_To_v1_PodExecOptions(in *core.PodExecOptions, out *v1.PodExecOptions, s conversion.Scope) error { - return autoConvert_core_PodExecOptions_To_v1_PodExecOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_PodExecOptions(in *url.Values, out *v1.PodExecOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["stdin"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Stdin, s); err != nil { - return err - } - } else { - out.Stdin = false - } - if values, ok := map[string][]string(*in)["stdout"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Stdout, s); err != nil { - return err - } - } else { - out.Stdout = false - } - if values, ok := map[string][]string(*in)["stderr"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Stderr, s); err != nil { - return err - } - } else { - out.Stderr = false - } - if values, ok := map[string][]string(*in)["tty"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.TTY, s); err != nil { - return err - } - } else { - out.TTY = false - } - if values, ok := map[string][]string(*in)["container"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_string(&values, &out.Container, s); err != nil { - return err - } - } else { - out.Container = "" - } - if values, ok := map[string][]string(*in)["command"]; ok && len(values) > 0 { - out.Command = *(*[]string)(unsafe.Pointer(&values)) - } else { - out.Command = nil - } - return nil -} - -// Convert_url_Values_To_v1_PodExecOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_PodExecOptions(in *url.Values, out *v1.PodExecOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_PodExecOptions(in, out, s) -} - -func autoConvert_v1_PodIP_To_core_PodIP(in *v1.PodIP, out *core.PodIP, s conversion.Scope) error { - out.IP = in.IP - return nil -} - -// Convert_v1_PodIP_To_core_PodIP is an autogenerated conversion function. -func Convert_v1_PodIP_To_core_PodIP(in *v1.PodIP, out *core.PodIP, s conversion.Scope) error { - return autoConvert_v1_PodIP_To_core_PodIP(in, out, s) -} - -func autoConvert_core_PodIP_To_v1_PodIP(in *core.PodIP, out *v1.PodIP, s conversion.Scope) error { - out.IP = in.IP - return nil -} - -// Convert_core_PodIP_To_v1_PodIP is an autogenerated conversion function. -func Convert_core_PodIP_To_v1_PodIP(in *core.PodIP, out *v1.PodIP, s conversion.Scope) error { - return autoConvert_core_PodIP_To_v1_PodIP(in, out, s) -} - -func autoConvert_v1_PodList_To_core_PodList(in *v1.PodList, out *core.PodList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.Pod, len(*in)) - for i := range *in { - if err := corev1.Convert_v1_Pod_To_core_Pod(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_PodList_To_core_PodList is an autogenerated conversion function. -func Convert_v1_PodList_To_core_PodList(in *v1.PodList, out *core.PodList, s conversion.Scope) error { - return autoConvert_v1_PodList_To_core_PodList(in, out, s) -} - -func autoConvert_core_PodList_To_v1_PodList(in *core.PodList, out *v1.PodList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.Pod, len(*in)) - for i := range *in { - if err := corev1.Convert_core_Pod_To_v1_Pod(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_PodList_To_v1_PodList is an autogenerated conversion function. -func Convert_core_PodList_To_v1_PodList(in *core.PodList, out *v1.PodList, s conversion.Scope) error { - return autoConvert_core_PodList_To_v1_PodList(in, out, s) -} - -func autoConvert_v1_PodLogOptions_To_core_PodLogOptions(in *v1.PodLogOptions, out *core.PodLogOptions, s conversion.Scope) error { - out.Container = in.Container - out.Follow = in.Follow - out.Previous = in.Previous - out.SinceSeconds = (*int64)(unsafe.Pointer(in.SinceSeconds)) - out.SinceTime = (*metav1.Time)(unsafe.Pointer(in.SinceTime)) - out.Timestamps = in.Timestamps - out.TailLines = (*int64)(unsafe.Pointer(in.TailLines)) - out.LimitBytes = (*int64)(unsafe.Pointer(in.LimitBytes)) - out.InsecureSkipTLSVerifyBackend = in.InsecureSkipTLSVerifyBackend - return nil -} - -// Convert_v1_PodLogOptions_To_core_PodLogOptions is an autogenerated conversion function. -func Convert_v1_PodLogOptions_To_core_PodLogOptions(in *v1.PodLogOptions, out *core.PodLogOptions, s conversion.Scope) error { - return autoConvert_v1_PodLogOptions_To_core_PodLogOptions(in, out, s) -} - -func autoConvert_core_PodLogOptions_To_v1_PodLogOptions(in *core.PodLogOptions, out *v1.PodLogOptions, s conversion.Scope) error { - out.Container = in.Container - out.Follow = in.Follow - out.Previous = in.Previous - out.SinceSeconds = (*int64)(unsafe.Pointer(in.SinceSeconds)) - out.SinceTime = (*metav1.Time)(unsafe.Pointer(in.SinceTime)) - out.Timestamps = in.Timestamps - out.TailLines = (*int64)(unsafe.Pointer(in.TailLines)) - out.LimitBytes = (*int64)(unsafe.Pointer(in.LimitBytes)) - out.InsecureSkipTLSVerifyBackend = in.InsecureSkipTLSVerifyBackend - return nil -} - -// Convert_core_PodLogOptions_To_v1_PodLogOptions is an autogenerated conversion function. -func Convert_core_PodLogOptions_To_v1_PodLogOptions(in *core.PodLogOptions, out *v1.PodLogOptions, s conversion.Scope) error { - return autoConvert_core_PodLogOptions_To_v1_PodLogOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_PodLogOptions(in *url.Values, out *v1.PodLogOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["container"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_string(&values, &out.Container, s); err != nil { - return err - } - } else { - out.Container = "" - } - if values, ok := map[string][]string(*in)["follow"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Follow, s); err != nil { - return err - } - } else { - out.Follow = false - } - if values, ok := map[string][]string(*in)["previous"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Previous, s); err != nil { - return err - } - } else { - out.Previous = false - } - if values, ok := map[string][]string(*in)["sinceSeconds"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.SinceSeconds, s); err != nil { - return err - } - } else { - out.SinceSeconds = nil - } - if values, ok := map[string][]string(*in)["sinceTime"]; ok && len(values) > 0 { - if err := metav1.Convert_Slice_string_To_Pointer_v1_Time(&values, &out.SinceTime, s); err != nil { - return err - } - } else { - out.SinceTime = nil - } - if values, ok := map[string][]string(*in)["timestamps"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.Timestamps, s); err != nil { - return err - } - } else { - out.Timestamps = false - } - if values, ok := map[string][]string(*in)["tailLines"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.TailLines, s); err != nil { - return err - } - } else { - out.TailLines = nil - } - if values, ok := map[string][]string(*in)["limitBytes"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_Pointer_int64(&values, &out.LimitBytes, s); err != nil { - return err - } - } else { - out.LimitBytes = nil - } - if values, ok := map[string][]string(*in)["insecureSkipTLSVerifyBackend"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_bool(&values, &out.InsecureSkipTLSVerifyBackend, s); err != nil { - return err - } - } else { - out.InsecureSkipTLSVerifyBackend = false - } - return nil -} - -// Convert_url_Values_To_v1_PodLogOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_PodLogOptions(in *url.Values, out *v1.PodLogOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_PodLogOptions(in, out, s) -} - -func autoConvert_v1_PodOS_To_core_PodOS(in *v1.PodOS, out *core.PodOS, s conversion.Scope) error { - out.Name = core.OSName(in.Name) - return nil -} - -// Convert_v1_PodOS_To_core_PodOS is an autogenerated conversion function. -func Convert_v1_PodOS_To_core_PodOS(in *v1.PodOS, out *core.PodOS, s conversion.Scope) error { - return autoConvert_v1_PodOS_To_core_PodOS(in, out, s) -} - -func autoConvert_core_PodOS_To_v1_PodOS(in *core.PodOS, out *v1.PodOS, s conversion.Scope) error { - out.Name = v1.OSName(in.Name) - return nil -} - -// Convert_core_PodOS_To_v1_PodOS is an autogenerated conversion function. -func Convert_core_PodOS_To_v1_PodOS(in *core.PodOS, out *v1.PodOS, s conversion.Scope) error { - return autoConvert_core_PodOS_To_v1_PodOS(in, out, s) -} - -func autoConvert_v1_PodPortForwardOptions_To_core_PodPortForwardOptions(in *v1.PodPortForwardOptions, out *core.PodPortForwardOptions, s conversion.Scope) error { - out.Ports = *(*[]int32)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_v1_PodPortForwardOptions_To_core_PodPortForwardOptions is an autogenerated conversion function. -func Convert_v1_PodPortForwardOptions_To_core_PodPortForwardOptions(in *v1.PodPortForwardOptions, out *core.PodPortForwardOptions, s conversion.Scope) error { - return autoConvert_v1_PodPortForwardOptions_To_core_PodPortForwardOptions(in, out, s) -} - -func autoConvert_core_PodPortForwardOptions_To_v1_PodPortForwardOptions(in *core.PodPortForwardOptions, out *v1.PodPortForwardOptions, s conversion.Scope) error { - out.Ports = *(*[]int32)(unsafe.Pointer(&in.Ports)) - return nil -} - -// Convert_core_PodPortForwardOptions_To_v1_PodPortForwardOptions is an autogenerated conversion function. -func Convert_core_PodPortForwardOptions_To_v1_PodPortForwardOptions(in *core.PodPortForwardOptions, out *v1.PodPortForwardOptions, s conversion.Scope) error { - return autoConvert_core_PodPortForwardOptions_To_v1_PodPortForwardOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_PodPortForwardOptions(in *url.Values, out *v1.PodPortForwardOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["ports"]; ok && len(values) > 0 { - if err := metav1.Convert_Slice_string_To_Slice_int32(&values, &out.Ports, s); err != nil { - return err - } - } else { - out.Ports = nil - } - return nil -} - -// Convert_url_Values_To_v1_PodPortForwardOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_PodPortForwardOptions(in *url.Values, out *v1.PodPortForwardOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_PodPortForwardOptions(in, out, s) -} - -func autoConvert_v1_PodProxyOptions_To_core_PodProxyOptions(in *v1.PodProxyOptions, out *core.PodProxyOptions, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -// Convert_v1_PodProxyOptions_To_core_PodProxyOptions is an autogenerated conversion function. -func Convert_v1_PodProxyOptions_To_core_PodProxyOptions(in *v1.PodProxyOptions, out *core.PodProxyOptions, s conversion.Scope) error { - return autoConvert_v1_PodProxyOptions_To_core_PodProxyOptions(in, out, s) -} - -func autoConvert_core_PodProxyOptions_To_v1_PodProxyOptions(in *core.PodProxyOptions, out *v1.PodProxyOptions, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -// Convert_core_PodProxyOptions_To_v1_PodProxyOptions is an autogenerated conversion function. -func Convert_core_PodProxyOptions_To_v1_PodProxyOptions(in *core.PodProxyOptions, out *v1.PodProxyOptions, s conversion.Scope) error { - return autoConvert_core_PodProxyOptions_To_v1_PodProxyOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_PodProxyOptions(in *url.Values, out *v1.PodProxyOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["path"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_string(&values, &out.Path, s); err != nil { - return err - } - } else { - out.Path = "" - } - return nil -} - -// Convert_url_Values_To_v1_PodProxyOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_PodProxyOptions(in *url.Values, out *v1.PodProxyOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_PodProxyOptions(in, out, s) -} - -func autoConvert_v1_PodReadinessGate_To_core_PodReadinessGate(in *v1.PodReadinessGate, out *core.PodReadinessGate, s conversion.Scope) error { - out.ConditionType = core.PodConditionType(in.ConditionType) - return nil -} - -// Convert_v1_PodReadinessGate_To_core_PodReadinessGate is an autogenerated conversion function. -func Convert_v1_PodReadinessGate_To_core_PodReadinessGate(in *v1.PodReadinessGate, out *core.PodReadinessGate, s conversion.Scope) error { - return autoConvert_v1_PodReadinessGate_To_core_PodReadinessGate(in, out, s) -} - -func autoConvert_core_PodReadinessGate_To_v1_PodReadinessGate(in *core.PodReadinessGate, out *v1.PodReadinessGate, s conversion.Scope) error { - out.ConditionType = v1.PodConditionType(in.ConditionType) - return nil -} - -// Convert_core_PodReadinessGate_To_v1_PodReadinessGate is an autogenerated conversion function. -func Convert_core_PodReadinessGate_To_v1_PodReadinessGate(in *core.PodReadinessGate, out *v1.PodReadinessGate, s conversion.Scope) error { - return autoConvert_core_PodReadinessGate_To_v1_PodReadinessGate(in, out, s) -} - -func autoConvert_v1_PodResourceClaim_To_core_PodResourceClaim(in *v1.PodResourceClaim, out *core.PodResourceClaim, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1_ClaimSource_To_core_ClaimSource(&in.Source, &out.Source, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PodResourceClaim_To_core_PodResourceClaim is an autogenerated conversion function. -func Convert_v1_PodResourceClaim_To_core_PodResourceClaim(in *v1.PodResourceClaim, out *core.PodResourceClaim, s conversion.Scope) error { - return autoConvert_v1_PodResourceClaim_To_core_PodResourceClaim(in, out, s) -} - -func autoConvert_core_PodResourceClaim_To_v1_PodResourceClaim(in *core.PodResourceClaim, out *v1.PodResourceClaim, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_core_ClaimSource_To_v1_ClaimSource(&in.Source, &out.Source, s); err != nil { - return err - } - return nil -} - -// Convert_core_PodResourceClaim_To_v1_PodResourceClaim is an autogenerated conversion function. -func Convert_core_PodResourceClaim_To_v1_PodResourceClaim(in *core.PodResourceClaim, out *v1.PodResourceClaim, s conversion.Scope) error { - return autoConvert_core_PodResourceClaim_To_v1_PodResourceClaim(in, out, s) -} - -func autoConvert_v1_PodResourceClaimStatus_To_core_PodResourceClaimStatus(in *v1.PodResourceClaimStatus, out *core.PodResourceClaimStatus, s conversion.Scope) error { - out.Name = in.Name - out.ResourceClaimName = (*string)(unsafe.Pointer(in.ResourceClaimName)) - return nil -} - -// Convert_v1_PodResourceClaimStatus_To_core_PodResourceClaimStatus is an autogenerated conversion function. -func Convert_v1_PodResourceClaimStatus_To_core_PodResourceClaimStatus(in *v1.PodResourceClaimStatus, out *core.PodResourceClaimStatus, s conversion.Scope) error { - return autoConvert_v1_PodResourceClaimStatus_To_core_PodResourceClaimStatus(in, out, s) -} - -func autoConvert_core_PodResourceClaimStatus_To_v1_PodResourceClaimStatus(in *core.PodResourceClaimStatus, out *v1.PodResourceClaimStatus, s conversion.Scope) error { - out.Name = in.Name - out.ResourceClaimName = (*string)(unsafe.Pointer(in.ResourceClaimName)) - return nil -} - -// Convert_core_PodResourceClaimStatus_To_v1_PodResourceClaimStatus is an autogenerated conversion function. -func Convert_core_PodResourceClaimStatus_To_v1_PodResourceClaimStatus(in *core.PodResourceClaimStatus, out *v1.PodResourceClaimStatus, s conversion.Scope) error { - return autoConvert_core_PodResourceClaimStatus_To_v1_PodResourceClaimStatus(in, out, s) -} - -func autoConvert_v1_PodSchedulingGate_To_core_PodSchedulingGate(in *v1.PodSchedulingGate, out *core.PodSchedulingGate, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_v1_PodSchedulingGate_To_core_PodSchedulingGate is an autogenerated conversion function. -func Convert_v1_PodSchedulingGate_To_core_PodSchedulingGate(in *v1.PodSchedulingGate, out *core.PodSchedulingGate, s conversion.Scope) error { - return autoConvert_v1_PodSchedulingGate_To_core_PodSchedulingGate(in, out, s) -} - -func autoConvert_core_PodSchedulingGate_To_v1_PodSchedulingGate(in *core.PodSchedulingGate, out *v1.PodSchedulingGate, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_core_PodSchedulingGate_To_v1_PodSchedulingGate is an autogenerated conversion function. -func Convert_core_PodSchedulingGate_To_v1_PodSchedulingGate(in *core.PodSchedulingGate, out *v1.PodSchedulingGate, s conversion.Scope) error { - return autoConvert_core_PodSchedulingGate_To_v1_PodSchedulingGate(in, out, s) -} - -func autoConvert_v1_PodSecurityContext_To_core_PodSecurityContext(in *v1.PodSecurityContext, out *core.PodSecurityContext, s conversion.Scope) error { - out.SELinuxOptions = (*core.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) - out.WindowsOptions = (*core.WindowsSecurityContextOptions)(unsafe.Pointer(in.WindowsOptions)) - out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) - out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup)) - out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) - out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups)) - out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup)) - out.Sysctls = *(*[]core.Sysctl)(unsafe.Pointer(&in.Sysctls)) - out.FSGroupChangePolicy = (*core.PodFSGroupChangePolicy)(unsafe.Pointer(in.FSGroupChangePolicy)) - out.SeccompProfile = (*core.SeccompProfile)(unsafe.Pointer(in.SeccompProfile)) - return nil -} - -// Convert_v1_PodSecurityContext_To_core_PodSecurityContext is an autogenerated conversion function. -func Convert_v1_PodSecurityContext_To_core_PodSecurityContext(in *v1.PodSecurityContext, out *core.PodSecurityContext, s conversion.Scope) error { - return autoConvert_v1_PodSecurityContext_To_core_PodSecurityContext(in, out, s) -} - -func autoConvert_core_PodSecurityContext_To_v1_PodSecurityContext(in *core.PodSecurityContext, out *v1.PodSecurityContext, s conversion.Scope) error { - // INFO: in.HostNetwork opted out of conversion generation - // INFO: in.HostPID opted out of conversion generation - // INFO: in.HostIPC opted out of conversion generation - // INFO: in.ShareProcessNamespace opted out of conversion generation - // INFO: in.HostUsers opted out of conversion generation - out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) - out.WindowsOptions = (*v1.WindowsSecurityContextOptions)(unsafe.Pointer(in.WindowsOptions)) - out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) - out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup)) - out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) - out.SupplementalGroups = *(*[]int64)(unsafe.Pointer(&in.SupplementalGroups)) - out.FSGroup = (*int64)(unsafe.Pointer(in.FSGroup)) - out.FSGroupChangePolicy = (*v1.PodFSGroupChangePolicy)(unsafe.Pointer(in.FSGroupChangePolicy)) - out.Sysctls = *(*[]v1.Sysctl)(unsafe.Pointer(&in.Sysctls)) - out.SeccompProfile = (*v1.SeccompProfile)(unsafe.Pointer(in.SeccompProfile)) - return nil -} - -// Convert_core_PodSecurityContext_To_v1_PodSecurityContext is an autogenerated conversion function. -func Convert_core_PodSecurityContext_To_v1_PodSecurityContext(in *core.PodSecurityContext, out *v1.PodSecurityContext, s conversion.Scope) error { - return autoConvert_core_PodSecurityContext_To_v1_PodSecurityContext(in, out, s) -} - -func autoConvert_v1_PodSignature_To_core_PodSignature(in *v1.PodSignature, out *core.PodSignature, s conversion.Scope) error { - out.PodController = (*metav1.OwnerReference)(unsafe.Pointer(in.PodController)) - return nil -} - -// Convert_v1_PodSignature_To_core_PodSignature is an autogenerated conversion function. -func Convert_v1_PodSignature_To_core_PodSignature(in *v1.PodSignature, out *core.PodSignature, s conversion.Scope) error { - return autoConvert_v1_PodSignature_To_core_PodSignature(in, out, s) -} - -func autoConvert_core_PodSignature_To_v1_PodSignature(in *core.PodSignature, out *v1.PodSignature, s conversion.Scope) error { - out.PodController = (*metav1.OwnerReference)(unsafe.Pointer(in.PodController)) - return nil -} - -// Convert_core_PodSignature_To_v1_PodSignature is an autogenerated conversion function. -func Convert_core_PodSignature_To_v1_PodSignature(in *core.PodSignature, out *v1.PodSignature, s conversion.Scope) error { - return autoConvert_core_PodSignature_To_v1_PodSignature(in, out, s) -} - -func autoConvert_v1_PodSpec_To_core_PodSpec(in *v1.PodSpec, out *core.PodSpec, s conversion.Scope) error { - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]core.Volume, len(*in)) - for i := range *in { - if err := corev1.Convert_v1_Volume_To_core_Volume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - out.InitContainers = *(*[]core.Container)(unsafe.Pointer(&in.InitContainers)) - out.Containers = *(*[]core.Container)(unsafe.Pointer(&in.Containers)) - out.EphemeralContainers = *(*[]core.EphemeralContainer)(unsafe.Pointer(&in.EphemeralContainers)) - out.RestartPolicy = core.RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) - out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) - out.DNSPolicy = core.DNSPolicy(in.DNSPolicy) - out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) - out.ServiceAccountName = in.ServiceAccountName - // INFO: in.DeprecatedServiceAccount opted out of conversion generation - out.AutomountServiceAccountToken = (*bool)(unsafe.Pointer(in.AutomountServiceAccountToken)) - out.NodeName = in.NodeName - // INFO: in.HostNetwork opted out of conversion generation - // INFO: in.HostPID opted out of conversion generation - // INFO: in.HostIPC opted out of conversion generation - // INFO: in.ShareProcessNamespace opted out of conversion generation - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(core.PodSecurityContext) - if err := Convert_v1_PodSecurityContext_To_core_PodSecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - out.ImagePullSecrets = *(*[]core.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain - out.Affinity = (*core.Affinity)(unsafe.Pointer(in.Affinity)) - out.SchedulerName = in.SchedulerName - out.Tolerations = *(*[]core.Toleration)(unsafe.Pointer(&in.Tolerations)) - out.HostAliases = *(*[]core.HostAlias)(unsafe.Pointer(&in.HostAliases)) - out.PriorityClassName = in.PriorityClassName - out.Priority = (*int32)(unsafe.Pointer(in.Priority)) - out.DNSConfig = (*core.PodDNSConfig)(unsafe.Pointer(in.DNSConfig)) - out.ReadinessGates = *(*[]core.PodReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) - out.RuntimeClassName = (*string)(unsafe.Pointer(in.RuntimeClassName)) - out.EnableServiceLinks = (*bool)(unsafe.Pointer(in.EnableServiceLinks)) - out.PreemptionPolicy = (*core.PreemptionPolicy)(unsafe.Pointer(in.PreemptionPolicy)) - out.Overhead = *(*core.ResourceList)(unsafe.Pointer(&in.Overhead)) - out.TopologySpreadConstraints = *(*[]core.TopologySpreadConstraint)(unsafe.Pointer(&in.TopologySpreadConstraints)) - out.SetHostnameAsFQDN = (*bool)(unsafe.Pointer(in.SetHostnameAsFQDN)) - out.OS = (*core.PodOS)(unsafe.Pointer(in.OS)) - // INFO: in.HostUsers opted out of conversion generation - out.SchedulingGates = *(*[]core.PodSchedulingGate)(unsafe.Pointer(&in.SchedulingGates)) - out.ResourceClaims = *(*[]core.PodResourceClaim)(unsafe.Pointer(&in.ResourceClaims)) - return nil -} - -func autoConvert_core_PodSpec_To_v1_PodSpec(in *core.PodSpec, out *v1.PodSpec, s conversion.Scope) error { - if in.Volumes != nil { - in, out := &in.Volumes, &out.Volumes - *out = make([]v1.Volume, len(*in)) - for i := range *in { - if err := corev1.Convert_core_Volume_To_v1_Volume(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Volumes = nil - } - out.InitContainers = *(*[]v1.Container)(unsafe.Pointer(&in.InitContainers)) - out.Containers = *(*[]v1.Container)(unsafe.Pointer(&in.Containers)) - out.EphemeralContainers = *(*[]v1.EphemeralContainer)(unsafe.Pointer(&in.EphemeralContainers)) - out.RestartPolicy = v1.RestartPolicy(in.RestartPolicy) - out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) - out.ActiveDeadlineSeconds = (*int64)(unsafe.Pointer(in.ActiveDeadlineSeconds)) - out.DNSPolicy = v1.DNSPolicy(in.DNSPolicy) - out.NodeSelector = *(*map[string]string)(unsafe.Pointer(&in.NodeSelector)) - out.ServiceAccountName = in.ServiceAccountName - out.AutomountServiceAccountToken = (*bool)(unsafe.Pointer(in.AutomountServiceAccountToken)) - out.NodeName = in.NodeName - if in.SecurityContext != nil { - in, out := &in.SecurityContext, &out.SecurityContext - *out = new(v1.PodSecurityContext) - if err := Convert_core_PodSecurityContext_To_v1_PodSecurityContext(*in, *out, s); err != nil { - return err - } - } else { - out.SecurityContext = nil - } - out.ImagePullSecrets = *(*[]v1.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) - out.Hostname = in.Hostname - out.Subdomain = in.Subdomain - out.SetHostnameAsFQDN = (*bool)(unsafe.Pointer(in.SetHostnameAsFQDN)) - out.Affinity = (*v1.Affinity)(unsafe.Pointer(in.Affinity)) - out.SchedulerName = in.SchedulerName - out.Tolerations = *(*[]v1.Toleration)(unsafe.Pointer(&in.Tolerations)) - out.HostAliases = *(*[]v1.HostAlias)(unsafe.Pointer(&in.HostAliases)) - out.PriorityClassName = in.PriorityClassName - out.Priority = (*int32)(unsafe.Pointer(in.Priority)) - out.PreemptionPolicy = (*v1.PreemptionPolicy)(unsafe.Pointer(in.PreemptionPolicy)) - out.DNSConfig = (*v1.PodDNSConfig)(unsafe.Pointer(in.DNSConfig)) - out.ReadinessGates = *(*[]v1.PodReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) - out.RuntimeClassName = (*string)(unsafe.Pointer(in.RuntimeClassName)) - out.Overhead = *(*v1.ResourceList)(unsafe.Pointer(&in.Overhead)) - out.EnableServiceLinks = (*bool)(unsafe.Pointer(in.EnableServiceLinks)) - out.TopologySpreadConstraints = *(*[]v1.TopologySpreadConstraint)(unsafe.Pointer(&in.TopologySpreadConstraints)) - out.OS = (*v1.PodOS)(unsafe.Pointer(in.OS)) - out.SchedulingGates = *(*[]v1.PodSchedulingGate)(unsafe.Pointer(&in.SchedulingGates)) - out.ResourceClaims = *(*[]v1.PodResourceClaim)(unsafe.Pointer(&in.ResourceClaims)) - return nil -} - -func autoConvert_v1_PodStatus_To_core_PodStatus(in *v1.PodStatus, out *core.PodStatus, s conversion.Scope) error { - out.Phase = core.PodPhase(in.Phase) - out.Conditions = *(*[]core.PodCondition)(unsafe.Pointer(&in.Conditions)) - out.Message = in.Message - out.Reason = in.Reason - out.NominatedNodeName = in.NominatedNodeName - out.HostIP = in.HostIP - out.HostIPs = *(*[]core.HostIP)(unsafe.Pointer(&in.HostIPs)) - // WARNING: in.PodIP requires manual conversion: does not exist in peer-type - out.PodIPs = *(*[]core.PodIP)(unsafe.Pointer(&in.PodIPs)) - out.StartTime = (*metav1.Time)(unsafe.Pointer(in.StartTime)) - out.InitContainerStatuses = *(*[]core.ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses)) - out.ContainerStatuses = *(*[]core.ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses)) - out.QOSClass = core.PodQOSClass(in.QOSClass) - out.EphemeralContainerStatuses = *(*[]core.ContainerStatus)(unsafe.Pointer(&in.EphemeralContainerStatuses)) - out.Resize = core.PodResizeStatus(in.Resize) - out.ResourceClaimStatuses = *(*[]core.PodResourceClaimStatus)(unsafe.Pointer(&in.ResourceClaimStatuses)) - return nil -} - -func autoConvert_core_PodStatus_To_v1_PodStatus(in *core.PodStatus, out *v1.PodStatus, s conversion.Scope) error { - out.Phase = v1.PodPhase(in.Phase) - out.Conditions = *(*[]v1.PodCondition)(unsafe.Pointer(&in.Conditions)) - out.Message = in.Message - out.Reason = in.Reason - out.NominatedNodeName = in.NominatedNodeName - out.HostIP = in.HostIP - out.HostIPs = *(*[]v1.HostIP)(unsafe.Pointer(&in.HostIPs)) - out.PodIPs = *(*[]v1.PodIP)(unsafe.Pointer(&in.PodIPs)) - out.StartTime = (*metav1.Time)(unsafe.Pointer(in.StartTime)) - out.QOSClass = v1.PodQOSClass(in.QOSClass) - out.InitContainerStatuses = *(*[]v1.ContainerStatus)(unsafe.Pointer(&in.InitContainerStatuses)) - out.ContainerStatuses = *(*[]v1.ContainerStatus)(unsafe.Pointer(&in.ContainerStatuses)) - out.EphemeralContainerStatuses = *(*[]v1.ContainerStatus)(unsafe.Pointer(&in.EphemeralContainerStatuses)) - out.Resize = v1.PodResizeStatus(in.Resize) - out.ResourceClaimStatuses = *(*[]v1.PodResourceClaimStatus)(unsafe.Pointer(&in.ResourceClaimStatuses)) - return nil -} - -func autoConvert_v1_PodStatusResult_To_core_PodStatusResult(in *v1.PodStatusResult, out *core.PodStatusResult, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_PodStatus_To_core_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PodStatusResult_To_core_PodStatusResult is an autogenerated conversion function. -func Convert_v1_PodStatusResult_To_core_PodStatusResult(in *v1.PodStatusResult, out *core.PodStatusResult, s conversion.Scope) error { - return autoConvert_v1_PodStatusResult_To_core_PodStatusResult(in, out, s) -} - -func autoConvert_core_PodStatusResult_To_v1_PodStatusResult(in *core.PodStatusResult, out *v1.PodStatusResult, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_PodStatus_To_v1_PodStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_PodStatusResult_To_v1_PodStatusResult is an autogenerated conversion function. -func Convert_core_PodStatusResult_To_v1_PodStatusResult(in *core.PodStatusResult, out *v1.PodStatusResult, s conversion.Scope) error { - return autoConvert_core_PodStatusResult_To_v1_PodStatusResult(in, out, s) -} - -func autoConvert_v1_PodTemplate_To_core_PodTemplate(in *v1.PodTemplate, out *core.PodTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PodTemplate_To_core_PodTemplate is an autogenerated conversion function. -func Convert_v1_PodTemplate_To_core_PodTemplate(in *v1.PodTemplate, out *core.PodTemplate, s conversion.Scope) error { - return autoConvert_v1_PodTemplate_To_core_PodTemplate(in, out, s) -} - -func autoConvert_core_PodTemplate_To_v1_PodTemplate(in *core.PodTemplate, out *v1.PodTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_core_PodTemplate_To_v1_PodTemplate is an autogenerated conversion function. -func Convert_core_PodTemplate_To_v1_PodTemplate(in *core.PodTemplate, out *v1.PodTemplate, s conversion.Scope) error { - return autoConvert_core_PodTemplate_To_v1_PodTemplate(in, out, s) -} - -func autoConvert_v1_PodTemplateList_To_core_PodTemplateList(in *v1.PodTemplateList, out *core.PodTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.PodTemplate, len(*in)) - for i := range *in { - if err := Convert_v1_PodTemplate_To_core_PodTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_PodTemplateList_To_core_PodTemplateList is an autogenerated conversion function. -func Convert_v1_PodTemplateList_To_core_PodTemplateList(in *v1.PodTemplateList, out *core.PodTemplateList, s conversion.Scope) error { - return autoConvert_v1_PodTemplateList_To_core_PodTemplateList(in, out, s) -} - -func autoConvert_core_PodTemplateList_To_v1_PodTemplateList(in *core.PodTemplateList, out *v1.PodTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.PodTemplate, len(*in)) - for i := range *in { - if err := Convert_core_PodTemplate_To_v1_PodTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_PodTemplateList_To_v1_PodTemplateList is an autogenerated conversion function. -func Convert_core_PodTemplateList_To_v1_PodTemplateList(in *core.PodTemplateList, out *v1.PodTemplateList, s conversion.Scope) error { - return autoConvert_core_PodTemplateList_To_v1_PodTemplateList(in, out, s) -} - -func autoConvert_v1_PodTemplateSpec_To_core_PodTemplateSpec(in *v1.PodTemplateSpec, out *core.PodTemplateSpec, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_PodSpec_To_core_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_core_PodTemplateSpec_To_v1_PodTemplateSpec(in *core.PodTemplateSpec, out *v1.PodTemplateSpec, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_PodSpec_To_v1_PodSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_PortStatus_To_core_PortStatus(in *v1.PortStatus, out *core.PortStatus, s conversion.Scope) error { - out.Port = in.Port - out.Protocol = core.Protocol(in.Protocol) - out.Error = (*string)(unsafe.Pointer(in.Error)) - return nil -} - -// Convert_v1_PortStatus_To_core_PortStatus is an autogenerated conversion function. -func Convert_v1_PortStatus_To_core_PortStatus(in *v1.PortStatus, out *core.PortStatus, s conversion.Scope) error { - return autoConvert_v1_PortStatus_To_core_PortStatus(in, out, s) -} - -func autoConvert_core_PortStatus_To_v1_PortStatus(in *core.PortStatus, out *v1.PortStatus, s conversion.Scope) error { - out.Port = in.Port - out.Protocol = v1.Protocol(in.Protocol) - out.Error = (*string)(unsafe.Pointer(in.Error)) - return nil -} - -// Convert_core_PortStatus_To_v1_PortStatus is an autogenerated conversion function. -func Convert_core_PortStatus_To_v1_PortStatus(in *core.PortStatus, out *v1.PortStatus, s conversion.Scope) error { - return autoConvert_core_PortStatus_To_v1_PortStatus(in, out, s) -} - -func autoConvert_v1_PortworxVolumeSource_To_core_PortworxVolumeSource(in *v1.PortworxVolumeSource, out *core.PortworxVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_PortworxVolumeSource_To_core_PortworxVolumeSource is an autogenerated conversion function. -func Convert_v1_PortworxVolumeSource_To_core_PortworxVolumeSource(in *v1.PortworxVolumeSource, out *core.PortworxVolumeSource, s conversion.Scope) error { - return autoConvert_v1_PortworxVolumeSource_To_core_PortworxVolumeSource(in, out, s) -} - -func autoConvert_core_PortworxVolumeSource_To_v1_PortworxVolumeSource(in *core.PortworxVolumeSource, out *v1.PortworxVolumeSource, s conversion.Scope) error { - out.VolumeID = in.VolumeID - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_PortworxVolumeSource_To_v1_PortworxVolumeSource is an autogenerated conversion function. -func Convert_core_PortworxVolumeSource_To_v1_PortworxVolumeSource(in *core.PortworxVolumeSource, out *v1.PortworxVolumeSource, s conversion.Scope) error { - return autoConvert_core_PortworxVolumeSource_To_v1_PortworxVolumeSource(in, out, s) -} - -func autoConvert_v1_Preconditions_To_core_Preconditions(in *v1.Preconditions, out *core.Preconditions, s conversion.Scope) error { - out.UID = (*types.UID)(unsafe.Pointer(in.UID)) - return nil -} - -// Convert_v1_Preconditions_To_core_Preconditions is an autogenerated conversion function. -func Convert_v1_Preconditions_To_core_Preconditions(in *v1.Preconditions, out *core.Preconditions, s conversion.Scope) error { - return autoConvert_v1_Preconditions_To_core_Preconditions(in, out, s) -} - -func autoConvert_core_Preconditions_To_v1_Preconditions(in *core.Preconditions, out *v1.Preconditions, s conversion.Scope) error { - out.UID = (*types.UID)(unsafe.Pointer(in.UID)) - return nil -} - -// Convert_core_Preconditions_To_v1_Preconditions is an autogenerated conversion function. -func Convert_core_Preconditions_To_v1_Preconditions(in *core.Preconditions, out *v1.Preconditions, s conversion.Scope) error { - return autoConvert_core_Preconditions_To_v1_Preconditions(in, out, s) -} - -func autoConvert_v1_PreferAvoidPodsEntry_To_core_PreferAvoidPodsEntry(in *v1.PreferAvoidPodsEntry, out *core.PreferAvoidPodsEntry, s conversion.Scope) error { - if err := Convert_v1_PodSignature_To_core_PodSignature(&in.PodSignature, &out.PodSignature, s); err != nil { - return err - } - out.EvictionTime = in.EvictionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_PreferAvoidPodsEntry_To_core_PreferAvoidPodsEntry is an autogenerated conversion function. -func Convert_v1_PreferAvoidPodsEntry_To_core_PreferAvoidPodsEntry(in *v1.PreferAvoidPodsEntry, out *core.PreferAvoidPodsEntry, s conversion.Scope) error { - return autoConvert_v1_PreferAvoidPodsEntry_To_core_PreferAvoidPodsEntry(in, out, s) -} - -func autoConvert_core_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(in *core.PreferAvoidPodsEntry, out *v1.PreferAvoidPodsEntry, s conversion.Scope) error { - if err := Convert_core_PodSignature_To_v1_PodSignature(&in.PodSignature, &out.PodSignature, s); err != nil { - return err - } - out.EvictionTime = in.EvictionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry is an autogenerated conversion function. -func Convert_core_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(in *core.PreferAvoidPodsEntry, out *v1.PreferAvoidPodsEntry, s conversion.Scope) error { - return autoConvert_core_PreferAvoidPodsEntry_To_v1_PreferAvoidPodsEntry(in, out, s) -} - -func autoConvert_v1_PreferredSchedulingTerm_To_core_PreferredSchedulingTerm(in *v1.PreferredSchedulingTerm, out *core.PreferredSchedulingTerm, s conversion.Scope) error { - out.Weight = in.Weight - if err := Convert_v1_NodeSelectorTerm_To_core_NodeSelectorTerm(&in.Preference, &out.Preference, s); err != nil { - return err - } - return nil -} - -// Convert_v1_PreferredSchedulingTerm_To_core_PreferredSchedulingTerm is an autogenerated conversion function. -func Convert_v1_PreferredSchedulingTerm_To_core_PreferredSchedulingTerm(in *v1.PreferredSchedulingTerm, out *core.PreferredSchedulingTerm, s conversion.Scope) error { - return autoConvert_v1_PreferredSchedulingTerm_To_core_PreferredSchedulingTerm(in, out, s) -} - -func autoConvert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in *core.PreferredSchedulingTerm, out *v1.PreferredSchedulingTerm, s conversion.Scope) error { - out.Weight = in.Weight - if err := Convert_core_NodeSelectorTerm_To_v1_NodeSelectorTerm(&in.Preference, &out.Preference, s); err != nil { - return err - } - return nil -} - -// Convert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm is an autogenerated conversion function. -func Convert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in *core.PreferredSchedulingTerm, out *v1.PreferredSchedulingTerm, s conversion.Scope) error { - return autoConvert_core_PreferredSchedulingTerm_To_v1_PreferredSchedulingTerm(in, out, s) -} - -func autoConvert_v1_Probe_To_core_Probe(in *v1.Probe, out *core.Probe, s conversion.Scope) error { - if err := Convert_v1_ProbeHandler_To_core_ProbeHandler(&in.ProbeHandler, &out.ProbeHandler, s); err != nil { - return err - } - out.InitialDelaySeconds = in.InitialDelaySeconds - out.TimeoutSeconds = in.TimeoutSeconds - out.PeriodSeconds = in.PeriodSeconds - out.SuccessThreshold = in.SuccessThreshold - out.FailureThreshold = in.FailureThreshold - out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) - return nil -} - -// Convert_v1_Probe_To_core_Probe is an autogenerated conversion function. -func Convert_v1_Probe_To_core_Probe(in *v1.Probe, out *core.Probe, s conversion.Scope) error { - return autoConvert_v1_Probe_To_core_Probe(in, out, s) -} - -func autoConvert_core_Probe_To_v1_Probe(in *core.Probe, out *v1.Probe, s conversion.Scope) error { - if err := Convert_core_ProbeHandler_To_v1_ProbeHandler(&in.ProbeHandler, &out.ProbeHandler, s); err != nil { - return err - } - out.InitialDelaySeconds = in.InitialDelaySeconds - out.TimeoutSeconds = in.TimeoutSeconds - out.PeriodSeconds = in.PeriodSeconds - out.SuccessThreshold = in.SuccessThreshold - out.FailureThreshold = in.FailureThreshold - out.TerminationGracePeriodSeconds = (*int64)(unsafe.Pointer(in.TerminationGracePeriodSeconds)) - return nil -} - -// Convert_core_Probe_To_v1_Probe is an autogenerated conversion function. -func Convert_core_Probe_To_v1_Probe(in *core.Probe, out *v1.Probe, s conversion.Scope) error { - return autoConvert_core_Probe_To_v1_Probe(in, out, s) -} - -func autoConvert_v1_ProbeHandler_To_core_ProbeHandler(in *v1.ProbeHandler, out *core.ProbeHandler, s conversion.Scope) error { - out.Exec = (*core.ExecAction)(unsafe.Pointer(in.Exec)) - out.HTTPGet = (*core.HTTPGetAction)(unsafe.Pointer(in.HTTPGet)) - out.TCPSocket = (*core.TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) - out.GRPC = (*core.GRPCAction)(unsafe.Pointer(in.GRPC)) - return nil -} - -// Convert_v1_ProbeHandler_To_core_ProbeHandler is an autogenerated conversion function. -func Convert_v1_ProbeHandler_To_core_ProbeHandler(in *v1.ProbeHandler, out *core.ProbeHandler, s conversion.Scope) error { - return autoConvert_v1_ProbeHandler_To_core_ProbeHandler(in, out, s) -} - -func autoConvert_core_ProbeHandler_To_v1_ProbeHandler(in *core.ProbeHandler, out *v1.ProbeHandler, s conversion.Scope) error { - out.Exec = (*v1.ExecAction)(unsafe.Pointer(in.Exec)) - out.HTTPGet = (*v1.HTTPGetAction)(unsafe.Pointer(in.HTTPGet)) - out.TCPSocket = (*v1.TCPSocketAction)(unsafe.Pointer(in.TCPSocket)) - out.GRPC = (*v1.GRPCAction)(unsafe.Pointer(in.GRPC)) - return nil -} - -// Convert_core_ProbeHandler_To_v1_ProbeHandler is an autogenerated conversion function. -func Convert_core_ProbeHandler_To_v1_ProbeHandler(in *core.ProbeHandler, out *v1.ProbeHandler, s conversion.Scope) error { - return autoConvert_core_ProbeHandler_To_v1_ProbeHandler(in, out, s) -} - -func autoConvert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(in *v1.ProjectedVolumeSource, out *core.ProjectedVolumeSource, s conversion.Scope) error { - if in.Sources != nil { - in, out := &in.Sources, &out.Sources - *out = make([]core.VolumeProjection, len(*in)) - for i := range *in { - if err := Convert_v1_VolumeProjection_To_core_VolumeProjection(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Sources = nil - } - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - return nil -} - -// Convert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource is an autogenerated conversion function. -func Convert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(in *v1.ProjectedVolumeSource, out *core.ProjectedVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(in, out, s) -} - -func autoConvert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(in *core.ProjectedVolumeSource, out *v1.ProjectedVolumeSource, s conversion.Scope) error { - if in.Sources != nil { - in, out := &in.Sources, &out.Sources - *out = make([]v1.VolumeProjection, len(*in)) - for i := range *in { - if err := Convert_core_VolumeProjection_To_v1_VolumeProjection(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Sources = nil - } - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - return nil -} - -// Convert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource is an autogenerated conversion function. -func Convert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(in *core.ProjectedVolumeSource, out *v1.ProjectedVolumeSource, s conversion.Scope) error { - return autoConvert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(in, out, s) -} - -func autoConvert_v1_QuobyteVolumeSource_To_core_QuobyteVolumeSource(in *v1.QuobyteVolumeSource, out *core.QuobyteVolumeSource, s conversion.Scope) error { - out.Registry = in.Registry - out.Volume = in.Volume - out.ReadOnly = in.ReadOnly - out.User = in.User - out.Group = in.Group - out.Tenant = in.Tenant - return nil -} - -// Convert_v1_QuobyteVolumeSource_To_core_QuobyteVolumeSource is an autogenerated conversion function. -func Convert_v1_QuobyteVolumeSource_To_core_QuobyteVolumeSource(in *v1.QuobyteVolumeSource, out *core.QuobyteVolumeSource, s conversion.Scope) error { - return autoConvert_v1_QuobyteVolumeSource_To_core_QuobyteVolumeSource(in, out, s) -} - -func autoConvert_core_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in *core.QuobyteVolumeSource, out *v1.QuobyteVolumeSource, s conversion.Scope) error { - out.Registry = in.Registry - out.Volume = in.Volume - out.ReadOnly = in.ReadOnly - out.User = in.User - out.Group = in.Group - out.Tenant = in.Tenant - return nil -} - -// Convert_core_QuobyteVolumeSource_To_v1_QuobyteVolumeSource is an autogenerated conversion function. -func Convert_core_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in *core.QuobyteVolumeSource, out *v1.QuobyteVolumeSource, s conversion.Scope) error { - return autoConvert_core_QuobyteVolumeSource_To_v1_QuobyteVolumeSource(in, out, s) -} - -func autoConvert_v1_RBDPersistentVolumeSource_To_core_RBDPersistentVolumeSource(in *v1.RBDPersistentVolumeSource, out *core.RBDPersistentVolumeSource, s conversion.Scope) error { - out.CephMonitors = *(*[]string)(unsafe.Pointer(&in.CephMonitors)) - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - out.SecretRef = (*core.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_RBDPersistentVolumeSource_To_core_RBDPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_RBDPersistentVolumeSource_To_core_RBDPersistentVolumeSource(in *v1.RBDPersistentVolumeSource, out *core.RBDPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_RBDPersistentVolumeSource_To_core_RBDPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_RBDPersistentVolumeSource_To_v1_RBDPersistentVolumeSource(in *core.RBDPersistentVolumeSource, out *v1.RBDPersistentVolumeSource, s conversion.Scope) error { - out.CephMonitors = *(*[]string)(unsafe.Pointer(&in.CephMonitors)) - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_RBDPersistentVolumeSource_To_v1_RBDPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_RBDPersistentVolumeSource_To_v1_RBDPersistentVolumeSource(in *core.RBDPersistentVolumeSource, out *v1.RBDPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_RBDPersistentVolumeSource_To_v1_RBDPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in *v1.RBDVolumeSource, out *core.RBDVolumeSource, s conversion.Scope) error { - out.CephMonitors = *(*[]string)(unsafe.Pointer(&in.CephMonitors)) - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource is an autogenerated conversion function. -func Convert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in *v1.RBDVolumeSource, out *core.RBDVolumeSource, s conversion.Scope) error { - return autoConvert_v1_RBDVolumeSource_To_core_RBDVolumeSource(in, out, s) -} - -func autoConvert_core_RBDVolumeSource_To_v1_RBDVolumeSource(in *core.RBDVolumeSource, out *v1.RBDVolumeSource, s conversion.Scope) error { - out.CephMonitors = *(*[]string)(unsafe.Pointer(&in.CephMonitors)) - out.RBDImage = in.RBDImage - out.FSType = in.FSType - out.RBDPool = in.RBDPool - out.RadosUser = in.RadosUser - out.Keyring = in.Keyring - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_RBDVolumeSource_To_v1_RBDVolumeSource is an autogenerated conversion function. -func Convert_core_RBDVolumeSource_To_v1_RBDVolumeSource(in *core.RBDVolumeSource, out *v1.RBDVolumeSource, s conversion.Scope) error { - return autoConvert_core_RBDVolumeSource_To_v1_RBDVolumeSource(in, out, s) -} - -func autoConvert_v1_RangeAllocation_To_core_RangeAllocation(in *v1.RangeAllocation, out *core.RangeAllocation, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Range = in.Range - out.Data = *(*[]byte)(unsafe.Pointer(&in.Data)) - return nil -} - -// Convert_v1_RangeAllocation_To_core_RangeAllocation is an autogenerated conversion function. -func Convert_v1_RangeAllocation_To_core_RangeAllocation(in *v1.RangeAllocation, out *core.RangeAllocation, s conversion.Scope) error { - return autoConvert_v1_RangeAllocation_To_core_RangeAllocation(in, out, s) -} - -func autoConvert_core_RangeAllocation_To_v1_RangeAllocation(in *core.RangeAllocation, out *v1.RangeAllocation, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Range = in.Range - out.Data = *(*[]byte)(unsafe.Pointer(&in.Data)) - return nil -} - -// Convert_core_RangeAllocation_To_v1_RangeAllocation is an autogenerated conversion function. -func Convert_core_RangeAllocation_To_v1_RangeAllocation(in *core.RangeAllocation, out *v1.RangeAllocation, s conversion.Scope) error { - return autoConvert_core_RangeAllocation_To_v1_RangeAllocation(in, out, s) -} - -func autoConvert_v1_ReplicationController_To_core_ReplicationController(in *v1.ReplicationController, out *core.ReplicationController, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_ReplicationController_To_core_ReplicationController is an autogenerated conversion function. -func Convert_v1_ReplicationController_To_core_ReplicationController(in *v1.ReplicationController, out *core.ReplicationController, s conversion.Scope) error { - return autoConvert_v1_ReplicationController_To_core_ReplicationController(in, out, s) -} - -func autoConvert_core_ReplicationController_To_v1_ReplicationController(in *core.ReplicationController, out *v1.ReplicationController, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := corev1.Convert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_ReplicationController_To_v1_ReplicationController is an autogenerated conversion function. -func Convert_core_ReplicationController_To_v1_ReplicationController(in *core.ReplicationController, out *v1.ReplicationController, s conversion.Scope) error { - return autoConvert_core_ReplicationController_To_v1_ReplicationController(in, out, s) -} - -func autoConvert_v1_ReplicationControllerCondition_To_core_ReplicationControllerCondition(in *v1.ReplicationControllerCondition, out *core.ReplicationControllerCondition, s conversion.Scope) error { - out.Type = core.ReplicationControllerConditionType(in.Type) - out.Status = core.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1_ReplicationControllerCondition_To_core_ReplicationControllerCondition is an autogenerated conversion function. -func Convert_v1_ReplicationControllerCondition_To_core_ReplicationControllerCondition(in *v1.ReplicationControllerCondition, out *core.ReplicationControllerCondition, s conversion.Scope) error { - return autoConvert_v1_ReplicationControllerCondition_To_core_ReplicationControllerCondition(in, out, s) -} - -func autoConvert_core_ReplicationControllerCondition_To_v1_ReplicationControllerCondition(in *core.ReplicationControllerCondition, out *v1.ReplicationControllerCondition, s conversion.Scope) error { - out.Type = v1.ReplicationControllerConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_core_ReplicationControllerCondition_To_v1_ReplicationControllerCondition is an autogenerated conversion function. -func Convert_core_ReplicationControllerCondition_To_v1_ReplicationControllerCondition(in *core.ReplicationControllerCondition, out *v1.ReplicationControllerCondition, s conversion.Scope) error { - return autoConvert_core_ReplicationControllerCondition_To_v1_ReplicationControllerCondition(in, out, s) -} - -func autoConvert_v1_ReplicationControllerList_To_core_ReplicationControllerList(in *v1.ReplicationControllerList, out *core.ReplicationControllerList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.ReplicationController, len(*in)) - for i := range *in { - if err := Convert_v1_ReplicationController_To_core_ReplicationController(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_ReplicationControllerList_To_core_ReplicationControllerList is an autogenerated conversion function. -func Convert_v1_ReplicationControllerList_To_core_ReplicationControllerList(in *v1.ReplicationControllerList, out *core.ReplicationControllerList, s conversion.Scope) error { - return autoConvert_v1_ReplicationControllerList_To_core_ReplicationControllerList(in, out, s) -} - -func autoConvert_core_ReplicationControllerList_To_v1_ReplicationControllerList(in *core.ReplicationControllerList, out *v1.ReplicationControllerList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.ReplicationController, len(*in)) - for i := range *in { - if err := Convert_core_ReplicationController_To_v1_ReplicationController(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_ReplicationControllerList_To_v1_ReplicationControllerList is an autogenerated conversion function. -func Convert_core_ReplicationControllerList_To_v1_ReplicationControllerList(in *core.ReplicationControllerList, out *v1.ReplicationControllerList, s conversion.Scope) error { - return autoConvert_core_ReplicationControllerList_To_v1_ReplicationControllerList(in, out, s) -} - -func autoConvert_v1_ReplicationControllerSpec_To_core_ReplicationControllerSpec(in *v1.ReplicationControllerSpec, out *core.ReplicationControllerSpec, s conversion.Scope) error { - if err := metav1.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { - return err - } - out.MinReadySeconds = in.MinReadySeconds - out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(core.PodTemplateSpec) - if err := corev1.Convert_v1_PodTemplateSpec_To_core_PodTemplateSpec(*in, *out, s); err != nil { - return err - } - } else { - out.Template = nil - } - return nil -} - -func autoConvert_core_ReplicationControllerSpec_To_v1_ReplicationControllerSpec(in *core.ReplicationControllerSpec, out *v1.ReplicationControllerSpec, s conversion.Scope) error { - if err := metav1.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { - return err - } - out.MinReadySeconds = in.MinReadySeconds - out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(v1.PodTemplateSpec) - if err := corev1.Convert_core_PodTemplateSpec_To_v1_PodTemplateSpec(*in, *out, s); err != nil { - return err - } - } else { - out.Template = nil - } - return nil -} - -func autoConvert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus(in *v1.ReplicationControllerStatus, out *core.ReplicationControllerStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*[]core.ReplicationControllerCondition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus is an autogenerated conversion function. -func Convert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus(in *v1.ReplicationControllerStatus, out *core.ReplicationControllerStatus, s conversion.Scope) error { - return autoConvert_v1_ReplicationControllerStatus_To_core_ReplicationControllerStatus(in, out, s) -} - -func autoConvert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in *core.ReplicationControllerStatus, out *v1.ReplicationControllerStatus, s conversion.Scope) error { - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*[]v1.ReplicationControllerCondition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus is an autogenerated conversion function. -func Convert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in *core.ReplicationControllerStatus, out *v1.ReplicationControllerStatus, s conversion.Scope) error { - return autoConvert_core_ReplicationControllerStatus_To_v1_ReplicationControllerStatus(in, out, s) -} - -func autoConvert_v1_ResourceClaim_To_core_ResourceClaim(in *v1.ResourceClaim, out *core.ResourceClaim, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_v1_ResourceClaim_To_core_ResourceClaim is an autogenerated conversion function. -func Convert_v1_ResourceClaim_To_core_ResourceClaim(in *v1.ResourceClaim, out *core.ResourceClaim, s conversion.Scope) error { - return autoConvert_v1_ResourceClaim_To_core_ResourceClaim(in, out, s) -} - -func autoConvert_core_ResourceClaim_To_v1_ResourceClaim(in *core.ResourceClaim, out *v1.ResourceClaim, s conversion.Scope) error { - out.Name = in.Name - return nil -} - -// Convert_core_ResourceClaim_To_v1_ResourceClaim is an autogenerated conversion function. -func Convert_core_ResourceClaim_To_v1_ResourceClaim(in *core.ResourceClaim, out *v1.ResourceClaim, s conversion.Scope) error { - return autoConvert_core_ResourceClaim_To_v1_ResourceClaim(in, out, s) -} - -func autoConvert_v1_ResourceFieldSelector_To_core_ResourceFieldSelector(in *v1.ResourceFieldSelector, out *core.ResourceFieldSelector, s conversion.Scope) error { - out.ContainerName = in.ContainerName - out.Resource = in.Resource - out.Divisor = in.Divisor - return nil -} - -// Convert_v1_ResourceFieldSelector_To_core_ResourceFieldSelector is an autogenerated conversion function. -func Convert_v1_ResourceFieldSelector_To_core_ResourceFieldSelector(in *v1.ResourceFieldSelector, out *core.ResourceFieldSelector, s conversion.Scope) error { - return autoConvert_v1_ResourceFieldSelector_To_core_ResourceFieldSelector(in, out, s) -} - -func autoConvert_core_ResourceFieldSelector_To_v1_ResourceFieldSelector(in *core.ResourceFieldSelector, out *v1.ResourceFieldSelector, s conversion.Scope) error { - out.ContainerName = in.ContainerName - out.Resource = in.Resource - out.Divisor = in.Divisor - return nil -} - -// Convert_core_ResourceFieldSelector_To_v1_ResourceFieldSelector is an autogenerated conversion function. -func Convert_core_ResourceFieldSelector_To_v1_ResourceFieldSelector(in *core.ResourceFieldSelector, out *v1.ResourceFieldSelector, s conversion.Scope) error { - return autoConvert_core_ResourceFieldSelector_To_v1_ResourceFieldSelector(in, out, s) -} - -func autoConvert_v1_ResourceQuota_To_core_ResourceQuota(in *v1.ResourceQuota, out *core.ResourceQuota, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_ResourceQuota_To_core_ResourceQuota is an autogenerated conversion function. -func Convert_v1_ResourceQuota_To_core_ResourceQuota(in *v1.ResourceQuota, out *core.ResourceQuota, s conversion.Scope) error { - return autoConvert_v1_ResourceQuota_To_core_ResourceQuota(in, out, s) -} - -func autoConvert_core_ResourceQuota_To_v1_ResourceQuota(in *core.ResourceQuota, out *v1.ResourceQuota, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_ResourceQuota_To_v1_ResourceQuota is an autogenerated conversion function. -func Convert_core_ResourceQuota_To_v1_ResourceQuota(in *core.ResourceQuota, out *v1.ResourceQuota, s conversion.Scope) error { - return autoConvert_core_ResourceQuota_To_v1_ResourceQuota(in, out, s) -} - -func autoConvert_v1_ResourceQuotaList_To_core_ResourceQuotaList(in *v1.ResourceQuotaList, out *core.ResourceQuotaList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.ResourceQuota)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_ResourceQuotaList_To_core_ResourceQuotaList is an autogenerated conversion function. -func Convert_v1_ResourceQuotaList_To_core_ResourceQuotaList(in *v1.ResourceQuotaList, out *core.ResourceQuotaList, s conversion.Scope) error { - return autoConvert_v1_ResourceQuotaList_To_core_ResourceQuotaList(in, out, s) -} - -func autoConvert_core_ResourceQuotaList_To_v1_ResourceQuotaList(in *core.ResourceQuotaList, out *v1.ResourceQuotaList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.ResourceQuota)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_ResourceQuotaList_To_v1_ResourceQuotaList is an autogenerated conversion function. -func Convert_core_ResourceQuotaList_To_v1_ResourceQuotaList(in *core.ResourceQuotaList, out *v1.ResourceQuotaList, s conversion.Scope) error { - return autoConvert_core_ResourceQuotaList_To_v1_ResourceQuotaList(in, out, s) -} - -func autoConvert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec(in *v1.ResourceQuotaSpec, out *core.ResourceQuotaSpec, s conversion.Scope) error { - out.Hard = *(*core.ResourceList)(unsafe.Pointer(&in.Hard)) - out.Scopes = *(*[]core.ResourceQuotaScope)(unsafe.Pointer(&in.Scopes)) - out.ScopeSelector = (*core.ScopeSelector)(unsafe.Pointer(in.ScopeSelector)) - return nil -} - -// Convert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec is an autogenerated conversion function. -func Convert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec(in *v1.ResourceQuotaSpec, out *core.ResourceQuotaSpec, s conversion.Scope) error { - return autoConvert_v1_ResourceQuotaSpec_To_core_ResourceQuotaSpec(in, out, s) -} - -func autoConvert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in *core.ResourceQuotaSpec, out *v1.ResourceQuotaSpec, s conversion.Scope) error { - out.Hard = *(*v1.ResourceList)(unsafe.Pointer(&in.Hard)) - out.Scopes = *(*[]v1.ResourceQuotaScope)(unsafe.Pointer(&in.Scopes)) - out.ScopeSelector = (*v1.ScopeSelector)(unsafe.Pointer(in.ScopeSelector)) - return nil -} - -// Convert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec is an autogenerated conversion function. -func Convert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in *core.ResourceQuotaSpec, out *v1.ResourceQuotaSpec, s conversion.Scope) error { - return autoConvert_core_ResourceQuotaSpec_To_v1_ResourceQuotaSpec(in, out, s) -} - -func autoConvert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus(in *v1.ResourceQuotaStatus, out *core.ResourceQuotaStatus, s conversion.Scope) error { - out.Hard = *(*core.ResourceList)(unsafe.Pointer(&in.Hard)) - out.Used = *(*core.ResourceList)(unsafe.Pointer(&in.Used)) - return nil -} - -// Convert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus is an autogenerated conversion function. -func Convert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus(in *v1.ResourceQuotaStatus, out *core.ResourceQuotaStatus, s conversion.Scope) error { - return autoConvert_v1_ResourceQuotaStatus_To_core_ResourceQuotaStatus(in, out, s) -} - -func autoConvert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in *core.ResourceQuotaStatus, out *v1.ResourceQuotaStatus, s conversion.Scope) error { - out.Hard = *(*v1.ResourceList)(unsafe.Pointer(&in.Hard)) - out.Used = *(*v1.ResourceList)(unsafe.Pointer(&in.Used)) - return nil -} - -// Convert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus is an autogenerated conversion function. -func Convert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in *core.ResourceQuotaStatus, out *v1.ResourceQuotaStatus, s conversion.Scope) error { - return autoConvert_core_ResourceQuotaStatus_To_v1_ResourceQuotaStatus(in, out, s) -} - -func autoConvert_v1_ResourceRequirements_To_core_ResourceRequirements(in *v1.ResourceRequirements, out *core.ResourceRequirements, s conversion.Scope) error { - out.Limits = *(*core.ResourceList)(unsafe.Pointer(&in.Limits)) - out.Requests = *(*core.ResourceList)(unsafe.Pointer(&in.Requests)) - out.Claims = *(*[]core.ResourceClaim)(unsafe.Pointer(&in.Claims)) - return nil -} - -// Convert_v1_ResourceRequirements_To_core_ResourceRequirements is an autogenerated conversion function. -func Convert_v1_ResourceRequirements_To_core_ResourceRequirements(in *v1.ResourceRequirements, out *core.ResourceRequirements, s conversion.Scope) error { - return autoConvert_v1_ResourceRequirements_To_core_ResourceRequirements(in, out, s) -} - -func autoConvert_core_ResourceRequirements_To_v1_ResourceRequirements(in *core.ResourceRequirements, out *v1.ResourceRequirements, s conversion.Scope) error { - out.Limits = *(*v1.ResourceList)(unsafe.Pointer(&in.Limits)) - out.Requests = *(*v1.ResourceList)(unsafe.Pointer(&in.Requests)) - out.Claims = *(*[]v1.ResourceClaim)(unsafe.Pointer(&in.Claims)) - return nil -} - -// Convert_core_ResourceRequirements_To_v1_ResourceRequirements is an autogenerated conversion function. -func Convert_core_ResourceRequirements_To_v1_ResourceRequirements(in *core.ResourceRequirements, out *v1.ResourceRequirements, s conversion.Scope) error { - return autoConvert_core_ResourceRequirements_To_v1_ResourceRequirements(in, out, s) -} - -func autoConvert_v1_SELinuxOptions_To_core_SELinuxOptions(in *v1.SELinuxOptions, out *core.SELinuxOptions, s conversion.Scope) error { - out.User = in.User - out.Role = in.Role - out.Type = in.Type - out.Level = in.Level - return nil -} - -// Convert_v1_SELinuxOptions_To_core_SELinuxOptions is an autogenerated conversion function. -func Convert_v1_SELinuxOptions_To_core_SELinuxOptions(in *v1.SELinuxOptions, out *core.SELinuxOptions, s conversion.Scope) error { - return autoConvert_v1_SELinuxOptions_To_core_SELinuxOptions(in, out, s) -} - -func autoConvert_core_SELinuxOptions_To_v1_SELinuxOptions(in *core.SELinuxOptions, out *v1.SELinuxOptions, s conversion.Scope) error { - out.User = in.User - out.Role = in.Role - out.Type = in.Type - out.Level = in.Level - return nil -} - -// Convert_core_SELinuxOptions_To_v1_SELinuxOptions is an autogenerated conversion function. -func Convert_core_SELinuxOptions_To_v1_SELinuxOptions(in *core.SELinuxOptions, out *v1.SELinuxOptions, s conversion.Scope) error { - return autoConvert_core_SELinuxOptions_To_v1_SELinuxOptions(in, out, s) -} - -func autoConvert_v1_ScaleIOPersistentVolumeSource_To_core_ScaleIOPersistentVolumeSource(in *v1.ScaleIOPersistentVolumeSource, out *core.ScaleIOPersistentVolumeSource, s conversion.Scope) error { - out.Gateway = in.Gateway - out.System = in.System - out.SecretRef = (*core.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.SSLEnabled = in.SSLEnabled - out.ProtectionDomain = in.ProtectionDomain - out.StoragePool = in.StoragePool - out.StorageMode = in.StorageMode - out.VolumeName = in.VolumeName - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_ScaleIOPersistentVolumeSource_To_core_ScaleIOPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_ScaleIOPersistentVolumeSource_To_core_ScaleIOPersistentVolumeSource(in *v1.ScaleIOPersistentVolumeSource, out *core.ScaleIOPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ScaleIOPersistentVolumeSource_To_core_ScaleIOPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_ScaleIOPersistentVolumeSource_To_v1_ScaleIOPersistentVolumeSource(in *core.ScaleIOPersistentVolumeSource, out *v1.ScaleIOPersistentVolumeSource, s conversion.Scope) error { - out.Gateway = in.Gateway - out.System = in.System - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.SSLEnabled = in.SSLEnabled - out.ProtectionDomain = in.ProtectionDomain - out.StoragePool = in.StoragePool - out.StorageMode = in.StorageMode - out.VolumeName = in.VolumeName - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_ScaleIOPersistentVolumeSource_To_v1_ScaleIOPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_ScaleIOPersistentVolumeSource_To_v1_ScaleIOPersistentVolumeSource(in *core.ScaleIOPersistentVolumeSource, out *v1.ScaleIOPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_ScaleIOPersistentVolumeSource_To_v1_ScaleIOPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_ScaleIOVolumeSource_To_core_ScaleIOVolumeSource(in *v1.ScaleIOVolumeSource, out *core.ScaleIOVolumeSource, s conversion.Scope) error { - out.Gateway = in.Gateway - out.System = in.System - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.SSLEnabled = in.SSLEnabled - out.ProtectionDomain = in.ProtectionDomain - out.StoragePool = in.StoragePool - out.StorageMode = in.StorageMode - out.VolumeName = in.VolumeName - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_v1_ScaleIOVolumeSource_To_core_ScaleIOVolumeSource is an autogenerated conversion function. -func Convert_v1_ScaleIOVolumeSource_To_core_ScaleIOVolumeSource(in *v1.ScaleIOVolumeSource, out *core.ScaleIOVolumeSource, s conversion.Scope) error { - return autoConvert_v1_ScaleIOVolumeSource_To_core_ScaleIOVolumeSource(in, out, s) -} - -func autoConvert_core_ScaleIOVolumeSource_To_v1_ScaleIOVolumeSource(in *core.ScaleIOVolumeSource, out *v1.ScaleIOVolumeSource, s conversion.Scope) error { - out.Gateway = in.Gateway - out.System = in.System - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - out.SSLEnabled = in.SSLEnabled - out.ProtectionDomain = in.ProtectionDomain - out.StoragePool = in.StoragePool - out.StorageMode = in.StorageMode - out.VolumeName = in.VolumeName - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - return nil -} - -// Convert_core_ScaleIOVolumeSource_To_v1_ScaleIOVolumeSource is an autogenerated conversion function. -func Convert_core_ScaleIOVolumeSource_To_v1_ScaleIOVolumeSource(in *core.ScaleIOVolumeSource, out *v1.ScaleIOVolumeSource, s conversion.Scope) error { - return autoConvert_core_ScaleIOVolumeSource_To_v1_ScaleIOVolumeSource(in, out, s) -} - -func autoConvert_v1_ScopeSelector_To_core_ScopeSelector(in *v1.ScopeSelector, out *core.ScopeSelector, s conversion.Scope) error { - out.MatchExpressions = *(*[]core.ScopedResourceSelectorRequirement)(unsafe.Pointer(&in.MatchExpressions)) - return nil -} - -// Convert_v1_ScopeSelector_To_core_ScopeSelector is an autogenerated conversion function. -func Convert_v1_ScopeSelector_To_core_ScopeSelector(in *v1.ScopeSelector, out *core.ScopeSelector, s conversion.Scope) error { - return autoConvert_v1_ScopeSelector_To_core_ScopeSelector(in, out, s) -} - -func autoConvert_core_ScopeSelector_To_v1_ScopeSelector(in *core.ScopeSelector, out *v1.ScopeSelector, s conversion.Scope) error { - out.MatchExpressions = *(*[]v1.ScopedResourceSelectorRequirement)(unsafe.Pointer(&in.MatchExpressions)) - return nil -} - -// Convert_core_ScopeSelector_To_v1_ScopeSelector is an autogenerated conversion function. -func Convert_core_ScopeSelector_To_v1_ScopeSelector(in *core.ScopeSelector, out *v1.ScopeSelector, s conversion.Scope) error { - return autoConvert_core_ScopeSelector_To_v1_ScopeSelector(in, out, s) -} - -func autoConvert_v1_ScopedResourceSelectorRequirement_To_core_ScopedResourceSelectorRequirement(in *v1.ScopedResourceSelectorRequirement, out *core.ScopedResourceSelectorRequirement, s conversion.Scope) error { - out.ScopeName = core.ResourceQuotaScope(in.ScopeName) - out.Operator = core.ScopeSelectorOperator(in.Operator) - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_v1_ScopedResourceSelectorRequirement_To_core_ScopedResourceSelectorRequirement is an autogenerated conversion function. -func Convert_v1_ScopedResourceSelectorRequirement_To_core_ScopedResourceSelectorRequirement(in *v1.ScopedResourceSelectorRequirement, out *core.ScopedResourceSelectorRequirement, s conversion.Scope) error { - return autoConvert_v1_ScopedResourceSelectorRequirement_To_core_ScopedResourceSelectorRequirement(in, out, s) -} - -func autoConvert_core_ScopedResourceSelectorRequirement_To_v1_ScopedResourceSelectorRequirement(in *core.ScopedResourceSelectorRequirement, out *v1.ScopedResourceSelectorRequirement, s conversion.Scope) error { - out.ScopeName = v1.ResourceQuotaScope(in.ScopeName) - out.Operator = v1.ScopeSelectorOperator(in.Operator) - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_core_ScopedResourceSelectorRequirement_To_v1_ScopedResourceSelectorRequirement is an autogenerated conversion function. -func Convert_core_ScopedResourceSelectorRequirement_To_v1_ScopedResourceSelectorRequirement(in *core.ScopedResourceSelectorRequirement, out *v1.ScopedResourceSelectorRequirement, s conversion.Scope) error { - return autoConvert_core_ScopedResourceSelectorRequirement_To_v1_ScopedResourceSelectorRequirement(in, out, s) -} - -func autoConvert_v1_SeccompProfile_To_core_SeccompProfile(in *v1.SeccompProfile, out *core.SeccompProfile, s conversion.Scope) error { - out.Type = core.SeccompProfileType(in.Type) - out.LocalhostProfile = (*string)(unsafe.Pointer(in.LocalhostProfile)) - return nil -} - -// Convert_v1_SeccompProfile_To_core_SeccompProfile is an autogenerated conversion function. -func Convert_v1_SeccompProfile_To_core_SeccompProfile(in *v1.SeccompProfile, out *core.SeccompProfile, s conversion.Scope) error { - return autoConvert_v1_SeccompProfile_To_core_SeccompProfile(in, out, s) -} - -func autoConvert_core_SeccompProfile_To_v1_SeccompProfile(in *core.SeccompProfile, out *v1.SeccompProfile, s conversion.Scope) error { - out.Type = v1.SeccompProfileType(in.Type) - out.LocalhostProfile = (*string)(unsafe.Pointer(in.LocalhostProfile)) - return nil -} - -// Convert_core_SeccompProfile_To_v1_SeccompProfile is an autogenerated conversion function. -func Convert_core_SeccompProfile_To_v1_SeccompProfile(in *core.SeccompProfile, out *v1.SeccompProfile, s conversion.Scope) error { - return autoConvert_core_SeccompProfile_To_v1_SeccompProfile(in, out, s) -} - -func autoConvert_v1_Secret_To_core_Secret(in *v1.Secret, out *core.Secret, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Immutable = (*bool)(unsafe.Pointer(in.Immutable)) - out.Data = *(*map[string][]byte)(unsafe.Pointer(&in.Data)) - // INFO: in.StringData opted out of conversion generation - out.Type = core.SecretType(in.Type) - return nil -} - -func autoConvert_core_Secret_To_v1_Secret(in *core.Secret, out *v1.Secret, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Immutable = (*bool)(unsafe.Pointer(in.Immutable)) - out.Data = *(*map[string][]byte)(unsafe.Pointer(&in.Data)) - out.Type = v1.SecretType(in.Type) - return nil -} - -// Convert_core_Secret_To_v1_Secret is an autogenerated conversion function. -func Convert_core_Secret_To_v1_Secret(in *core.Secret, out *v1.Secret, s conversion.Scope) error { - return autoConvert_core_Secret_To_v1_Secret(in, out, s) -} - -func autoConvert_v1_SecretEnvSource_To_core_SecretEnvSource(in *v1.SecretEnvSource, out *core.SecretEnvSource, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_SecretEnvSource_To_core_SecretEnvSource is an autogenerated conversion function. -func Convert_v1_SecretEnvSource_To_core_SecretEnvSource(in *v1.SecretEnvSource, out *core.SecretEnvSource, s conversion.Scope) error { - return autoConvert_v1_SecretEnvSource_To_core_SecretEnvSource(in, out, s) -} - -func autoConvert_core_SecretEnvSource_To_v1_SecretEnvSource(in *core.SecretEnvSource, out *v1.SecretEnvSource, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_SecretEnvSource_To_v1_SecretEnvSource is an autogenerated conversion function. -func Convert_core_SecretEnvSource_To_v1_SecretEnvSource(in *core.SecretEnvSource, out *v1.SecretEnvSource, s conversion.Scope) error { - return autoConvert_core_SecretEnvSource_To_v1_SecretEnvSource(in, out, s) -} - -func autoConvert_v1_SecretKeySelector_To_core_SecretKeySelector(in *v1.SecretKeySelector, out *core.SecretKeySelector, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_SecretKeySelector_To_core_SecretKeySelector is an autogenerated conversion function. -func Convert_v1_SecretKeySelector_To_core_SecretKeySelector(in *v1.SecretKeySelector, out *core.SecretKeySelector, s conversion.Scope) error { - return autoConvert_v1_SecretKeySelector_To_core_SecretKeySelector(in, out, s) -} - -func autoConvert_core_SecretKeySelector_To_v1_SecretKeySelector(in *core.SecretKeySelector, out *v1.SecretKeySelector, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Key = in.Key - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_SecretKeySelector_To_v1_SecretKeySelector is an autogenerated conversion function. -func Convert_core_SecretKeySelector_To_v1_SecretKeySelector(in *core.SecretKeySelector, out *v1.SecretKeySelector, s conversion.Scope) error { - return autoConvert_core_SecretKeySelector_To_v1_SecretKeySelector(in, out, s) -} - -func autoConvert_v1_SecretList_To_core_SecretList(in *v1.SecretList, out *core.SecretList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.Secret, len(*in)) - for i := range *in { - if err := corev1.Convert_v1_Secret_To_core_Secret(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_SecretList_To_core_SecretList is an autogenerated conversion function. -func Convert_v1_SecretList_To_core_SecretList(in *v1.SecretList, out *core.SecretList, s conversion.Scope) error { - return autoConvert_v1_SecretList_To_core_SecretList(in, out, s) -} - -func autoConvert_core_SecretList_To_v1_SecretList(in *core.SecretList, out *v1.SecretList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.Secret, len(*in)) - for i := range *in { - if err := Convert_core_Secret_To_v1_Secret(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_SecretList_To_v1_SecretList is an autogenerated conversion function. -func Convert_core_SecretList_To_v1_SecretList(in *core.SecretList, out *v1.SecretList, s conversion.Scope) error { - return autoConvert_core_SecretList_To_v1_SecretList(in, out, s) -} - -func autoConvert_v1_SecretProjection_To_core_SecretProjection(in *v1.SecretProjection, out *core.SecretProjection, s conversion.Scope) error { - if err := Convert_v1_LocalObjectReference_To_core_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Items = *(*[]core.KeyToPath)(unsafe.Pointer(&in.Items)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_SecretProjection_To_core_SecretProjection is an autogenerated conversion function. -func Convert_v1_SecretProjection_To_core_SecretProjection(in *v1.SecretProjection, out *core.SecretProjection, s conversion.Scope) error { - return autoConvert_v1_SecretProjection_To_core_SecretProjection(in, out, s) -} - -func autoConvert_core_SecretProjection_To_v1_SecretProjection(in *core.SecretProjection, out *v1.SecretProjection, s conversion.Scope) error { - if err := Convert_core_LocalObjectReference_To_v1_LocalObjectReference(&in.LocalObjectReference, &out.LocalObjectReference, s); err != nil { - return err - } - out.Items = *(*[]v1.KeyToPath)(unsafe.Pointer(&in.Items)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_SecretProjection_To_v1_SecretProjection is an autogenerated conversion function. -func Convert_core_SecretProjection_To_v1_SecretProjection(in *core.SecretProjection, out *v1.SecretProjection, s conversion.Scope) error { - return autoConvert_core_SecretProjection_To_v1_SecretProjection(in, out, s) -} - -func autoConvert_v1_SecretReference_To_core_SecretReference(in *v1.SecretReference, out *core.SecretReference, s conversion.Scope) error { - out.Name = in.Name - out.Namespace = in.Namespace - return nil -} - -// Convert_v1_SecretReference_To_core_SecretReference is an autogenerated conversion function. -func Convert_v1_SecretReference_To_core_SecretReference(in *v1.SecretReference, out *core.SecretReference, s conversion.Scope) error { - return autoConvert_v1_SecretReference_To_core_SecretReference(in, out, s) -} - -func autoConvert_core_SecretReference_To_v1_SecretReference(in *core.SecretReference, out *v1.SecretReference, s conversion.Scope) error { - out.Name = in.Name - out.Namespace = in.Namespace - return nil -} - -// Convert_core_SecretReference_To_v1_SecretReference is an autogenerated conversion function. -func Convert_core_SecretReference_To_v1_SecretReference(in *core.SecretReference, out *v1.SecretReference, s conversion.Scope) error { - return autoConvert_core_SecretReference_To_v1_SecretReference(in, out, s) -} - -func autoConvert_v1_SecretVolumeSource_To_core_SecretVolumeSource(in *v1.SecretVolumeSource, out *core.SecretVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.Items = *(*[]core.KeyToPath)(unsafe.Pointer(&in.Items)) - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_v1_SecretVolumeSource_To_core_SecretVolumeSource is an autogenerated conversion function. -func Convert_v1_SecretVolumeSource_To_core_SecretVolumeSource(in *v1.SecretVolumeSource, out *core.SecretVolumeSource, s conversion.Scope) error { - return autoConvert_v1_SecretVolumeSource_To_core_SecretVolumeSource(in, out, s) -} - -func autoConvert_core_SecretVolumeSource_To_v1_SecretVolumeSource(in *core.SecretVolumeSource, out *v1.SecretVolumeSource, s conversion.Scope) error { - out.SecretName = in.SecretName - out.Items = *(*[]v1.KeyToPath)(unsafe.Pointer(&in.Items)) - out.DefaultMode = (*int32)(unsafe.Pointer(in.DefaultMode)) - out.Optional = (*bool)(unsafe.Pointer(in.Optional)) - return nil -} - -// Convert_core_SecretVolumeSource_To_v1_SecretVolumeSource is an autogenerated conversion function. -func Convert_core_SecretVolumeSource_To_v1_SecretVolumeSource(in *core.SecretVolumeSource, out *v1.SecretVolumeSource, s conversion.Scope) error { - return autoConvert_core_SecretVolumeSource_To_v1_SecretVolumeSource(in, out, s) -} - -func autoConvert_v1_SecurityContext_To_core_SecurityContext(in *v1.SecurityContext, out *core.SecurityContext, s conversion.Scope) error { - out.Capabilities = (*core.Capabilities)(unsafe.Pointer(in.Capabilities)) - out.Privileged = (*bool)(unsafe.Pointer(in.Privileged)) - out.SELinuxOptions = (*core.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) - out.WindowsOptions = (*core.WindowsSecurityContextOptions)(unsafe.Pointer(in.WindowsOptions)) - out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) - out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup)) - out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) - out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem)) - out.AllowPrivilegeEscalation = (*bool)(unsafe.Pointer(in.AllowPrivilegeEscalation)) - out.ProcMount = (*core.ProcMountType)(unsafe.Pointer(in.ProcMount)) - out.SeccompProfile = (*core.SeccompProfile)(unsafe.Pointer(in.SeccompProfile)) - return nil -} - -// Convert_v1_SecurityContext_To_core_SecurityContext is an autogenerated conversion function. -func Convert_v1_SecurityContext_To_core_SecurityContext(in *v1.SecurityContext, out *core.SecurityContext, s conversion.Scope) error { - return autoConvert_v1_SecurityContext_To_core_SecurityContext(in, out, s) -} - -func autoConvert_core_SecurityContext_To_v1_SecurityContext(in *core.SecurityContext, out *v1.SecurityContext, s conversion.Scope) error { - out.Capabilities = (*v1.Capabilities)(unsafe.Pointer(in.Capabilities)) - out.Privileged = (*bool)(unsafe.Pointer(in.Privileged)) - out.SELinuxOptions = (*v1.SELinuxOptions)(unsafe.Pointer(in.SELinuxOptions)) - out.WindowsOptions = (*v1.WindowsSecurityContextOptions)(unsafe.Pointer(in.WindowsOptions)) - out.RunAsUser = (*int64)(unsafe.Pointer(in.RunAsUser)) - out.RunAsGroup = (*int64)(unsafe.Pointer(in.RunAsGroup)) - out.RunAsNonRoot = (*bool)(unsafe.Pointer(in.RunAsNonRoot)) - out.ReadOnlyRootFilesystem = (*bool)(unsafe.Pointer(in.ReadOnlyRootFilesystem)) - out.AllowPrivilegeEscalation = (*bool)(unsafe.Pointer(in.AllowPrivilegeEscalation)) - out.ProcMount = (*v1.ProcMountType)(unsafe.Pointer(in.ProcMount)) - out.SeccompProfile = (*v1.SeccompProfile)(unsafe.Pointer(in.SeccompProfile)) - return nil -} - -// Convert_core_SecurityContext_To_v1_SecurityContext is an autogenerated conversion function. -func Convert_core_SecurityContext_To_v1_SecurityContext(in *core.SecurityContext, out *v1.SecurityContext, s conversion.Scope) error { - return autoConvert_core_SecurityContext_To_v1_SecurityContext(in, out, s) -} - -func autoConvert_v1_SerializedReference_To_core_SerializedReference(in *v1.SerializedReference, out *core.SerializedReference, s conversion.Scope) error { - if err := Convert_v1_ObjectReference_To_core_ObjectReference(&in.Reference, &out.Reference, s); err != nil { - return err - } - return nil -} - -// Convert_v1_SerializedReference_To_core_SerializedReference is an autogenerated conversion function. -func Convert_v1_SerializedReference_To_core_SerializedReference(in *v1.SerializedReference, out *core.SerializedReference, s conversion.Scope) error { - return autoConvert_v1_SerializedReference_To_core_SerializedReference(in, out, s) -} - -func autoConvert_core_SerializedReference_To_v1_SerializedReference(in *core.SerializedReference, out *v1.SerializedReference, s conversion.Scope) error { - if err := Convert_core_ObjectReference_To_v1_ObjectReference(&in.Reference, &out.Reference, s); err != nil { - return err - } - return nil -} - -// Convert_core_SerializedReference_To_v1_SerializedReference is an autogenerated conversion function. -func Convert_core_SerializedReference_To_v1_SerializedReference(in *core.SerializedReference, out *v1.SerializedReference, s conversion.Scope) error { - return autoConvert_core_SerializedReference_To_v1_SerializedReference(in, out, s) -} - -func autoConvert_v1_Service_To_core_Service(in *v1.Service, out *core.Service, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1_ServiceSpec_To_core_ServiceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1_ServiceStatus_To_core_ServiceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1_Service_To_core_Service is an autogenerated conversion function. -func Convert_v1_Service_To_core_Service(in *v1.Service, out *core.Service, s conversion.Scope) error { - return autoConvert_v1_Service_To_core_Service(in, out, s) -} - -func autoConvert_core_Service_To_v1_Service(in *core.Service, out *v1.Service, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_core_ServiceSpec_To_v1_ServiceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_core_ServiceStatus_To_v1_ServiceStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_core_Service_To_v1_Service is an autogenerated conversion function. -func Convert_core_Service_To_v1_Service(in *core.Service, out *v1.Service, s conversion.Scope) error { - return autoConvert_core_Service_To_v1_Service(in, out, s) -} - -func autoConvert_v1_ServiceAccount_To_core_ServiceAccount(in *v1.ServiceAccount, out *core.ServiceAccount, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Secrets = *(*[]core.ObjectReference)(unsafe.Pointer(&in.Secrets)) - out.ImagePullSecrets = *(*[]core.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) - out.AutomountServiceAccountToken = (*bool)(unsafe.Pointer(in.AutomountServiceAccountToken)) - return nil -} - -// Convert_v1_ServiceAccount_To_core_ServiceAccount is an autogenerated conversion function. -func Convert_v1_ServiceAccount_To_core_ServiceAccount(in *v1.ServiceAccount, out *core.ServiceAccount, s conversion.Scope) error { - return autoConvert_v1_ServiceAccount_To_core_ServiceAccount(in, out, s) -} - -func autoConvert_core_ServiceAccount_To_v1_ServiceAccount(in *core.ServiceAccount, out *v1.ServiceAccount, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - out.Secrets = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.Secrets)) - out.ImagePullSecrets = *(*[]v1.LocalObjectReference)(unsafe.Pointer(&in.ImagePullSecrets)) - out.AutomountServiceAccountToken = (*bool)(unsafe.Pointer(in.AutomountServiceAccountToken)) - return nil -} - -// Convert_core_ServiceAccount_To_v1_ServiceAccount is an autogenerated conversion function. -func Convert_core_ServiceAccount_To_v1_ServiceAccount(in *core.ServiceAccount, out *v1.ServiceAccount, s conversion.Scope) error { - return autoConvert_core_ServiceAccount_To_v1_ServiceAccount(in, out, s) -} - -func autoConvert_v1_ServiceAccountList_To_core_ServiceAccountList(in *v1.ServiceAccountList, out *core.ServiceAccountList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]core.ServiceAccount)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1_ServiceAccountList_To_core_ServiceAccountList is an autogenerated conversion function. -func Convert_v1_ServiceAccountList_To_core_ServiceAccountList(in *v1.ServiceAccountList, out *core.ServiceAccountList, s conversion.Scope) error { - return autoConvert_v1_ServiceAccountList_To_core_ServiceAccountList(in, out, s) -} - -func autoConvert_core_ServiceAccountList_To_v1_ServiceAccountList(in *core.ServiceAccountList, out *v1.ServiceAccountList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1.ServiceAccount)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_core_ServiceAccountList_To_v1_ServiceAccountList is an autogenerated conversion function. -func Convert_core_ServiceAccountList_To_v1_ServiceAccountList(in *core.ServiceAccountList, out *v1.ServiceAccountList, s conversion.Scope) error { - return autoConvert_core_ServiceAccountList_To_v1_ServiceAccountList(in, out, s) -} - -func autoConvert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection(in *v1.ServiceAccountTokenProjection, out *core.ServiceAccountTokenProjection, s conversion.Scope) error { - out.Audience = in.Audience - if err := metav1.Convert_Pointer_int64_To_int64(&in.ExpirationSeconds, &out.ExpirationSeconds, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -// Convert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection is an autogenerated conversion function. -func Convert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection(in *v1.ServiceAccountTokenProjection, out *core.ServiceAccountTokenProjection, s conversion.Scope) error { - return autoConvert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection(in, out, s) -} - -func autoConvert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection(in *core.ServiceAccountTokenProjection, out *v1.ServiceAccountTokenProjection, s conversion.Scope) error { - out.Audience = in.Audience - if err := metav1.Convert_int64_To_Pointer_int64(&in.ExpirationSeconds, &out.ExpirationSeconds, s); err != nil { - return err - } - out.Path = in.Path - return nil -} - -// Convert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection is an autogenerated conversion function. -func Convert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection(in *core.ServiceAccountTokenProjection, out *v1.ServiceAccountTokenProjection, s conversion.Scope) error { - return autoConvert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection(in, out, s) -} - -func autoConvert_v1_ServiceList_To_core_ServiceList(in *v1.ServiceList, out *core.ServiceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]core.Service, len(*in)) - for i := range *in { - if err := Convert_v1_Service_To_core_Service(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1_ServiceList_To_core_ServiceList is an autogenerated conversion function. -func Convert_v1_ServiceList_To_core_ServiceList(in *v1.ServiceList, out *core.ServiceList, s conversion.Scope) error { - return autoConvert_v1_ServiceList_To_core_ServiceList(in, out, s) -} - -func autoConvert_core_ServiceList_To_v1_ServiceList(in *core.ServiceList, out *v1.ServiceList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1.Service, len(*in)) - for i := range *in { - if err := Convert_core_Service_To_v1_Service(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_core_ServiceList_To_v1_ServiceList is an autogenerated conversion function. -func Convert_core_ServiceList_To_v1_ServiceList(in *core.ServiceList, out *v1.ServiceList, s conversion.Scope) error { - return autoConvert_core_ServiceList_To_v1_ServiceList(in, out, s) -} - -func autoConvert_v1_ServicePort_To_core_ServicePort(in *v1.ServicePort, out *core.ServicePort, s conversion.Scope) error { - out.Name = in.Name - out.Protocol = core.Protocol(in.Protocol) - out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol)) - out.Port = in.Port - out.TargetPort = in.TargetPort - out.NodePort = in.NodePort - return nil -} - -// Convert_v1_ServicePort_To_core_ServicePort is an autogenerated conversion function. -func Convert_v1_ServicePort_To_core_ServicePort(in *v1.ServicePort, out *core.ServicePort, s conversion.Scope) error { - return autoConvert_v1_ServicePort_To_core_ServicePort(in, out, s) -} - -func autoConvert_core_ServicePort_To_v1_ServicePort(in *core.ServicePort, out *v1.ServicePort, s conversion.Scope) error { - out.Name = in.Name - out.Protocol = v1.Protocol(in.Protocol) - out.AppProtocol = (*string)(unsafe.Pointer(in.AppProtocol)) - out.Port = in.Port - out.TargetPort = in.TargetPort - out.NodePort = in.NodePort - return nil -} - -// Convert_core_ServicePort_To_v1_ServicePort is an autogenerated conversion function. -func Convert_core_ServicePort_To_v1_ServicePort(in *core.ServicePort, out *v1.ServicePort, s conversion.Scope) error { - return autoConvert_core_ServicePort_To_v1_ServicePort(in, out, s) -} - -func autoConvert_v1_ServiceProxyOptions_To_core_ServiceProxyOptions(in *v1.ServiceProxyOptions, out *core.ServiceProxyOptions, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -// Convert_v1_ServiceProxyOptions_To_core_ServiceProxyOptions is an autogenerated conversion function. -func Convert_v1_ServiceProxyOptions_To_core_ServiceProxyOptions(in *v1.ServiceProxyOptions, out *core.ServiceProxyOptions, s conversion.Scope) error { - return autoConvert_v1_ServiceProxyOptions_To_core_ServiceProxyOptions(in, out, s) -} - -func autoConvert_core_ServiceProxyOptions_To_v1_ServiceProxyOptions(in *core.ServiceProxyOptions, out *v1.ServiceProxyOptions, s conversion.Scope) error { - out.Path = in.Path - return nil -} - -// Convert_core_ServiceProxyOptions_To_v1_ServiceProxyOptions is an autogenerated conversion function. -func Convert_core_ServiceProxyOptions_To_v1_ServiceProxyOptions(in *core.ServiceProxyOptions, out *v1.ServiceProxyOptions, s conversion.Scope) error { - return autoConvert_core_ServiceProxyOptions_To_v1_ServiceProxyOptions(in, out, s) -} - -func autoConvert_url_Values_To_v1_ServiceProxyOptions(in *url.Values, out *v1.ServiceProxyOptions, s conversion.Scope) error { - // WARNING: Field TypeMeta does not have json tag, skipping. - - if values, ok := map[string][]string(*in)["path"]; ok && len(values) > 0 { - if err := runtime.Convert_Slice_string_To_string(&values, &out.Path, s); err != nil { - return err - } - } else { - out.Path = "" - } - return nil -} - -// Convert_url_Values_To_v1_ServiceProxyOptions is an autogenerated conversion function. -func Convert_url_Values_To_v1_ServiceProxyOptions(in *url.Values, out *v1.ServiceProxyOptions, s conversion.Scope) error { - return autoConvert_url_Values_To_v1_ServiceProxyOptions(in, out, s) -} - -func autoConvert_v1_ServiceSpec_To_core_ServiceSpec(in *v1.ServiceSpec, out *core.ServiceSpec, s conversion.Scope) error { - out.Ports = *(*[]core.ServicePort)(unsafe.Pointer(&in.Ports)) - out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) - out.ClusterIP = in.ClusterIP - out.ClusterIPs = *(*[]string)(unsafe.Pointer(&in.ClusterIPs)) - out.Type = core.ServiceType(in.Type) - out.ExternalIPs = *(*[]string)(unsafe.Pointer(&in.ExternalIPs)) - out.SessionAffinity = core.ServiceAffinity(in.SessionAffinity) - out.LoadBalancerIP = in.LoadBalancerIP - out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) - out.ExternalName = in.ExternalName - out.ExternalTrafficPolicy = core.ServiceExternalTrafficPolicy(in.ExternalTrafficPolicy) - out.HealthCheckNodePort = in.HealthCheckNodePort - out.PublishNotReadyAddresses = in.PublishNotReadyAddresses - out.SessionAffinityConfig = (*core.SessionAffinityConfig)(unsafe.Pointer(in.SessionAffinityConfig)) - out.IPFamilies = *(*[]core.IPFamily)(unsafe.Pointer(&in.IPFamilies)) - out.IPFamilyPolicy = (*core.IPFamilyPolicy)(unsafe.Pointer(in.IPFamilyPolicy)) - out.AllocateLoadBalancerNodePorts = (*bool)(unsafe.Pointer(in.AllocateLoadBalancerNodePorts)) - out.LoadBalancerClass = (*string)(unsafe.Pointer(in.LoadBalancerClass)) - out.InternalTrafficPolicy = (*core.ServiceInternalTrafficPolicy)(unsafe.Pointer(in.InternalTrafficPolicy)) - return nil -} - -// Convert_v1_ServiceSpec_To_core_ServiceSpec is an autogenerated conversion function. -func Convert_v1_ServiceSpec_To_core_ServiceSpec(in *v1.ServiceSpec, out *core.ServiceSpec, s conversion.Scope) error { - return autoConvert_v1_ServiceSpec_To_core_ServiceSpec(in, out, s) -} - -func autoConvert_core_ServiceSpec_To_v1_ServiceSpec(in *core.ServiceSpec, out *v1.ServiceSpec, s conversion.Scope) error { - out.Type = v1.ServiceType(in.Type) - out.Ports = *(*[]v1.ServicePort)(unsafe.Pointer(&in.Ports)) - out.Selector = *(*map[string]string)(unsafe.Pointer(&in.Selector)) - out.ClusterIP = in.ClusterIP - out.ClusterIPs = *(*[]string)(unsafe.Pointer(&in.ClusterIPs)) - out.IPFamilies = *(*[]v1.IPFamily)(unsafe.Pointer(&in.IPFamilies)) - out.IPFamilyPolicy = (*v1.IPFamilyPolicy)(unsafe.Pointer(in.IPFamilyPolicy)) - out.ExternalName = in.ExternalName - out.ExternalIPs = *(*[]string)(unsafe.Pointer(&in.ExternalIPs)) - out.LoadBalancerIP = in.LoadBalancerIP - out.SessionAffinity = v1.ServiceAffinity(in.SessionAffinity) - out.SessionAffinityConfig = (*v1.SessionAffinityConfig)(unsafe.Pointer(in.SessionAffinityConfig)) - out.LoadBalancerSourceRanges = *(*[]string)(unsafe.Pointer(&in.LoadBalancerSourceRanges)) - out.ExternalTrafficPolicy = v1.ServiceExternalTrafficPolicy(in.ExternalTrafficPolicy) - out.HealthCheckNodePort = in.HealthCheckNodePort - out.PublishNotReadyAddresses = in.PublishNotReadyAddresses - out.AllocateLoadBalancerNodePorts = (*bool)(unsafe.Pointer(in.AllocateLoadBalancerNodePorts)) - out.LoadBalancerClass = (*string)(unsafe.Pointer(in.LoadBalancerClass)) - out.InternalTrafficPolicy = (*v1.ServiceInternalTrafficPolicy)(unsafe.Pointer(in.InternalTrafficPolicy)) - return nil -} - -// Convert_core_ServiceSpec_To_v1_ServiceSpec is an autogenerated conversion function. -func Convert_core_ServiceSpec_To_v1_ServiceSpec(in *core.ServiceSpec, out *v1.ServiceSpec, s conversion.Scope) error { - return autoConvert_core_ServiceSpec_To_v1_ServiceSpec(in, out, s) -} - -func autoConvert_v1_ServiceStatus_To_core_ServiceStatus(in *v1.ServiceStatus, out *core.ServiceStatus, s conversion.Scope) error { - if err := corev1.Convert_v1_LoadBalancerStatus_To_core_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { - return err - } - out.Conditions = *(*[]metav1.Condition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1_ServiceStatus_To_core_ServiceStatus is an autogenerated conversion function. -func Convert_v1_ServiceStatus_To_core_ServiceStatus(in *v1.ServiceStatus, out *core.ServiceStatus, s conversion.Scope) error { - return autoConvert_v1_ServiceStatus_To_core_ServiceStatus(in, out, s) -} - -func autoConvert_core_ServiceStatus_To_v1_ServiceStatus(in *core.ServiceStatus, out *v1.ServiceStatus, s conversion.Scope) error { - if err := corev1.Convert_core_LoadBalancerStatus_To_v1_LoadBalancerStatus(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { - return err - } - out.Conditions = *(*[]metav1.Condition)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_core_ServiceStatus_To_v1_ServiceStatus is an autogenerated conversion function. -func Convert_core_ServiceStatus_To_v1_ServiceStatus(in *core.ServiceStatus, out *v1.ServiceStatus, s conversion.Scope) error { - return autoConvert_core_ServiceStatus_To_v1_ServiceStatus(in, out, s) -} - -func autoConvert_v1_SessionAffinityConfig_To_core_SessionAffinityConfig(in *v1.SessionAffinityConfig, out *core.SessionAffinityConfig, s conversion.Scope) error { - out.ClientIP = (*core.ClientIPConfig)(unsafe.Pointer(in.ClientIP)) - return nil -} - -// Convert_v1_SessionAffinityConfig_To_core_SessionAffinityConfig is an autogenerated conversion function. -func Convert_v1_SessionAffinityConfig_To_core_SessionAffinityConfig(in *v1.SessionAffinityConfig, out *core.SessionAffinityConfig, s conversion.Scope) error { - return autoConvert_v1_SessionAffinityConfig_To_core_SessionAffinityConfig(in, out, s) -} - -func autoConvert_core_SessionAffinityConfig_To_v1_SessionAffinityConfig(in *core.SessionAffinityConfig, out *v1.SessionAffinityConfig, s conversion.Scope) error { - out.ClientIP = (*v1.ClientIPConfig)(unsafe.Pointer(in.ClientIP)) - return nil -} - -// Convert_core_SessionAffinityConfig_To_v1_SessionAffinityConfig is an autogenerated conversion function. -func Convert_core_SessionAffinityConfig_To_v1_SessionAffinityConfig(in *core.SessionAffinityConfig, out *v1.SessionAffinityConfig, s conversion.Scope) error { - return autoConvert_core_SessionAffinityConfig_To_v1_SessionAffinityConfig(in, out, s) -} - -func autoConvert_v1_SleepAction_To_core_SleepAction(in *v1.SleepAction, out *core.SleepAction, s conversion.Scope) error { - out.Seconds = in.Seconds - return nil -} - -// Convert_v1_SleepAction_To_core_SleepAction is an autogenerated conversion function. -func Convert_v1_SleepAction_To_core_SleepAction(in *v1.SleepAction, out *core.SleepAction, s conversion.Scope) error { - return autoConvert_v1_SleepAction_To_core_SleepAction(in, out, s) -} - -func autoConvert_core_SleepAction_To_v1_SleepAction(in *core.SleepAction, out *v1.SleepAction, s conversion.Scope) error { - out.Seconds = in.Seconds - return nil -} - -// Convert_core_SleepAction_To_v1_SleepAction is an autogenerated conversion function. -func Convert_core_SleepAction_To_v1_SleepAction(in *core.SleepAction, out *v1.SleepAction, s conversion.Scope) error { - return autoConvert_core_SleepAction_To_v1_SleepAction(in, out, s) -} - -func autoConvert_v1_StorageOSPersistentVolumeSource_To_core_StorageOSPersistentVolumeSource(in *v1.StorageOSPersistentVolumeSource, out *core.StorageOSPersistentVolumeSource, s conversion.Scope) error { - out.VolumeName = in.VolumeName - out.VolumeNamespace = in.VolumeNamespace - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*core.ObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_v1_StorageOSPersistentVolumeSource_To_core_StorageOSPersistentVolumeSource is an autogenerated conversion function. -func Convert_v1_StorageOSPersistentVolumeSource_To_core_StorageOSPersistentVolumeSource(in *v1.StorageOSPersistentVolumeSource, out *core.StorageOSPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_v1_StorageOSPersistentVolumeSource_To_core_StorageOSPersistentVolumeSource(in, out, s) -} - -func autoConvert_core_StorageOSPersistentVolumeSource_To_v1_StorageOSPersistentVolumeSource(in *core.StorageOSPersistentVolumeSource, out *v1.StorageOSPersistentVolumeSource, s conversion.Scope) error { - out.VolumeName = in.VolumeName - out.VolumeNamespace = in.VolumeNamespace - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*v1.ObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_core_StorageOSPersistentVolumeSource_To_v1_StorageOSPersistentVolumeSource is an autogenerated conversion function. -func Convert_core_StorageOSPersistentVolumeSource_To_v1_StorageOSPersistentVolumeSource(in *core.StorageOSPersistentVolumeSource, out *v1.StorageOSPersistentVolumeSource, s conversion.Scope) error { - return autoConvert_core_StorageOSPersistentVolumeSource_To_v1_StorageOSPersistentVolumeSource(in, out, s) -} - -func autoConvert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in *v1.StorageOSVolumeSource, out *core.StorageOSVolumeSource, s conversion.Scope) error { - out.VolumeName = in.VolumeName - out.VolumeNamespace = in.VolumeNamespace - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*core.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource is an autogenerated conversion function. -func Convert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in *v1.StorageOSVolumeSource, out *core.StorageOSVolumeSource, s conversion.Scope) error { - return autoConvert_v1_StorageOSVolumeSource_To_core_StorageOSVolumeSource(in, out, s) -} - -func autoConvert_core_StorageOSVolumeSource_To_v1_StorageOSVolumeSource(in *core.StorageOSVolumeSource, out *v1.StorageOSVolumeSource, s conversion.Scope) error { - out.VolumeName = in.VolumeName - out.VolumeNamespace = in.VolumeNamespace - out.FSType = in.FSType - out.ReadOnly = in.ReadOnly - out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef)) - return nil -} - -// Convert_core_StorageOSVolumeSource_To_v1_StorageOSVolumeSource is an autogenerated conversion function. -func Convert_core_StorageOSVolumeSource_To_v1_StorageOSVolumeSource(in *core.StorageOSVolumeSource, out *v1.StorageOSVolumeSource, s conversion.Scope) error { - return autoConvert_core_StorageOSVolumeSource_To_v1_StorageOSVolumeSource(in, out, s) -} - -func autoConvert_v1_Sysctl_To_core_Sysctl(in *v1.Sysctl, out *core.Sysctl, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - return nil -} - -// Convert_v1_Sysctl_To_core_Sysctl is an autogenerated conversion function. -func Convert_v1_Sysctl_To_core_Sysctl(in *v1.Sysctl, out *core.Sysctl, s conversion.Scope) error { - return autoConvert_v1_Sysctl_To_core_Sysctl(in, out, s) -} - -func autoConvert_core_Sysctl_To_v1_Sysctl(in *core.Sysctl, out *v1.Sysctl, s conversion.Scope) error { - out.Name = in.Name - out.Value = in.Value - return nil -} - -// Convert_core_Sysctl_To_v1_Sysctl is an autogenerated conversion function. -func Convert_core_Sysctl_To_v1_Sysctl(in *core.Sysctl, out *v1.Sysctl, s conversion.Scope) error { - return autoConvert_core_Sysctl_To_v1_Sysctl(in, out, s) -} - -func autoConvert_v1_TCPSocketAction_To_core_TCPSocketAction(in *v1.TCPSocketAction, out *core.TCPSocketAction, s conversion.Scope) error { - out.Port = in.Port - out.Host = in.Host - return nil -} - -// Convert_v1_TCPSocketAction_To_core_TCPSocketAction is an autogenerated conversion function. -func Convert_v1_TCPSocketAction_To_core_TCPSocketAction(in *v1.TCPSocketAction, out *core.TCPSocketAction, s conversion.Scope) error { - return autoConvert_v1_TCPSocketAction_To_core_TCPSocketAction(in, out, s) -} - -func autoConvert_core_TCPSocketAction_To_v1_TCPSocketAction(in *core.TCPSocketAction, out *v1.TCPSocketAction, s conversion.Scope) error { - out.Port = in.Port - out.Host = in.Host - return nil -} - -// Convert_core_TCPSocketAction_To_v1_TCPSocketAction is an autogenerated conversion function. -func Convert_core_TCPSocketAction_To_v1_TCPSocketAction(in *core.TCPSocketAction, out *v1.TCPSocketAction, s conversion.Scope) error { - return autoConvert_core_TCPSocketAction_To_v1_TCPSocketAction(in, out, s) -} - -func autoConvert_v1_Taint_To_core_Taint(in *v1.Taint, out *core.Taint, s conversion.Scope) error { - out.Key = in.Key - out.Value = in.Value - out.Effect = core.TaintEffect(in.Effect) - out.TimeAdded = (*metav1.Time)(unsafe.Pointer(in.TimeAdded)) - return nil -} - -// Convert_v1_Taint_To_core_Taint is an autogenerated conversion function. -func Convert_v1_Taint_To_core_Taint(in *v1.Taint, out *core.Taint, s conversion.Scope) error { - return autoConvert_v1_Taint_To_core_Taint(in, out, s) -} - -func autoConvert_core_Taint_To_v1_Taint(in *core.Taint, out *v1.Taint, s conversion.Scope) error { - out.Key = in.Key - out.Value = in.Value - out.Effect = v1.TaintEffect(in.Effect) - out.TimeAdded = (*metav1.Time)(unsafe.Pointer(in.TimeAdded)) - return nil -} - -// Convert_core_Taint_To_v1_Taint is an autogenerated conversion function. -func Convert_core_Taint_To_v1_Taint(in *core.Taint, out *v1.Taint, s conversion.Scope) error { - return autoConvert_core_Taint_To_v1_Taint(in, out, s) -} - -func autoConvert_v1_Toleration_To_core_Toleration(in *v1.Toleration, out *core.Toleration, s conversion.Scope) error { - out.Key = in.Key - out.Operator = core.TolerationOperator(in.Operator) - out.Value = in.Value - out.Effect = core.TaintEffect(in.Effect) - out.TolerationSeconds = (*int64)(unsafe.Pointer(in.TolerationSeconds)) - return nil -} - -// Convert_v1_Toleration_To_core_Toleration is an autogenerated conversion function. -func Convert_v1_Toleration_To_core_Toleration(in *v1.Toleration, out *core.Toleration, s conversion.Scope) error { - return autoConvert_v1_Toleration_To_core_Toleration(in, out, s) -} - -func autoConvert_core_Toleration_To_v1_Toleration(in *core.Toleration, out *v1.Toleration, s conversion.Scope) error { - out.Key = in.Key - out.Operator = v1.TolerationOperator(in.Operator) - out.Value = in.Value - out.Effect = v1.TaintEffect(in.Effect) - out.TolerationSeconds = (*int64)(unsafe.Pointer(in.TolerationSeconds)) - return nil -} - -// Convert_core_Toleration_To_v1_Toleration is an autogenerated conversion function. -func Convert_core_Toleration_To_v1_Toleration(in *core.Toleration, out *v1.Toleration, s conversion.Scope) error { - return autoConvert_core_Toleration_To_v1_Toleration(in, out, s) -} - -func autoConvert_v1_TopologySelectorLabelRequirement_To_core_TopologySelectorLabelRequirement(in *v1.TopologySelectorLabelRequirement, out *core.TopologySelectorLabelRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_v1_TopologySelectorLabelRequirement_To_core_TopologySelectorLabelRequirement is an autogenerated conversion function. -func Convert_v1_TopologySelectorLabelRequirement_To_core_TopologySelectorLabelRequirement(in *v1.TopologySelectorLabelRequirement, out *core.TopologySelectorLabelRequirement, s conversion.Scope) error { - return autoConvert_v1_TopologySelectorLabelRequirement_To_core_TopologySelectorLabelRequirement(in, out, s) -} - -func autoConvert_core_TopologySelectorLabelRequirement_To_v1_TopologySelectorLabelRequirement(in *core.TopologySelectorLabelRequirement, out *v1.TopologySelectorLabelRequirement, s conversion.Scope) error { - out.Key = in.Key - out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) - return nil -} - -// Convert_core_TopologySelectorLabelRequirement_To_v1_TopologySelectorLabelRequirement is an autogenerated conversion function. -func Convert_core_TopologySelectorLabelRequirement_To_v1_TopologySelectorLabelRequirement(in *core.TopologySelectorLabelRequirement, out *v1.TopologySelectorLabelRequirement, s conversion.Scope) error { - return autoConvert_core_TopologySelectorLabelRequirement_To_v1_TopologySelectorLabelRequirement(in, out, s) -} - -func autoConvert_v1_TopologySelectorTerm_To_core_TopologySelectorTerm(in *v1.TopologySelectorTerm, out *core.TopologySelectorTerm, s conversion.Scope) error { - out.MatchLabelExpressions = *(*[]core.TopologySelectorLabelRequirement)(unsafe.Pointer(&in.MatchLabelExpressions)) - return nil -} - -// Convert_v1_TopologySelectorTerm_To_core_TopologySelectorTerm is an autogenerated conversion function. -func Convert_v1_TopologySelectorTerm_To_core_TopologySelectorTerm(in *v1.TopologySelectorTerm, out *core.TopologySelectorTerm, s conversion.Scope) error { - return autoConvert_v1_TopologySelectorTerm_To_core_TopologySelectorTerm(in, out, s) -} - -func autoConvert_core_TopologySelectorTerm_To_v1_TopologySelectorTerm(in *core.TopologySelectorTerm, out *v1.TopologySelectorTerm, s conversion.Scope) error { - out.MatchLabelExpressions = *(*[]v1.TopologySelectorLabelRequirement)(unsafe.Pointer(&in.MatchLabelExpressions)) - return nil -} - -// Convert_core_TopologySelectorTerm_To_v1_TopologySelectorTerm is an autogenerated conversion function. -func Convert_core_TopologySelectorTerm_To_v1_TopologySelectorTerm(in *core.TopologySelectorTerm, out *v1.TopologySelectorTerm, s conversion.Scope) error { - return autoConvert_core_TopologySelectorTerm_To_v1_TopologySelectorTerm(in, out, s) -} - -func autoConvert_v1_TopologySpreadConstraint_To_core_TopologySpreadConstraint(in *v1.TopologySpreadConstraint, out *core.TopologySpreadConstraint, s conversion.Scope) error { - out.MaxSkew = in.MaxSkew - out.TopologyKey = in.TopologyKey - out.WhenUnsatisfiable = core.UnsatisfiableConstraintAction(in.WhenUnsatisfiable) - out.LabelSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.LabelSelector)) - out.MinDomains = (*int32)(unsafe.Pointer(in.MinDomains)) - out.NodeAffinityPolicy = (*core.NodeInclusionPolicy)(unsafe.Pointer(in.NodeAffinityPolicy)) - out.NodeTaintsPolicy = (*core.NodeInclusionPolicy)(unsafe.Pointer(in.NodeTaintsPolicy)) - out.MatchLabelKeys = *(*[]string)(unsafe.Pointer(&in.MatchLabelKeys)) - return nil -} - -// Convert_v1_TopologySpreadConstraint_To_core_TopologySpreadConstraint is an autogenerated conversion function. -func Convert_v1_TopologySpreadConstraint_To_core_TopologySpreadConstraint(in *v1.TopologySpreadConstraint, out *core.TopologySpreadConstraint, s conversion.Scope) error { - return autoConvert_v1_TopologySpreadConstraint_To_core_TopologySpreadConstraint(in, out, s) -} - -func autoConvert_core_TopologySpreadConstraint_To_v1_TopologySpreadConstraint(in *core.TopologySpreadConstraint, out *v1.TopologySpreadConstraint, s conversion.Scope) error { - out.MaxSkew = in.MaxSkew - out.TopologyKey = in.TopologyKey - out.WhenUnsatisfiable = v1.UnsatisfiableConstraintAction(in.WhenUnsatisfiable) - out.LabelSelector = (*metav1.LabelSelector)(unsafe.Pointer(in.LabelSelector)) - out.MinDomains = (*int32)(unsafe.Pointer(in.MinDomains)) - out.NodeAffinityPolicy = (*v1.NodeInclusionPolicy)(unsafe.Pointer(in.NodeAffinityPolicy)) - out.NodeTaintsPolicy = (*v1.NodeInclusionPolicy)(unsafe.Pointer(in.NodeTaintsPolicy)) - out.MatchLabelKeys = *(*[]string)(unsafe.Pointer(&in.MatchLabelKeys)) - return nil -} - -// Convert_core_TopologySpreadConstraint_To_v1_TopologySpreadConstraint is an autogenerated conversion function. -func Convert_core_TopologySpreadConstraint_To_v1_TopologySpreadConstraint(in *core.TopologySpreadConstraint, out *v1.TopologySpreadConstraint, s conversion.Scope) error { - return autoConvert_core_TopologySpreadConstraint_To_v1_TopologySpreadConstraint(in, out, s) -} - -func autoConvert_v1_TypedLocalObjectReference_To_core_TypedLocalObjectReference(in *v1.TypedLocalObjectReference, out *core.TypedLocalObjectReference, s conversion.Scope) error { - out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) - out.Kind = in.Kind - out.Name = in.Name - return nil -} - -// Convert_v1_TypedLocalObjectReference_To_core_TypedLocalObjectReference is an autogenerated conversion function. -func Convert_v1_TypedLocalObjectReference_To_core_TypedLocalObjectReference(in *v1.TypedLocalObjectReference, out *core.TypedLocalObjectReference, s conversion.Scope) error { - return autoConvert_v1_TypedLocalObjectReference_To_core_TypedLocalObjectReference(in, out, s) -} - -func autoConvert_core_TypedLocalObjectReference_To_v1_TypedLocalObjectReference(in *core.TypedLocalObjectReference, out *v1.TypedLocalObjectReference, s conversion.Scope) error { - out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) - out.Kind = in.Kind - out.Name = in.Name - return nil -} - -// Convert_core_TypedLocalObjectReference_To_v1_TypedLocalObjectReference is an autogenerated conversion function. -func Convert_core_TypedLocalObjectReference_To_v1_TypedLocalObjectReference(in *core.TypedLocalObjectReference, out *v1.TypedLocalObjectReference, s conversion.Scope) error { - return autoConvert_core_TypedLocalObjectReference_To_v1_TypedLocalObjectReference(in, out, s) -} - -func autoConvert_v1_TypedObjectReference_To_core_TypedObjectReference(in *v1.TypedObjectReference, out *core.TypedObjectReference, s conversion.Scope) error { - out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) - out.Kind = in.Kind - out.Name = in.Name - out.Namespace = (*string)(unsafe.Pointer(in.Namespace)) - return nil -} - -// Convert_v1_TypedObjectReference_To_core_TypedObjectReference is an autogenerated conversion function. -func Convert_v1_TypedObjectReference_To_core_TypedObjectReference(in *v1.TypedObjectReference, out *core.TypedObjectReference, s conversion.Scope) error { - return autoConvert_v1_TypedObjectReference_To_core_TypedObjectReference(in, out, s) -} - -func autoConvert_core_TypedObjectReference_To_v1_TypedObjectReference(in *core.TypedObjectReference, out *v1.TypedObjectReference, s conversion.Scope) error { - out.APIGroup = (*string)(unsafe.Pointer(in.APIGroup)) - out.Kind = in.Kind - out.Name = in.Name - out.Namespace = (*string)(unsafe.Pointer(in.Namespace)) - return nil -} - -// Convert_core_TypedObjectReference_To_v1_TypedObjectReference is an autogenerated conversion function. -func Convert_core_TypedObjectReference_To_v1_TypedObjectReference(in *core.TypedObjectReference, out *v1.TypedObjectReference, s conversion.Scope) error { - return autoConvert_core_TypedObjectReference_To_v1_TypedObjectReference(in, out, s) -} - -func autoConvert_v1_Volume_To_core_Volume(in *v1.Volume, out *core.Volume, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1_VolumeSource_To_core_VolumeSource(&in.VolumeSource, &out.VolumeSource, s); err != nil { - return err - } - return nil -} - -func autoConvert_core_Volume_To_v1_Volume(in *core.Volume, out *v1.Volume, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_core_VolumeSource_To_v1_VolumeSource(&in.VolumeSource, &out.VolumeSource, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1_VolumeDevice_To_core_VolumeDevice(in *v1.VolumeDevice, out *core.VolumeDevice, s conversion.Scope) error { - out.Name = in.Name - out.DevicePath = in.DevicePath - return nil -} - -// Convert_v1_VolumeDevice_To_core_VolumeDevice is an autogenerated conversion function. -func Convert_v1_VolumeDevice_To_core_VolumeDevice(in *v1.VolumeDevice, out *core.VolumeDevice, s conversion.Scope) error { - return autoConvert_v1_VolumeDevice_To_core_VolumeDevice(in, out, s) -} - -func autoConvert_core_VolumeDevice_To_v1_VolumeDevice(in *core.VolumeDevice, out *v1.VolumeDevice, s conversion.Scope) error { - out.Name = in.Name - out.DevicePath = in.DevicePath - return nil -} - -// Convert_core_VolumeDevice_To_v1_VolumeDevice is an autogenerated conversion function. -func Convert_core_VolumeDevice_To_v1_VolumeDevice(in *core.VolumeDevice, out *v1.VolumeDevice, s conversion.Scope) error { - return autoConvert_core_VolumeDevice_To_v1_VolumeDevice(in, out, s) -} - -func autoConvert_v1_VolumeMount_To_core_VolumeMount(in *v1.VolumeMount, out *core.VolumeMount, s conversion.Scope) error { - out.Name = in.Name - out.ReadOnly = in.ReadOnly - out.MountPath = in.MountPath - out.SubPath = in.SubPath - out.MountPropagation = (*core.MountPropagationMode)(unsafe.Pointer(in.MountPropagation)) - out.SubPathExpr = in.SubPathExpr - return nil -} - -// Convert_v1_VolumeMount_To_core_VolumeMount is an autogenerated conversion function. -func Convert_v1_VolumeMount_To_core_VolumeMount(in *v1.VolumeMount, out *core.VolumeMount, s conversion.Scope) error { - return autoConvert_v1_VolumeMount_To_core_VolumeMount(in, out, s) -} - -func autoConvert_core_VolumeMount_To_v1_VolumeMount(in *core.VolumeMount, out *v1.VolumeMount, s conversion.Scope) error { - out.Name = in.Name - out.ReadOnly = in.ReadOnly - out.MountPath = in.MountPath - out.SubPath = in.SubPath - out.MountPropagation = (*v1.MountPropagationMode)(unsafe.Pointer(in.MountPropagation)) - out.SubPathExpr = in.SubPathExpr - return nil -} - -// Convert_core_VolumeMount_To_v1_VolumeMount is an autogenerated conversion function. -func Convert_core_VolumeMount_To_v1_VolumeMount(in *core.VolumeMount, out *v1.VolumeMount, s conversion.Scope) error { - return autoConvert_core_VolumeMount_To_v1_VolumeMount(in, out, s) -} - -func autoConvert_v1_VolumeNodeAffinity_To_core_VolumeNodeAffinity(in *v1.VolumeNodeAffinity, out *core.VolumeNodeAffinity, s conversion.Scope) error { - out.Required = (*core.NodeSelector)(unsafe.Pointer(in.Required)) - return nil -} - -// Convert_v1_VolumeNodeAffinity_To_core_VolumeNodeAffinity is an autogenerated conversion function. -func Convert_v1_VolumeNodeAffinity_To_core_VolumeNodeAffinity(in *v1.VolumeNodeAffinity, out *core.VolumeNodeAffinity, s conversion.Scope) error { - return autoConvert_v1_VolumeNodeAffinity_To_core_VolumeNodeAffinity(in, out, s) -} - -func autoConvert_core_VolumeNodeAffinity_To_v1_VolumeNodeAffinity(in *core.VolumeNodeAffinity, out *v1.VolumeNodeAffinity, s conversion.Scope) error { - out.Required = (*v1.NodeSelector)(unsafe.Pointer(in.Required)) - return nil -} - -// Convert_core_VolumeNodeAffinity_To_v1_VolumeNodeAffinity is an autogenerated conversion function. -func Convert_core_VolumeNodeAffinity_To_v1_VolumeNodeAffinity(in *core.VolumeNodeAffinity, out *v1.VolumeNodeAffinity, s conversion.Scope) error { - return autoConvert_core_VolumeNodeAffinity_To_v1_VolumeNodeAffinity(in, out, s) -} - -func autoConvert_v1_VolumeProjection_To_core_VolumeProjection(in *v1.VolumeProjection, out *core.VolumeProjection, s conversion.Scope) error { - out.Secret = (*core.SecretProjection)(unsafe.Pointer(in.Secret)) - out.DownwardAPI = (*core.DownwardAPIProjection)(unsafe.Pointer(in.DownwardAPI)) - out.ConfigMap = (*core.ConfigMapProjection)(unsafe.Pointer(in.ConfigMap)) - if in.ServiceAccountToken != nil { - in, out := &in.ServiceAccountToken, &out.ServiceAccountToken - *out = new(core.ServiceAccountTokenProjection) - if err := Convert_v1_ServiceAccountTokenProjection_To_core_ServiceAccountTokenProjection(*in, *out, s); err != nil { - return err - } - } else { - out.ServiceAccountToken = nil - } - out.ClusterTrustBundle = (*core.ClusterTrustBundleProjection)(unsafe.Pointer(in.ClusterTrustBundle)) - return nil -} - -// Convert_v1_VolumeProjection_To_core_VolumeProjection is an autogenerated conversion function. -func Convert_v1_VolumeProjection_To_core_VolumeProjection(in *v1.VolumeProjection, out *core.VolumeProjection, s conversion.Scope) error { - return autoConvert_v1_VolumeProjection_To_core_VolumeProjection(in, out, s) -} - -func autoConvert_core_VolumeProjection_To_v1_VolumeProjection(in *core.VolumeProjection, out *v1.VolumeProjection, s conversion.Scope) error { - out.Secret = (*v1.SecretProjection)(unsafe.Pointer(in.Secret)) - out.DownwardAPI = (*v1.DownwardAPIProjection)(unsafe.Pointer(in.DownwardAPI)) - out.ConfigMap = (*v1.ConfigMapProjection)(unsafe.Pointer(in.ConfigMap)) - if in.ServiceAccountToken != nil { - in, out := &in.ServiceAccountToken, &out.ServiceAccountToken - *out = new(v1.ServiceAccountTokenProjection) - if err := Convert_core_ServiceAccountTokenProjection_To_v1_ServiceAccountTokenProjection(*in, *out, s); err != nil { - return err - } - } else { - out.ServiceAccountToken = nil - } - out.ClusterTrustBundle = (*v1.ClusterTrustBundleProjection)(unsafe.Pointer(in.ClusterTrustBundle)) - return nil -} - -// Convert_core_VolumeProjection_To_v1_VolumeProjection is an autogenerated conversion function. -func Convert_core_VolumeProjection_To_v1_VolumeProjection(in *core.VolumeProjection, out *v1.VolumeProjection, s conversion.Scope) error { - return autoConvert_core_VolumeProjection_To_v1_VolumeProjection(in, out, s) -} - -func autoConvert_v1_VolumeResourceRequirements_To_core_VolumeResourceRequirements(in *v1.VolumeResourceRequirements, out *core.VolumeResourceRequirements, s conversion.Scope) error { - out.Limits = *(*core.ResourceList)(unsafe.Pointer(&in.Limits)) - out.Requests = *(*core.ResourceList)(unsafe.Pointer(&in.Requests)) - return nil -} - -// Convert_v1_VolumeResourceRequirements_To_core_VolumeResourceRequirements is an autogenerated conversion function. -func Convert_v1_VolumeResourceRequirements_To_core_VolumeResourceRequirements(in *v1.VolumeResourceRequirements, out *core.VolumeResourceRequirements, s conversion.Scope) error { - return autoConvert_v1_VolumeResourceRequirements_To_core_VolumeResourceRequirements(in, out, s) -} - -func autoConvert_core_VolumeResourceRequirements_To_v1_VolumeResourceRequirements(in *core.VolumeResourceRequirements, out *v1.VolumeResourceRequirements, s conversion.Scope) error { - out.Limits = *(*v1.ResourceList)(unsafe.Pointer(&in.Limits)) - out.Requests = *(*v1.ResourceList)(unsafe.Pointer(&in.Requests)) - return nil -} - -// Convert_core_VolumeResourceRequirements_To_v1_VolumeResourceRequirements is an autogenerated conversion function. -func Convert_core_VolumeResourceRequirements_To_v1_VolumeResourceRequirements(in *core.VolumeResourceRequirements, out *v1.VolumeResourceRequirements, s conversion.Scope) error { - return autoConvert_core_VolumeResourceRequirements_To_v1_VolumeResourceRequirements(in, out, s) -} - -func autoConvert_v1_VolumeSource_To_core_VolumeSource(in *v1.VolumeSource, out *core.VolumeSource, s conversion.Scope) error { - out.HostPath = (*core.HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) - out.EmptyDir = (*core.EmptyDirVolumeSource)(unsafe.Pointer(in.EmptyDir)) - out.GCEPersistentDisk = (*core.GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) - out.AWSElasticBlockStore = (*core.AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) - out.GitRepo = (*core.GitRepoVolumeSource)(unsafe.Pointer(in.GitRepo)) - out.Secret = (*core.SecretVolumeSource)(unsafe.Pointer(in.Secret)) - out.NFS = (*core.NFSVolumeSource)(unsafe.Pointer(in.NFS)) - out.ISCSI = (*core.ISCSIVolumeSource)(unsafe.Pointer(in.ISCSI)) - out.Glusterfs = (*core.GlusterfsVolumeSource)(unsafe.Pointer(in.Glusterfs)) - out.PersistentVolumeClaim = (*core.PersistentVolumeClaimVolumeSource)(unsafe.Pointer(in.PersistentVolumeClaim)) - out.RBD = (*core.RBDVolumeSource)(unsafe.Pointer(in.RBD)) - out.FlexVolume = (*core.FlexVolumeSource)(unsafe.Pointer(in.FlexVolume)) - out.Cinder = (*core.CinderVolumeSource)(unsafe.Pointer(in.Cinder)) - out.CephFS = (*core.CephFSVolumeSource)(unsafe.Pointer(in.CephFS)) - out.Flocker = (*core.FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) - out.DownwardAPI = (*core.DownwardAPIVolumeSource)(unsafe.Pointer(in.DownwardAPI)) - out.FC = (*core.FCVolumeSource)(unsafe.Pointer(in.FC)) - out.AzureFile = (*core.AzureFileVolumeSource)(unsafe.Pointer(in.AzureFile)) - out.ConfigMap = (*core.ConfigMapVolumeSource)(unsafe.Pointer(in.ConfigMap)) - out.VsphereVolume = (*core.VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) - out.Quobyte = (*core.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) - out.AzureDisk = (*core.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) - out.PhotonPersistentDisk = (*core.PhotonPersistentDiskVolumeSource)(unsafe.Pointer(in.PhotonPersistentDisk)) - if in.Projected != nil { - in, out := &in.Projected, &out.Projected - *out = new(core.ProjectedVolumeSource) - if err := Convert_v1_ProjectedVolumeSource_To_core_ProjectedVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Projected = nil - } - out.PortworxVolume = (*core.PortworxVolumeSource)(unsafe.Pointer(in.PortworxVolume)) - out.ScaleIO = (*core.ScaleIOVolumeSource)(unsafe.Pointer(in.ScaleIO)) - out.StorageOS = (*core.StorageOSVolumeSource)(unsafe.Pointer(in.StorageOS)) - out.CSI = (*core.CSIVolumeSource)(unsafe.Pointer(in.CSI)) - out.Ephemeral = (*core.EphemeralVolumeSource)(unsafe.Pointer(in.Ephemeral)) - return nil -} - -// Convert_v1_VolumeSource_To_core_VolumeSource is an autogenerated conversion function. -func Convert_v1_VolumeSource_To_core_VolumeSource(in *v1.VolumeSource, out *core.VolumeSource, s conversion.Scope) error { - return autoConvert_v1_VolumeSource_To_core_VolumeSource(in, out, s) -} - -func autoConvert_core_VolumeSource_To_v1_VolumeSource(in *core.VolumeSource, out *v1.VolumeSource, s conversion.Scope) error { - out.HostPath = (*v1.HostPathVolumeSource)(unsafe.Pointer(in.HostPath)) - out.EmptyDir = (*v1.EmptyDirVolumeSource)(unsafe.Pointer(in.EmptyDir)) - out.GCEPersistentDisk = (*v1.GCEPersistentDiskVolumeSource)(unsafe.Pointer(in.GCEPersistentDisk)) - out.AWSElasticBlockStore = (*v1.AWSElasticBlockStoreVolumeSource)(unsafe.Pointer(in.AWSElasticBlockStore)) - out.GitRepo = (*v1.GitRepoVolumeSource)(unsafe.Pointer(in.GitRepo)) - out.Secret = (*v1.SecretVolumeSource)(unsafe.Pointer(in.Secret)) - out.NFS = (*v1.NFSVolumeSource)(unsafe.Pointer(in.NFS)) - out.ISCSI = (*v1.ISCSIVolumeSource)(unsafe.Pointer(in.ISCSI)) - out.Glusterfs = (*v1.GlusterfsVolumeSource)(unsafe.Pointer(in.Glusterfs)) - out.PersistentVolumeClaim = (*v1.PersistentVolumeClaimVolumeSource)(unsafe.Pointer(in.PersistentVolumeClaim)) - out.RBD = (*v1.RBDVolumeSource)(unsafe.Pointer(in.RBD)) - out.Quobyte = (*v1.QuobyteVolumeSource)(unsafe.Pointer(in.Quobyte)) - out.FlexVolume = (*v1.FlexVolumeSource)(unsafe.Pointer(in.FlexVolume)) - out.Cinder = (*v1.CinderVolumeSource)(unsafe.Pointer(in.Cinder)) - out.CephFS = (*v1.CephFSVolumeSource)(unsafe.Pointer(in.CephFS)) - out.Flocker = (*v1.FlockerVolumeSource)(unsafe.Pointer(in.Flocker)) - out.DownwardAPI = (*v1.DownwardAPIVolumeSource)(unsafe.Pointer(in.DownwardAPI)) - out.FC = (*v1.FCVolumeSource)(unsafe.Pointer(in.FC)) - out.AzureFile = (*v1.AzureFileVolumeSource)(unsafe.Pointer(in.AzureFile)) - out.ConfigMap = (*v1.ConfigMapVolumeSource)(unsafe.Pointer(in.ConfigMap)) - out.VsphereVolume = (*v1.VsphereVirtualDiskVolumeSource)(unsafe.Pointer(in.VsphereVolume)) - out.AzureDisk = (*v1.AzureDiskVolumeSource)(unsafe.Pointer(in.AzureDisk)) - out.PhotonPersistentDisk = (*v1.PhotonPersistentDiskVolumeSource)(unsafe.Pointer(in.PhotonPersistentDisk)) - if in.Projected != nil { - in, out := &in.Projected, &out.Projected - *out = new(v1.ProjectedVolumeSource) - if err := Convert_core_ProjectedVolumeSource_To_v1_ProjectedVolumeSource(*in, *out, s); err != nil { - return err - } - } else { - out.Projected = nil - } - out.PortworxVolume = (*v1.PortworxVolumeSource)(unsafe.Pointer(in.PortworxVolume)) - out.ScaleIO = (*v1.ScaleIOVolumeSource)(unsafe.Pointer(in.ScaleIO)) - out.StorageOS = (*v1.StorageOSVolumeSource)(unsafe.Pointer(in.StorageOS)) - out.CSI = (*v1.CSIVolumeSource)(unsafe.Pointer(in.CSI)) - out.Ephemeral = (*v1.EphemeralVolumeSource)(unsafe.Pointer(in.Ephemeral)) - return nil -} - -// Convert_core_VolumeSource_To_v1_VolumeSource is an autogenerated conversion function. -func Convert_core_VolumeSource_To_v1_VolumeSource(in *core.VolumeSource, out *v1.VolumeSource, s conversion.Scope) error { - return autoConvert_core_VolumeSource_To_v1_VolumeSource(in, out, s) -} - -func autoConvert_v1_VsphereVirtualDiskVolumeSource_To_core_VsphereVirtualDiskVolumeSource(in *v1.VsphereVirtualDiskVolumeSource, out *core.VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - out.VolumePath = in.VolumePath - out.FSType = in.FSType - out.StoragePolicyName = in.StoragePolicyName - out.StoragePolicyID = in.StoragePolicyID - return nil -} - -// Convert_v1_VsphereVirtualDiskVolumeSource_To_core_VsphereVirtualDiskVolumeSource is an autogenerated conversion function. -func Convert_v1_VsphereVirtualDiskVolumeSource_To_core_VsphereVirtualDiskVolumeSource(in *v1.VsphereVirtualDiskVolumeSource, out *core.VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - return autoConvert_v1_VsphereVirtualDiskVolumeSource_To_core_VsphereVirtualDiskVolumeSource(in, out, s) -} - -func autoConvert_core_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(in *core.VsphereVirtualDiskVolumeSource, out *v1.VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - out.VolumePath = in.VolumePath - out.FSType = in.FSType - out.StoragePolicyName = in.StoragePolicyName - out.StoragePolicyID = in.StoragePolicyID - return nil -} - -// Convert_core_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource is an autogenerated conversion function. -func Convert_core_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(in *core.VsphereVirtualDiskVolumeSource, out *v1.VsphereVirtualDiskVolumeSource, s conversion.Scope) error { - return autoConvert_core_VsphereVirtualDiskVolumeSource_To_v1_VsphereVirtualDiskVolumeSource(in, out, s) -} - -func autoConvert_v1_WeightedPodAffinityTerm_To_core_WeightedPodAffinityTerm(in *v1.WeightedPodAffinityTerm, out *core.WeightedPodAffinityTerm, s conversion.Scope) error { - out.Weight = in.Weight - if err := Convert_v1_PodAffinityTerm_To_core_PodAffinityTerm(&in.PodAffinityTerm, &out.PodAffinityTerm, s); err != nil { - return err - } - return nil -} - -// Convert_v1_WeightedPodAffinityTerm_To_core_WeightedPodAffinityTerm is an autogenerated conversion function. -func Convert_v1_WeightedPodAffinityTerm_To_core_WeightedPodAffinityTerm(in *v1.WeightedPodAffinityTerm, out *core.WeightedPodAffinityTerm, s conversion.Scope) error { - return autoConvert_v1_WeightedPodAffinityTerm_To_core_WeightedPodAffinityTerm(in, out, s) -} - -func autoConvert_core_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(in *core.WeightedPodAffinityTerm, out *v1.WeightedPodAffinityTerm, s conversion.Scope) error { - out.Weight = in.Weight - if err := Convert_core_PodAffinityTerm_To_v1_PodAffinityTerm(&in.PodAffinityTerm, &out.PodAffinityTerm, s); err != nil { - return err - } - return nil -} - -// Convert_core_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm is an autogenerated conversion function. -func Convert_core_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(in *core.WeightedPodAffinityTerm, out *v1.WeightedPodAffinityTerm, s conversion.Scope) error { - return autoConvert_core_WeightedPodAffinityTerm_To_v1_WeightedPodAffinityTerm(in, out, s) -} - -func autoConvert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContextOptions(in *v1.WindowsSecurityContextOptions, out *core.WindowsSecurityContextOptions, s conversion.Scope) error { - out.GMSACredentialSpecName = (*string)(unsafe.Pointer(in.GMSACredentialSpecName)) - out.GMSACredentialSpec = (*string)(unsafe.Pointer(in.GMSACredentialSpec)) - out.RunAsUserName = (*string)(unsafe.Pointer(in.RunAsUserName)) - out.HostProcess = (*bool)(unsafe.Pointer(in.HostProcess)) - return nil -} - -// Convert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContextOptions is an autogenerated conversion function. -func Convert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContextOptions(in *v1.WindowsSecurityContextOptions, out *core.WindowsSecurityContextOptions, s conversion.Scope) error { - return autoConvert_v1_WindowsSecurityContextOptions_To_core_WindowsSecurityContextOptions(in, out, s) -} - -func autoConvert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContextOptions(in *core.WindowsSecurityContextOptions, out *v1.WindowsSecurityContextOptions, s conversion.Scope) error { - out.GMSACredentialSpecName = (*string)(unsafe.Pointer(in.GMSACredentialSpecName)) - out.GMSACredentialSpec = (*string)(unsafe.Pointer(in.GMSACredentialSpec)) - out.RunAsUserName = (*string)(unsafe.Pointer(in.RunAsUserName)) - out.HostProcess = (*bool)(unsafe.Pointer(in.HostProcess)) - return nil -} - -// Convert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContextOptions is an autogenerated conversion function. -func Convert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContextOptions(in *core.WindowsSecurityContextOptions, out *v1.WindowsSecurityContextOptions, s conversion.Scope) error { - return autoConvert_core_WindowsSecurityContextOptions_To_v1_WindowsSecurityContextOptions(in, out, s) -} diff --git a/pkg/apis/core/v1/zz_generated.defaults.go b/pkg/apis/core/v1/zz_generated.defaults.go deleted file mode 100644 index 0be517dd9e1..00000000000 --- a/pkg/apis/core/v1/zz_generated.defaults.go +++ /dev/null @@ -1,378 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/onex. - -// Code generated by defaulter-gen. DO NOT EDIT. - -package v1 - -import ( - v1 "k8s.io/api/core/v1" - 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 { - scheme.AddTypeDefaultingFunc(&v1.Pod{}, func(obj any) { SetObjectDefaults_Pod(obj.(*v1.Pod)) }) - scheme.AddTypeDefaultingFunc(&v1.PodList{}, func(obj any) { SetObjectDefaults_PodList(obj.(*v1.PodList)) }) - scheme.AddTypeDefaultingFunc(&v1.PodTemplate{}, func(obj any) { SetObjectDefaults_PodTemplate(obj.(*v1.PodTemplate)) }) - scheme.AddTypeDefaultingFunc(&v1.PodTemplateList{}, func(obj any) { SetObjectDefaults_PodTemplateList(obj.(*v1.PodTemplateList)) }) - scheme.AddTypeDefaultingFunc(&v1.ReplicationController{}, func(obj any) { SetObjectDefaults_ReplicationController(obj.(*v1.ReplicationController)) }) - scheme.AddTypeDefaultingFunc(&v1.ReplicationControllerList{}, func(obj any) { - SetObjectDefaults_ReplicationControllerList(obj.(*v1.ReplicationControllerList)) - }) - scheme.AddTypeDefaultingFunc(&v1.Service{}, func(obj any) { SetObjectDefaults_Service(obj.(*v1.Service)) }) - scheme.AddTypeDefaultingFunc(&v1.ServiceList{}, func(obj any) { SetObjectDefaults_ServiceList(obj.(*v1.ServiceList)) }) - return nil -} - -func SetObjectDefaults_Pod(in *v1.Pod) { - for i := range in.Spec.InitContainers { - a := &in.Spec.InitContainers[i] - for j := range a.Ports { - b := &a.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.LivenessProbe != nil { - if a.LivenessProbe.ProbeHandler.GRPC != nil { - if a.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.ReadinessProbe != nil { - if a.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.StartupProbe != nil { - if a.StartupProbe.ProbeHandler.GRPC != nil { - if a.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - for i := range in.Spec.Containers { - a := &in.Spec.Containers[i] - for j := range a.Ports { - b := &a.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.LivenessProbe != nil { - if a.LivenessProbe.ProbeHandler.GRPC != nil { - if a.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.ReadinessProbe != nil { - if a.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.StartupProbe != nil { - if a.StartupProbe.ProbeHandler.GRPC != nil { - if a.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - for i := range in.Spec.EphemeralContainers { - a := &in.Spec.EphemeralContainers[i] - for j := range a.EphemeralContainerCommon.Ports { - b := &a.EphemeralContainerCommon.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.EphemeralContainerCommon.LivenessProbe != nil { - if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.EphemeralContainerCommon.ReadinessProbe != nil { - if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.EphemeralContainerCommon.StartupProbe != nil { - if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } -} - -func SetObjectDefaults_PodList(in *v1.PodList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_Pod(a) - } -} - -func SetObjectDefaults_PodTemplate(in *v1.PodTemplate) { - for i := range in.Template.Spec.InitContainers { - a := &in.Template.Spec.InitContainers[i] - for j := range a.Ports { - b := &a.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.LivenessProbe != nil { - if a.LivenessProbe.ProbeHandler.GRPC != nil { - if a.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.ReadinessProbe != nil { - if a.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.StartupProbe != nil { - if a.StartupProbe.ProbeHandler.GRPC != nil { - if a.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - for i := range in.Template.Spec.Containers { - a := &in.Template.Spec.Containers[i] - for j := range a.Ports { - b := &a.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.LivenessProbe != nil { - if a.LivenessProbe.ProbeHandler.GRPC != nil { - if a.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.ReadinessProbe != nil { - if a.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.StartupProbe != nil { - if a.StartupProbe.ProbeHandler.GRPC != nil { - if a.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - for i := range in.Template.Spec.EphemeralContainers { - a := &in.Template.Spec.EphemeralContainers[i] - for j := range a.EphemeralContainerCommon.Ports { - b := &a.EphemeralContainerCommon.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.EphemeralContainerCommon.LivenessProbe != nil { - if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.EphemeralContainerCommon.ReadinessProbe != nil { - if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.EphemeralContainerCommon.StartupProbe != nil { - if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } -} - -func SetObjectDefaults_PodTemplateList(in *v1.PodTemplateList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_PodTemplate(a) - } -} - -func SetObjectDefaults_ReplicationController(in *v1.ReplicationController) { - if in.Spec.Template != nil { - for i := range in.Spec.Template.Spec.InitContainers { - a := &in.Spec.Template.Spec.InitContainers[i] - for j := range a.Ports { - b := &a.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.LivenessProbe != nil { - if a.LivenessProbe.ProbeHandler.GRPC != nil { - if a.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.ReadinessProbe != nil { - if a.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.StartupProbe != nil { - if a.StartupProbe.ProbeHandler.GRPC != nil { - if a.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - for i := range in.Spec.Template.Spec.Containers { - a := &in.Spec.Template.Spec.Containers[i] - for j := range a.Ports { - b := &a.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.LivenessProbe != nil { - if a.LivenessProbe.ProbeHandler.GRPC != nil { - if a.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.ReadinessProbe != nil { - if a.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.StartupProbe != nil { - if a.StartupProbe.ProbeHandler.GRPC != nil { - if a.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - for i := range in.Spec.Template.Spec.EphemeralContainers { - a := &in.Spec.Template.Spec.EphemeralContainers[i] - for j := range a.EphemeralContainerCommon.Ports { - b := &a.EphemeralContainerCommon.Ports[j] - if b.Protocol == "" { - b.Protocol = "TCP" - } - } - if a.EphemeralContainerCommon.LivenessProbe != nil { - if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.LivenessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.EphemeralContainerCommon.ReadinessProbe != nil { - if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.ReadinessProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - if a.EphemeralContainerCommon.StartupProbe != nil { - if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC != nil { - if a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service == nil { - var ptrVar1 string = "" - a.EphemeralContainerCommon.StartupProbe.ProbeHandler.GRPC.Service = &ptrVar1 - } - } - } - } - } -} - -func SetObjectDefaults_ReplicationControllerList(in *v1.ReplicationControllerList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_ReplicationController(a) - } -} - -func SetObjectDefaults_Service(in *v1.Service) { - for i := range in.Spec.Ports { - a := &in.Spec.Ports[i] - if a.Protocol == "" { - a.Protocol = "TCP" - } - } -} - -func SetObjectDefaults_ServiceList(in *v1.ServiceList) { - for i := range in.Items { - a := &in.Items[i] - SetObjectDefaults_Service(a) - } -} diff --git a/pkg/app/app.go b/pkg/app/app.go index d9482aae2f9..b8fd0d5f873 100644 --- a/pkg/app/app.go +++ b/pkg/app/app.go @@ -64,30 +64,30 @@ type Option func(*App) // WithOptions to open the application's function to read from the command line // or read parameters from the configuration file. func WithOptions(opts CliOptions) Option { - return func(a *App) { - a.options = opts + return func(app *App) { + app.options = opts } } // WithRunFunc is used to set the application startup callback function option. func WithRunFunc(run RunFunc) Option { - return func(a *App) { - a.run = run + return func(app *App) { + app.run = run } } // WithDescription is used to set the description of the application. func WithDescription(desc string) Option { - return func(a *App) { - a.description = desc + return func(app *App) { + app.description = desc } } -// WithHealthCheck is used to set the health check function for the application. +// WithHealthCheckFunc is used to set the health check function for the application. // The app framework will use the function to start a health check server. func WithHealthCheckFunc(fn HealthCheckFunc) Option { - return func(a *App) { - a.healthCheckFunc = fn + return func(app *App) { + app.healthCheckFunc = fn } } @@ -108,29 +108,29 @@ func WithDefaultHealthCheckFunc() Option { // information, configuration information, and version information are not // printed in the console. func WithSilence() Option { - return func(a *App) { - a.silence = true + return func(app *App) { + app.silence = true } } // WithNoConfig set the application does not provide config flag. func WithNoConfig() Option { - return func(a *App) { - a.noConfig = true + return func(app *App) { + app.noConfig = true } } // WithValidArgs set the validation function to valid non-flag arguments. func WithValidArgs(args cobra.PositionalArgs) Option { - return func(a *App) { - a.args = args + return func(app *App) { + app.args = args } } // WithDefaultValidArgs set default validation function to valid non-flag arguments. func WithDefaultValidArgs() Option { - return func(a *App) { - a.args = func(cmd *cobra.Command, args []string) error { + return func(app *App) { + app.args = func(cmd *cobra.Command, args []string) error { for _, arg := range args { if len(arg) > 0 { return fmt.Errorf("%q does not take any arguments, got %q", cmd.CommandPath(), args) @@ -144,40 +144,40 @@ func WithDefaultValidArgs() Option { // WithWatchConfig watching and re-reading config files. func WithWatchConfig() Option { - return func(a *App) { - a.watch = true + return func(app *App) { + app.watch = true } } // NewApp creates a new application instance based on the given application name, // binary name, and other options. func NewApp(name string, shortDesc string, opts ...Option) *App { - a := &App{ + app := &App{ name: name, run: func() error { return nil }, shortDesc: shortDesc, } for _, o := range opts { - o(a) + o(app) } - a.buildCommand() + app.buildCommand() - return a + return app } // buildCommand is used to build a cobra command. -func (a *App) buildCommand() { +func (app *App) buildCommand() { cmd := &cobra.Command{ - Use: formatBaseName(a.name), - Short: a.shortDesc, - Long: a.description, - RunE: a.runCommand, + Use: formatBaseName(app.name), + Short: app.shortDesc, + Long: app.description, + RunE: app.runCommand, PersistentPreRunE: func(*cobra.Command, []string) error { return nil }, - Args: a.args, + Args: app.args, } // When error printing is enabled for the Cobra command, a flag parse // error gets printed first, then optionally the often long usage @@ -208,14 +208,14 @@ func (a *App) buildCommand() { cmd.Flags().SortFlags = true var fss cliflag.NamedFlagSets - if a.options != nil { - fss = a.options.Flags() + if app.options != nil { + fss = app.options.Flags() } version.AddFlags(fss.FlagSet("global")) - if !a.noConfig { - AddConfigFlag(fss.FlagSet("global"), a.name, a.watch) + if !app.noConfig { + AddConfigFlag(fss.FlagSet("global"), app.name, app.watch) } for _, f := range fss.FlagSets { @@ -225,34 +225,34 @@ func (a *App) buildCommand() { cols, _, _ := term.TerminalSize(cmd.OutOrStdout()) cliflag.SetUsageAndHelpFunc(cmd, fss, cols) - a.cmd = cmd + app.cmd = cmd } // Run is used to launch the application. -func (a *App) Run() { - os.Exit(cli.Run(a.cmd)) +func (app *App) Run() { + os.Exit(cli.Run(app.cmd)) } -func (a *App) runCommand(cmd *cobra.Command, args []string) error { +func (app *App) runCommand(cmd *cobra.Command, args []string) error { // display application version information - version.PrintAndExitIfRequested(a.name) + version.PrintAndExitIfRequested(app.name) if err := viper.BindPFlags(cmd.Flags()); err != nil { return err } - if a.options != nil { - if err := viper.Unmarshal(a.options); err != nil { + if app.options != nil { + if err := viper.Unmarshal(app.options); err != nil { return err } // set default options - if err := a.options.Complete(); err != nil { + if err := app.options.Complete(); err != nil { return err } // validate options - if err := a.options.Validate(); err != nil { + if err := app.options.Validate(); err != nil { return err } } @@ -261,29 +261,29 @@ func (a *App) runCommand(cmd *cobra.Command, args []string) error { log.Init(logOptions()) defer log.Sync() // Sync 将缓存中的日志刷新到磁盘文件中 - if !a.silence { - log.Infow("Starting application", "name", a.name, "version", version.Get().ToJSON()) + if !app.silence { + log.Infow("Starting application", "name", app.name, "version", version.Get().ToJSON()) log.Infow("Golang settings", "GOGC", os.Getenv("GOGC"), "GOMAXPROCS", os.Getenv("GOMAXPROCS"), "GOTRACEBACK", os.Getenv("GOTRACEBACK")) - if !a.noConfig { + if !app.noConfig { PrintConfig() - } else if a.options != nil { + } else if app.options != nil { cliflag.PrintFlags(cmd.Flags()) } } - if a.healthCheckFunc != nil { - if err := a.healthCheckFunc(); err != nil { + if app.healthCheckFunc != nil { + if err := app.healthCheckFunc(); err != nil { return err } } // run application - return a.run() + return app.run() } // Command returns cobra command instance inside the application. -func (a *App) Command() *cobra.Command { - return a.cmd +func (app *App) Command() *cobra.Command { + return app.cmd } // formatBaseName is formatted as an executable file name under different diff --git a/pkg/app/config.go b/pkg/app/config.go new file mode 100644 index 00000000000..bb635f3b619 --- /dev/null +++ b/pkg/app/config.go @@ -0,0 +1,76 @@ +package app + +import ( + "fmt" + "path/filepath" + "strings" + + "github.com/fsnotify/fsnotify" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/spf13/viper" + "k8s.io/client-go/util/homedir" + + "github.com/superproj/onex/pkg/log" +) + +const configFlagName = "config" + +var cfgFile string + +// AddConfigFlag adds flags for a specific server to the specified FlagSet object. +// It also sets a passed functions to read values from configuration file into viper +// when each cobra command's Execute method is called. +func AddConfigFlag(fs *pflag.FlagSet, name string, watch bool) { + fs.AddFlag(pflag.Lookup(configFlagName)) + + // Enable viper's automatic environment variable parsing. This means + // that viper will automatically read values corresponding to viper + // variables from environment variables. + viper.AutomaticEnv() + // Set the environment variable prefix. Use the strings.ReplaceAll function + // to replace hyphens with underscores in the name, and use strings.ToUpper + // to convert the name to uppercase, then set it as the prefix for environment variables. + viper.SetEnvPrefix(strings.ReplaceAll(strings.ToUpper(name), "-", "_")) + // Set the replacement rules for environment variable keys. Use the + // strings.NewReplacer function to specify replacing periods and hyphens with underscores. + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) + + cobra.OnInitialize(func() { + if cfgFile != "" { + viper.SetConfigFile(cfgFile) + } else { + viper.AddConfigPath(".") + + if names := strings.Split(name, "-"); len(names) > 1 { + viper.AddConfigPath(filepath.Join(homedir.HomeDir(), "."+names[0])) + viper.AddConfigPath(filepath.Join("/etc", names[0])) + } + + viper.SetConfigName(name) + } + + if err := viper.ReadInConfig(); err != nil { + log.Debugw("Failed to read configuration file", "file", cfgFile, "err", err) + } + log.Debugw("Success to read configuration file", "file", viper.ConfigFileUsed()) + + if watch { + viper.WatchConfig() + viper.OnConfigChange(func(e fsnotify.Event) { + log.Debugw("Config file changed", "name", e.Name) + }) + } + }) +} + +func PrintConfig() { + for _, key := range viper.AllKeys() { + log.Debugw(fmt.Sprintf("CFG: %s=%v", key, viper.Get(key))) + } +} + +func init() { + pflag.StringVarP(&cfgFile, configFlagName, "c", cfgFile, "Read configuration from specified `FILE`, "+ + "support JSON, TOML, YAML, HCL, or Java properties formats.") +} diff --git a/pkg/app/options.go b/pkg/app/options.go index e03229ee81d..55ed37ce188 100644 --- a/pkg/app/options.go +++ b/pkg/app/options.go @@ -7,22 +7,9 @@ package app import ( - "fmt" - "path/filepath" - "strings" - - "github.com/fsnotify/fsnotify" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - "github.com/spf13/viper" - "k8s.io/client-go/util/homedir" cliflag "k8s.io/component-base/cli/flag" - - "github.com/superproj/onex/pkg/log" ) -const configFlagName = "config" - // CliOptions abstracts configuration options for reading parameters from the // command line. type CliOptions interface { @@ -35,61 +22,3 @@ type CliOptions interface { // Validate validates all the required options. Validate() error } - -var cfgFile string - -// AddConfigFlag adds flags for a specific server to the specified FlagSet object. -// It also sets a passed functions to read values from configuration file into viper -// when each cobra command's Execute method is called. -func AddConfigFlag(fs *pflag.FlagSet, name string, watch bool) { - fs.AddFlag(pflag.Lookup(configFlagName)) - - // Enable viper's automatic environment variable parsing. This means - // that viper will automatically read values corresponding to viper - // variables from environment variables. - viper.AutomaticEnv() - // Set the environment variable prefix. Use the strings.ReplaceAll function - // to replace hyphens with underscores in the name, and use strings.ToUpper - // to convert the name to uppercase, then set it as the prefix for environment variables. - viper.SetEnvPrefix(strings.ReplaceAll(strings.ToUpper(name), "-", "_")) - // Set the replacement rules for environment variable keys. Use the - // strings.NewReplacer function to specify replacing periods and hyphens with underscores. - viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_", "-", "_")) - - cobra.OnInitialize(func() { - if cfgFile != "" { - viper.SetConfigFile(cfgFile) - } else { - viper.AddConfigPath(".") - - if names := strings.Split(name, "-"); len(names) > 1 { - viper.AddConfigPath(filepath.Join(homedir.HomeDir(), "."+names[0])) - viper.AddConfigPath(filepath.Join("/etc", names[0])) - } - - viper.SetConfigName(name) - } - - if err := viper.ReadInConfig(); err != nil { - log.Debugw("Failed to read configuration file", "file", cfgFile, "err", err) - } - - if watch { - viper.WatchConfig() - viper.OnConfigChange(func(e fsnotify.Event) { - log.Debugw("Config file changed", "name", e.Name) - }) - } - }) -} - -func PrintConfig() { - for _, key := range viper.AllKeys() { - log.Debugw(fmt.Sprintf("CFG: %s=%v", key, viper.Get(key))) - } -} - -func init() { - pflag.StringVarP(&cfgFile, configFlagName, "c", cfgFile, "Read configuration from specified `FILE`, "+ - "support JSON, TOML, YAML, HCL, or Java properties formats.") -} diff --git a/pkg/config/v1beta1/zz_generated.conversion.go b/pkg/config/v1beta1/zz_generated.conversion.go index 71e9ff145d8..3122add1b8b 100644 --- a/pkg/config/v1beta1/zz_generated.conversion.go +++ b/pkg/config/v1beta1/zz_generated.conversion.go @@ -11,10 +11,9 @@ package v1beta1 import ( + config "github.com/superproj/onex/pkg/config" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - - config "github.com/superproj/onex/pkg/config" ) func init() { @@ -24,22 +23,22 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddConversionFunc((*config.MySQLConfiguration)(nil), (*MySQLConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddConversionFunc((*config.MySQLConfiguration)(nil), (*MySQLConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_MySQLConfiguration_To_v1beta1_MySQLConfiguration(a.(*config.MySQLConfiguration), b.(*MySQLConfiguration), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*config.RedisConfiguration)(nil), (*RedisConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddConversionFunc((*config.RedisConfiguration)(nil), (*RedisConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_config_RedisConfiguration_To_v1beta1_RedisConfiguration(a.(*config.RedisConfiguration), b.(*RedisConfiguration), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*MySQLConfiguration)(nil), (*config.MySQLConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddConversionFunc((*MySQLConfiguration)(nil), (*config.MySQLConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_MySQLConfiguration_To_config_MySQLConfiguration(a.(*MySQLConfiguration), b.(*config.MySQLConfiguration), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*RedisConfiguration)(nil), (*config.RedisConfiguration)(nil), func(a, b any, scope conversion.Scope) error { + if err := s.AddConversionFunc((*RedisConfiguration)(nil), (*config.RedisConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1beta1_RedisConfiguration_To_config_RedisConfiguration(a.(*RedisConfiguration), b.(*config.RedisConfiguration), scope) }); err != nil { return err diff --git a/pkg/db/mysql.go b/pkg/db/mysql.go index 76650b20495..c4c5982873b 100644 --- a/pkg/db/mysql.go +++ b/pkg/db/mysql.go @@ -10,12 +10,13 @@ import ( "fmt" "time" + "github.com/superproj/onex/pkg/log" "gorm.io/driver/mysql" "gorm.io/gorm" "gorm.io/gorm/logger" ) -// MySQLOptions defines optsions for mysql database. +// MySQLOptions defines options for mysql database. type MySQLOptions struct { Host string Username string @@ -24,6 +25,7 @@ type MySQLOptions struct { MaxIdleConnections int MaxOpenConnections int MaxConnectionLifeTime time.Duration + LogLevel int // +optional Logger logger.Interface } @@ -85,6 +87,9 @@ func setDefaults(opts *MySQLOptions) { if opts.MaxConnectionLifeTime == 0 { opts.MaxConnectionLifeTime = time.Duration(10) * time.Second } + if 1 <= opts.LogLevel && opts.LogLevel <= 4 { + opts.Logger = log.Default().LogMode(logger.LogLevel(opts.LogLevel)) + } if opts.Logger == nil { opts.Logger = logger.Default } diff --git a/pkg/db/redis.go b/pkg/db/redis.go index daeb9447639..dcafcba2c09 100644 --- a/pkg/db/redis.go +++ b/pkg/db/redis.go @@ -13,7 +13,7 @@ import ( "github.com/redis/go-redis/v9" ) -// RedisOptions defines optsions for mysql database. +// RedisOptions defines options for redis database. type RedisOptions struct { Addr string Username string @@ -28,7 +28,7 @@ type RedisOptions struct { PoolSize int } -// NewRedis create a new gorm db instance with the given options. +// NewRedis create a new redis db instance with the given options. func NewRedis(opts *RedisOptions) (*redis.Client, error) { options := &redis.Options{ Addr: opts.Addr, diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcecolumndefinition.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcecolumndefinition.go new file mode 100644 index 00000000000..867f858934b --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcecolumndefinition.go @@ -0,0 +1,73 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CustomResourceColumnDefinitionApplyConfiguration represents an declarative configuration of the CustomResourceColumnDefinition type for use +// with apply. +type CustomResourceColumnDefinitionApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Format *string `json:"format,omitempty"` + Description *string `json:"description,omitempty"` + Priority *int32 `json:"priority,omitempty"` + JSONPath *string `json:"jsonPath,omitempty"` +} + +// CustomResourceColumnDefinitionApplyConfiguration constructs an declarative configuration of the CustomResourceColumnDefinition type for use with +// apply. +func CustomResourceColumnDefinition() *CustomResourceColumnDefinitionApplyConfiguration { + return &CustomResourceColumnDefinitionApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CustomResourceColumnDefinitionApplyConfiguration) WithName(value string) *CustomResourceColumnDefinitionApplyConfiguration { + b.Name = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *CustomResourceColumnDefinitionApplyConfiguration) WithType(value string) *CustomResourceColumnDefinitionApplyConfiguration { + b.Type = &value + return b +} + +// WithFormat sets the Format field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Format field is set to the value of the last call. +func (b *CustomResourceColumnDefinitionApplyConfiguration) WithFormat(value string) *CustomResourceColumnDefinitionApplyConfiguration { + b.Format = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *CustomResourceColumnDefinitionApplyConfiguration) WithDescription(value string) *CustomResourceColumnDefinitionApplyConfiguration { + b.Description = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *CustomResourceColumnDefinitionApplyConfiguration) WithPriority(value int32) *CustomResourceColumnDefinitionApplyConfiguration { + b.Priority = &value + return b +} + +// WithJSONPath sets the JSONPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the JSONPath field is set to the value of the last call. +func (b *CustomResourceColumnDefinitionApplyConfiguration) WithJSONPath(value string) *CustomResourceColumnDefinitionApplyConfiguration { + b.JSONPath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourceconversion.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourceconversion.go new file mode 100644 index 00000000000..832a0054007 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourceconversion.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// CustomResourceConversionApplyConfiguration represents an declarative configuration of the CustomResourceConversion type for use +// with apply. +type CustomResourceConversionApplyConfiguration struct { + Strategy *v1.ConversionStrategyType `json:"strategy,omitempty"` + Webhook *WebhookConversionApplyConfiguration `json:"webhook,omitempty"` +} + +// CustomResourceConversionApplyConfiguration constructs an declarative configuration of the CustomResourceConversion type for use with +// apply. +func CustomResourceConversion() *CustomResourceConversionApplyConfiguration { + return &CustomResourceConversionApplyConfiguration{} +} + +// WithStrategy sets the Strategy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Strategy field is set to the value of the last call. +func (b *CustomResourceConversionApplyConfiguration) WithStrategy(value v1.ConversionStrategyType) *CustomResourceConversionApplyConfiguration { + b.Strategy = &value + return b +} + +// WithWebhook sets the Webhook field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Webhook field is set to the value of the last call. +func (b *CustomResourceConversionApplyConfiguration) WithWebhook(value *WebhookConversionApplyConfiguration) *CustomResourceConversionApplyConfiguration { + b.Webhook = value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinition.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinition.go new file mode 100644 index 00000000000..aa4159c887f --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinition.go @@ -0,0 +1,245 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apisapiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// CustomResourceDefinitionApplyConfiguration represents an declarative configuration of the CustomResourceDefinition type for use +// with apply. +type CustomResourceDefinitionApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *CustomResourceDefinitionSpecApplyConfiguration `json:"spec,omitempty"` + Status *CustomResourceDefinitionStatusApplyConfiguration `json:"status,omitempty"` +} + +// CustomResourceDefinition constructs an declarative configuration of the CustomResourceDefinition type for use with +// apply. +func CustomResourceDefinition(name string) *CustomResourceDefinitionApplyConfiguration { + b := &CustomResourceDefinitionApplyConfiguration{} + b.WithName(name) + b.WithKind("CustomResourceDefinition") + b.WithAPIVersion("apiextensions.k8s.io/v1") + return b +} + +// ExtractCustomResourceDefinition extracts the applied configuration owned by fieldManager from +// customResourceDefinition. If no managedFields are found in customResourceDefinition for fieldManager, a +// CustomResourceDefinitionApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// customResourceDefinition must be a unmodified CustomResourceDefinition API object that was retrieved from the Kubernetes API. +// ExtractCustomResourceDefinition provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractCustomResourceDefinition(customResourceDefinition *apisapiextensionsv1.CustomResourceDefinition, fieldManager string) (*CustomResourceDefinitionApplyConfiguration, error) { + return extractCustomResourceDefinition(customResourceDefinition, fieldManager, "") +} + +// ExtractCustomResourceDefinitionStatus is the same as ExtractCustomResourceDefinition except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractCustomResourceDefinitionStatus(customResourceDefinition *apisapiextensionsv1.CustomResourceDefinition, fieldManager string) (*CustomResourceDefinitionApplyConfiguration, error) { + return extractCustomResourceDefinition(customResourceDefinition, fieldManager, "status") +} + +func extractCustomResourceDefinition(customResourceDefinition *apisapiextensionsv1.CustomResourceDefinition, fieldManager string, subresource string) (*CustomResourceDefinitionApplyConfiguration, error) { + b := &CustomResourceDefinitionApplyConfiguration{} + err := managedfields.ExtractInto(customResourceDefinition, internal.Parser().Type("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinition"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(customResourceDefinition.Name) + + b.WithKind("CustomResourceDefinition") + b.WithAPIVersion("apiextensions.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithKind(value string) *CustomResourceDefinitionApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithAPIVersion(value string) *CustomResourceDefinitionApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithName(value string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithGenerateName(value string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithNamespace(value string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithUID(value types.UID) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithResourceVersion(value string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithGeneration(value int64) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithCreationTimestamp(value metav1.Time) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *CustomResourceDefinitionApplyConfiguration) WithLabels(entries map[string]string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *CustomResourceDefinitionApplyConfiguration) WithAnnotations(entries map[string]string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *CustomResourceDefinitionApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *CustomResourceDefinitionApplyConfiguration) WithFinalizers(values ...string) *CustomResourceDefinitionApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *CustomResourceDefinitionApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithSpec(value *CustomResourceDefinitionSpecApplyConfiguration) *CustomResourceDefinitionApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *CustomResourceDefinitionApplyConfiguration) WithStatus(value *CustomResourceDefinitionStatusApplyConfiguration) *CustomResourceDefinitionApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitioncondition.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitioncondition.go new file mode 100644 index 00000000000..d69e9671268 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitioncondition.go @@ -0,0 +1,69 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// CustomResourceDefinitionConditionApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionCondition type for use +// with apply. +type CustomResourceDefinitionConditionApplyConfiguration struct { + Type *v1.CustomResourceDefinitionConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// CustomResourceDefinitionConditionApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionCondition type for use with +// apply. +func CustomResourceDefinitionCondition() *CustomResourceDefinitionConditionApplyConfiguration { + return &CustomResourceDefinitionConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *CustomResourceDefinitionConditionApplyConfiguration) WithType(value v1.CustomResourceDefinitionConditionType) *CustomResourceDefinitionConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *CustomResourceDefinitionConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *CustomResourceDefinitionConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *CustomResourceDefinitionConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *CustomResourceDefinitionConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *CustomResourceDefinitionConditionApplyConfiguration) WithReason(value string) *CustomResourceDefinitionConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *CustomResourceDefinitionConditionApplyConfiguration) WithMessage(value string) *CustomResourceDefinitionConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionnames.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionnames.go new file mode 100644 index 00000000000..ed3f81feb74 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionnames.go @@ -0,0 +1,77 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CustomResourceDefinitionNamesApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionNames type for use +// with apply. +type CustomResourceDefinitionNamesApplyConfiguration struct { + Plural *string `json:"plural,omitempty"` + Singular *string `json:"singular,omitempty"` + ShortNames []string `json:"shortNames,omitempty"` + Kind *string `json:"kind,omitempty"` + ListKind *string `json:"listKind,omitempty"` + Categories []string `json:"categories,omitempty"` +} + +// CustomResourceDefinitionNamesApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionNames type for use with +// apply. +func CustomResourceDefinitionNames() *CustomResourceDefinitionNamesApplyConfiguration { + return &CustomResourceDefinitionNamesApplyConfiguration{} +} + +// WithPlural sets the Plural field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Plural field is set to the value of the last call. +func (b *CustomResourceDefinitionNamesApplyConfiguration) WithPlural(value string) *CustomResourceDefinitionNamesApplyConfiguration { + b.Plural = &value + return b +} + +// WithSingular sets the Singular field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Singular field is set to the value of the last call. +func (b *CustomResourceDefinitionNamesApplyConfiguration) WithSingular(value string) *CustomResourceDefinitionNamesApplyConfiguration { + b.Singular = &value + return b +} + +// WithShortNames adds the given value to the ShortNames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ShortNames field. +func (b *CustomResourceDefinitionNamesApplyConfiguration) WithShortNames(values ...string) *CustomResourceDefinitionNamesApplyConfiguration { + for i := range values { + b.ShortNames = append(b.ShortNames, values[i]) + } + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *CustomResourceDefinitionNamesApplyConfiguration) WithKind(value string) *CustomResourceDefinitionNamesApplyConfiguration { + b.Kind = &value + return b +} + +// WithListKind sets the ListKind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ListKind field is set to the value of the last call. +func (b *CustomResourceDefinitionNamesApplyConfiguration) WithListKind(value string) *CustomResourceDefinitionNamesApplyConfiguration { + b.ListKind = &value + return b +} + +// WithCategories adds the given value to the Categories field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Categories field. +func (b *CustomResourceDefinitionNamesApplyConfiguration) WithCategories(values ...string) *CustomResourceDefinitionNamesApplyConfiguration { + for i := range values { + b.Categories = append(b.Categories, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionspec.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionspec.go new file mode 100644 index 00000000000..0aa3507dcd3 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionspec.go @@ -0,0 +1,82 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// CustomResourceDefinitionSpecApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionSpec type for use +// with apply. +type CustomResourceDefinitionSpecApplyConfiguration struct { + Group *string `json:"group,omitempty"` + Names *CustomResourceDefinitionNamesApplyConfiguration `json:"names,omitempty"` + Scope *apiextensionsv1.ResourceScope `json:"scope,omitempty"` + Versions []CustomResourceDefinitionVersionApplyConfiguration `json:"versions,omitempty"` + Conversion *CustomResourceConversionApplyConfiguration `json:"conversion,omitempty"` + PreserveUnknownFields *bool `json:"preserveUnknownFields,omitempty"` +} + +// CustomResourceDefinitionSpecApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionSpec type for use with +// apply. +func CustomResourceDefinitionSpec() *CustomResourceDefinitionSpecApplyConfiguration { + return &CustomResourceDefinitionSpecApplyConfiguration{} +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *CustomResourceDefinitionSpecApplyConfiguration) WithGroup(value string) *CustomResourceDefinitionSpecApplyConfiguration { + b.Group = &value + return b +} + +// WithNames sets the Names field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Names field is set to the value of the last call. +func (b *CustomResourceDefinitionSpecApplyConfiguration) WithNames(value *CustomResourceDefinitionNamesApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration { + b.Names = value + return b +} + +// WithScope sets the Scope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scope field is set to the value of the last call. +func (b *CustomResourceDefinitionSpecApplyConfiguration) WithScope(value apiextensionsv1.ResourceScope) *CustomResourceDefinitionSpecApplyConfiguration { + b.Scope = &value + return b +} + +// WithVersions adds the given value to the Versions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Versions field. +func (b *CustomResourceDefinitionSpecApplyConfiguration) WithVersions(values ...*CustomResourceDefinitionVersionApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVersions") + } + b.Versions = append(b.Versions, *values[i]) + } + return b +} + +// WithConversion sets the Conversion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conversion field is set to the value of the last call. +func (b *CustomResourceDefinitionSpecApplyConfiguration) WithConversion(value *CustomResourceConversionApplyConfiguration) *CustomResourceDefinitionSpecApplyConfiguration { + b.Conversion = value + return b +} + +// WithPreserveUnknownFields sets the PreserveUnknownFields field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreserveUnknownFields field is set to the value of the last call. +func (b *CustomResourceDefinitionSpecApplyConfiguration) WithPreserveUnknownFields(value bool) *CustomResourceDefinitionSpecApplyConfiguration { + b.PreserveUnknownFields = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionstatus.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionstatus.go new file mode 100644 index 00000000000..bc05e56199d --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionstatus.go @@ -0,0 +1,53 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CustomResourceDefinitionStatusApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionStatus type for use +// with apply. +type CustomResourceDefinitionStatusApplyConfiguration struct { + Conditions []CustomResourceDefinitionConditionApplyConfiguration `json:"conditions,omitempty"` + AcceptedNames *CustomResourceDefinitionNamesApplyConfiguration `json:"acceptedNames,omitempty"` + StoredVersions []string `json:"storedVersions,omitempty"` +} + +// CustomResourceDefinitionStatusApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionStatus type for use with +// apply. +func CustomResourceDefinitionStatus() *CustomResourceDefinitionStatusApplyConfiguration { + return &CustomResourceDefinitionStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *CustomResourceDefinitionStatusApplyConfiguration) WithConditions(values ...*CustomResourceDefinitionConditionApplyConfiguration) *CustomResourceDefinitionStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithAcceptedNames sets the AcceptedNames field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AcceptedNames field is set to the value of the last call. +func (b *CustomResourceDefinitionStatusApplyConfiguration) WithAcceptedNames(value *CustomResourceDefinitionNamesApplyConfiguration) *CustomResourceDefinitionStatusApplyConfiguration { + b.AcceptedNames = value + return b +} + +// WithStoredVersions adds the given value to the StoredVersions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the StoredVersions field. +func (b *CustomResourceDefinitionStatusApplyConfiguration) WithStoredVersions(values ...string) *CustomResourceDefinitionStatusApplyConfiguration { + for i := range values { + b.StoredVersions = append(b.StoredVersions, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionversion.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionversion.go new file mode 100644 index 00000000000..7414c7c2f90 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcedefinitionversion.go @@ -0,0 +1,110 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CustomResourceDefinitionVersionApplyConfiguration represents an declarative configuration of the CustomResourceDefinitionVersion type for use +// with apply. +type CustomResourceDefinitionVersionApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Served *bool `json:"served,omitempty"` + Storage *bool `json:"storage,omitempty"` + Deprecated *bool `json:"deprecated,omitempty"` + DeprecationWarning *string `json:"deprecationWarning,omitempty"` + Schema *CustomResourceValidationApplyConfiguration `json:"schema,omitempty"` + Subresources *CustomResourceSubresourcesApplyConfiguration `json:"subresources,omitempty"` + AdditionalPrinterColumns []CustomResourceColumnDefinitionApplyConfiguration `json:"additionalPrinterColumns,omitempty"` + SelectableFields []SelectableFieldApplyConfiguration `json:"selectableFields,omitempty"` +} + +// CustomResourceDefinitionVersionApplyConfiguration constructs an declarative configuration of the CustomResourceDefinitionVersion type for use with +// apply. +func CustomResourceDefinitionVersion() *CustomResourceDefinitionVersionApplyConfiguration { + return &CustomResourceDefinitionVersionApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithName(value string) *CustomResourceDefinitionVersionApplyConfiguration { + b.Name = &value + return b +} + +// WithServed sets the Served field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Served field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithServed(value bool) *CustomResourceDefinitionVersionApplyConfiguration { + b.Served = &value + return b +} + +// WithStorage sets the Storage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Storage field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithStorage(value bool) *CustomResourceDefinitionVersionApplyConfiguration { + b.Storage = &value + return b +} + +// WithDeprecated sets the Deprecated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Deprecated field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithDeprecated(value bool) *CustomResourceDefinitionVersionApplyConfiguration { + b.Deprecated = &value + return b +} + +// WithDeprecationWarning sets the DeprecationWarning field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeprecationWarning field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithDeprecationWarning(value string) *CustomResourceDefinitionVersionApplyConfiguration { + b.DeprecationWarning = &value + return b +} + +// WithSchema sets the Schema field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Schema field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithSchema(value *CustomResourceValidationApplyConfiguration) *CustomResourceDefinitionVersionApplyConfiguration { + b.Schema = value + return b +} + +// WithSubresources sets the Subresources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subresources field is set to the value of the last call. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithSubresources(value *CustomResourceSubresourcesApplyConfiguration) *CustomResourceDefinitionVersionApplyConfiguration { + b.Subresources = value + return b +} + +// WithAdditionalPrinterColumns adds the given value to the AdditionalPrinterColumns field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AdditionalPrinterColumns field. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithAdditionalPrinterColumns(values ...*CustomResourceColumnDefinitionApplyConfiguration) *CustomResourceDefinitionVersionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAdditionalPrinterColumns") + } + b.AdditionalPrinterColumns = append(b.AdditionalPrinterColumns, *values[i]) + } + return b +} + +// WithSelectableFields adds the given value to the SelectableFields field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SelectableFields field. +func (b *CustomResourceDefinitionVersionApplyConfiguration) WithSelectableFields(values ...*SelectableFieldApplyConfiguration) *CustomResourceDefinitionVersionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSelectableFields") + } + b.SelectableFields = append(b.SelectableFields, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcesubresources.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcesubresources.go new file mode 100644 index 00000000000..548dfdeb293 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcesubresources.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// CustomResourceSubresourcesApplyConfiguration represents an declarative configuration of the CustomResourceSubresources type for use +// with apply. +type CustomResourceSubresourcesApplyConfiguration struct { + Status *v1.CustomResourceSubresourceStatus `json:"status,omitempty"` + Scale *CustomResourceSubresourceScaleApplyConfiguration `json:"scale,omitempty"` +} + +// CustomResourceSubresourcesApplyConfiguration constructs an declarative configuration of the CustomResourceSubresources type for use with +// apply. +func CustomResourceSubresources() *CustomResourceSubresourcesApplyConfiguration { + return &CustomResourceSubresourcesApplyConfiguration{} +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *CustomResourceSubresourcesApplyConfiguration) WithStatus(value v1.CustomResourceSubresourceStatus) *CustomResourceSubresourcesApplyConfiguration { + b.Status = &value + return b +} + +// WithScale sets the Scale field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scale field is set to the value of the last call. +func (b *CustomResourceSubresourcesApplyConfiguration) WithScale(value *CustomResourceSubresourceScaleApplyConfiguration) *CustomResourceSubresourcesApplyConfiguration { + b.Scale = value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcesubresourcescale.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcesubresourcescale.go new file mode 100644 index 00000000000..bad3deb45be --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcesubresourcescale.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CustomResourceSubresourceScaleApplyConfiguration represents an declarative configuration of the CustomResourceSubresourceScale type for use +// with apply. +type CustomResourceSubresourceScaleApplyConfiguration struct { + SpecReplicasPath *string `json:"specReplicasPath,omitempty"` + StatusReplicasPath *string `json:"statusReplicasPath,omitempty"` + LabelSelectorPath *string `json:"labelSelectorPath,omitempty"` +} + +// CustomResourceSubresourceScaleApplyConfiguration constructs an declarative configuration of the CustomResourceSubresourceScale type for use with +// apply. +func CustomResourceSubresourceScale() *CustomResourceSubresourceScaleApplyConfiguration { + return &CustomResourceSubresourceScaleApplyConfiguration{} +} + +// WithSpecReplicasPath sets the SpecReplicasPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SpecReplicasPath field is set to the value of the last call. +func (b *CustomResourceSubresourceScaleApplyConfiguration) WithSpecReplicasPath(value string) *CustomResourceSubresourceScaleApplyConfiguration { + b.SpecReplicasPath = &value + return b +} + +// WithStatusReplicasPath sets the StatusReplicasPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StatusReplicasPath field is set to the value of the last call. +func (b *CustomResourceSubresourceScaleApplyConfiguration) WithStatusReplicasPath(value string) *CustomResourceSubresourceScaleApplyConfiguration { + b.StatusReplicasPath = &value + return b +} + +// WithLabelSelectorPath sets the LabelSelectorPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelSelectorPath field is set to the value of the last call. +func (b *CustomResourceSubresourceScaleApplyConfiguration) WithLabelSelectorPath(value string) *CustomResourceSubresourceScaleApplyConfiguration { + b.LabelSelectorPath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/customresourcevalidation.go b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcevalidation.go new file mode 100644 index 00000000000..752ee8a1977 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/customresourcevalidation.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CustomResourceValidationApplyConfiguration represents an declarative configuration of the CustomResourceValidation type for use +// with apply. +type CustomResourceValidationApplyConfiguration struct { + OpenAPIV3Schema *JSONSchemaPropsApplyConfiguration `json:"openAPIV3Schema,omitempty"` +} + +// CustomResourceValidationApplyConfiguration constructs an declarative configuration of the CustomResourceValidation type for use with +// apply. +func CustomResourceValidation() *CustomResourceValidationApplyConfiguration { + return &CustomResourceValidationApplyConfiguration{} +} + +// WithOpenAPIV3Schema sets the OpenAPIV3Schema field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OpenAPIV3Schema field is set to the value of the last call. +func (b *CustomResourceValidationApplyConfiguration) WithOpenAPIV3Schema(value *JSONSchemaPropsApplyConfiguration) *CustomResourceValidationApplyConfiguration { + b.OpenAPIV3Schema = value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/externaldocumentation.go b/pkg/generated/applyconfigurations/apiextensions/v1/externaldocumentation.go new file mode 100644 index 00000000000..ddd5d100645 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/externaldocumentation.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ExternalDocumentationApplyConfiguration represents an declarative configuration of the ExternalDocumentation type for use +// with apply. +type ExternalDocumentationApplyConfiguration struct { + Description *string `json:"description,omitempty"` + URL *string `json:"url,omitempty"` +} + +// ExternalDocumentationApplyConfiguration constructs an declarative configuration of the ExternalDocumentation type for use with +// apply. +func ExternalDocumentation() *ExternalDocumentationApplyConfiguration { + return &ExternalDocumentationApplyConfiguration{} +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *ExternalDocumentationApplyConfiguration) WithDescription(value string) *ExternalDocumentationApplyConfiguration { + b.Description = &value + return b +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *ExternalDocumentationApplyConfiguration) WithURL(value string) *ExternalDocumentationApplyConfiguration { + b.URL = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/jsonschemaprops.go b/pkg/generated/applyconfigurations/apiextensions/v1/jsonschemaprops.go new file mode 100644 index 00000000000..6617417a692 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/jsonschemaprops.go @@ -0,0 +1,452 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// JSONSchemaPropsApplyConfiguration represents an declarative configuration of the JSONSchemaProps type for use +// with apply. +type JSONSchemaPropsApplyConfiguration struct { + ID *string `json:"id,omitempty"` + Schema *v1.JSONSchemaURL `json:"$schema,omitempty"` + Ref *string `json:"$ref,omitempty"` + Description *string `json:"description,omitempty"` + Type *string `json:"type,omitempty"` + Format *string `json:"format,omitempty"` + Title *string `json:"title,omitempty"` + Default *v1.JSON `json:"default,omitempty"` + Maximum *float64 `json:"maximum,omitempty"` + ExclusiveMaximum *bool `json:"exclusiveMaximum,omitempty"` + Minimum *float64 `json:"minimum,omitempty"` + ExclusiveMinimum *bool `json:"exclusiveMinimum,omitempty"` + MaxLength *int64 `json:"maxLength,omitempty"` + MinLength *int64 `json:"minLength,omitempty"` + Pattern *string `json:"pattern,omitempty"` + MaxItems *int64 `json:"maxItems,omitempty"` + MinItems *int64 `json:"minItems,omitempty"` + UniqueItems *bool `json:"uniqueItems,omitempty"` + MultipleOf *float64 `json:"multipleOf,omitempty"` + Enum []v1.JSON `json:"enum,omitempty"` + MaxProperties *int64 `json:"maxProperties,omitempty"` + MinProperties *int64 `json:"minProperties,omitempty"` + Required []string `json:"required,omitempty"` + Items *v1.JSONSchemaPropsOrArray `json:"items,omitempty"` + AllOf []JSONSchemaPropsApplyConfiguration `json:"allOf,omitempty"` + OneOf []JSONSchemaPropsApplyConfiguration `json:"oneOf,omitempty"` + AnyOf []JSONSchemaPropsApplyConfiguration `json:"anyOf,omitempty"` + Not *JSONSchemaPropsApplyConfiguration `json:"not,omitempty"` + Properties map[string]JSONSchemaPropsApplyConfiguration `json:"properties,omitempty"` + AdditionalProperties *v1.JSONSchemaPropsOrBool `json:"additionalProperties,omitempty"` + PatternProperties map[string]JSONSchemaPropsApplyConfiguration `json:"patternProperties,omitempty"` + Dependencies *v1.JSONSchemaDependencies `json:"dependencies,omitempty"` + AdditionalItems *v1.JSONSchemaPropsOrBool `json:"additionalItems,omitempty"` + Definitions *v1.JSONSchemaDefinitions `json:"definitions,omitempty"` + ExternalDocs *ExternalDocumentationApplyConfiguration `json:"externalDocs,omitempty"` + Example *v1.JSON `json:"example,omitempty"` + Nullable *bool `json:"nullable,omitempty"` + XPreserveUnknownFields *bool `json:"x-kubernetes-preserve-unknown-fields,omitempty"` + XEmbeddedResource *bool `json:"x-kubernetes-embedded-resource,omitempty"` + XIntOrString *bool `json:"x-kubernetes-int-or-string,omitempty"` + XListMapKeys []string `json:"x-kubernetes-list-map-keys,omitempty"` + XListType *string `json:"x-kubernetes-list-type,omitempty"` + XMapType *string `json:"x-kubernetes-map-type,omitempty"` + XValidations *v1.ValidationRules `json:"x-kubernetes-validations,omitempty"` +} + +// JSONSchemaPropsApplyConfiguration constructs an declarative configuration of the JSONSchemaProps type for use with +// apply. +func JSONSchemaProps() *JSONSchemaPropsApplyConfiguration { + return &JSONSchemaPropsApplyConfiguration{} +} + +// WithID sets the ID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ID field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithID(value string) *JSONSchemaPropsApplyConfiguration { + b.ID = &value + return b +} + +// WithSchema sets the Schema field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Schema field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithSchema(value v1.JSONSchemaURL) *JSONSchemaPropsApplyConfiguration { + b.Schema = &value + return b +} + +// WithRef sets the Ref field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ref field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithRef(value string) *JSONSchemaPropsApplyConfiguration { + b.Ref = &value + return b +} + +// WithDescription sets the Description field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Description field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithDescription(value string) *JSONSchemaPropsApplyConfiguration { + b.Description = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithType(value string) *JSONSchemaPropsApplyConfiguration { + b.Type = &value + return b +} + +// WithFormat sets the Format field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Format field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithFormat(value string) *JSONSchemaPropsApplyConfiguration { + b.Format = &value + return b +} + +// WithTitle sets the Title field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Title field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithTitle(value string) *JSONSchemaPropsApplyConfiguration { + b.Title = &value + return b +} + +// WithDefault sets the Default field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Default field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithDefault(value v1.JSON) *JSONSchemaPropsApplyConfiguration { + b.Default = &value + return b +} + +// WithMaximum sets the Maximum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Maximum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaximum(value float64) *JSONSchemaPropsApplyConfiguration { + b.Maximum = &value + return b +} + +// WithExclusiveMaximum sets the ExclusiveMaximum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExclusiveMaximum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExclusiveMaximum(value bool) *JSONSchemaPropsApplyConfiguration { + b.ExclusiveMaximum = &value + return b +} + +// WithMinimum sets the Minimum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Minimum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinimum(value float64) *JSONSchemaPropsApplyConfiguration { + b.Minimum = &value + return b +} + +// WithExclusiveMinimum sets the ExclusiveMinimum field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExclusiveMinimum field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExclusiveMinimum(value bool) *JSONSchemaPropsApplyConfiguration { + b.ExclusiveMinimum = &value + return b +} + +// WithMaxLength sets the MaxLength field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxLength field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaxLength(value int64) *JSONSchemaPropsApplyConfiguration { + b.MaxLength = &value + return b +} + +// WithMinLength sets the MinLength field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinLength field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinLength(value int64) *JSONSchemaPropsApplyConfiguration { + b.MinLength = &value + return b +} + +// WithPattern sets the Pattern field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Pattern field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithPattern(value string) *JSONSchemaPropsApplyConfiguration { + b.Pattern = &value + return b +} + +// WithMaxItems sets the MaxItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaxItems(value int64) *JSONSchemaPropsApplyConfiguration { + b.MaxItems = &value + return b +} + +// WithMinItems sets the MinItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinItems(value int64) *JSONSchemaPropsApplyConfiguration { + b.MinItems = &value + return b +} + +// WithUniqueItems sets the UniqueItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UniqueItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithUniqueItems(value bool) *JSONSchemaPropsApplyConfiguration { + b.UniqueItems = &value + return b +} + +// WithMultipleOf sets the MultipleOf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MultipleOf field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMultipleOf(value float64) *JSONSchemaPropsApplyConfiguration { + b.MultipleOf = &value + return b +} + +// WithEnum adds the given value to the Enum field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Enum field. +func (b *JSONSchemaPropsApplyConfiguration) WithEnum(values ...v1.JSON) *JSONSchemaPropsApplyConfiguration { + for i := range values { + b.Enum = append(b.Enum, values[i]) + } + return b +} + +// WithMaxProperties sets the MaxProperties field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxProperties field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMaxProperties(value int64) *JSONSchemaPropsApplyConfiguration { + b.MaxProperties = &value + return b +} + +// WithMinProperties sets the MinProperties field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinProperties field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithMinProperties(value int64) *JSONSchemaPropsApplyConfiguration { + b.MinProperties = &value + return b +} + +// WithRequired adds the given value to the Required field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Required field. +func (b *JSONSchemaPropsApplyConfiguration) WithRequired(values ...string) *JSONSchemaPropsApplyConfiguration { + for i := range values { + b.Required = append(b.Required, values[i]) + } + return b +} + +// WithItems sets the Items field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Items field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithItems(value v1.JSONSchemaPropsOrArray) *JSONSchemaPropsApplyConfiguration { + b.Items = &value + return b +} + +// WithAllOf adds the given value to the AllOf field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AllOf field. +func (b *JSONSchemaPropsApplyConfiguration) WithAllOf(values ...*JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAllOf") + } + b.AllOf = append(b.AllOf, *values[i]) + } + return b +} + +// WithOneOf adds the given value to the OneOf field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OneOf field. +func (b *JSONSchemaPropsApplyConfiguration) WithOneOf(values ...*JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOneOf") + } + b.OneOf = append(b.OneOf, *values[i]) + } + return b +} + +// WithAnyOf adds the given value to the AnyOf field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AnyOf field. +func (b *JSONSchemaPropsApplyConfiguration) WithAnyOf(values ...*JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAnyOf") + } + b.AnyOf = append(b.AnyOf, *values[i]) + } + return b +} + +// WithNot sets the Not field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Not field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithNot(value *JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + b.Not = value + return b +} + +// WithProperties puts the entries into the Properties field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Properties field, +// overwriting an existing map entries in Properties field with the same key. +func (b *JSONSchemaPropsApplyConfiguration) WithProperties(entries map[string]JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + if b.Properties == nil && len(entries) > 0 { + b.Properties = make(map[string]JSONSchemaPropsApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.Properties[k] = v + } + return b +} + +// WithAdditionalProperties sets the AdditionalProperties field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalProperties field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithAdditionalProperties(value v1.JSONSchemaPropsOrBool) *JSONSchemaPropsApplyConfiguration { + b.AdditionalProperties = &value + return b +} + +// WithPatternProperties puts the entries into the PatternProperties field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the PatternProperties field, +// overwriting an existing map entries in PatternProperties field with the same key. +func (b *JSONSchemaPropsApplyConfiguration) WithPatternProperties(entries map[string]JSONSchemaPropsApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + if b.PatternProperties == nil && len(entries) > 0 { + b.PatternProperties = make(map[string]JSONSchemaPropsApplyConfiguration, len(entries)) + } + for k, v := range entries { + b.PatternProperties[k] = v + } + return b +} + +// WithDependencies sets the Dependencies field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Dependencies field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithDependencies(value v1.JSONSchemaDependencies) *JSONSchemaPropsApplyConfiguration { + b.Dependencies = &value + return b +} + +// WithAdditionalItems sets the AdditionalItems field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AdditionalItems field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithAdditionalItems(value v1.JSONSchemaPropsOrBool) *JSONSchemaPropsApplyConfiguration { + b.AdditionalItems = &value + return b +} + +// WithDefinitions sets the Definitions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Definitions field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithDefinitions(value v1.JSONSchemaDefinitions) *JSONSchemaPropsApplyConfiguration { + b.Definitions = &value + return b +} + +// WithExternalDocs sets the ExternalDocs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalDocs field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExternalDocs(value *ExternalDocumentationApplyConfiguration) *JSONSchemaPropsApplyConfiguration { + b.ExternalDocs = value + return b +} + +// WithExample sets the Example field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Example field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithExample(value v1.JSON) *JSONSchemaPropsApplyConfiguration { + b.Example = &value + return b +} + +// WithNullable sets the Nullable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Nullable field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithNullable(value bool) *JSONSchemaPropsApplyConfiguration { + b.Nullable = &value + return b +} + +// WithXPreserveUnknownFields sets the XPreserveUnknownFields field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XPreserveUnknownFields field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXPreserveUnknownFields(value bool) *JSONSchemaPropsApplyConfiguration { + b.XPreserveUnknownFields = &value + return b +} + +// WithXEmbeddedResource sets the XEmbeddedResource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XEmbeddedResource field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXEmbeddedResource(value bool) *JSONSchemaPropsApplyConfiguration { + b.XEmbeddedResource = &value + return b +} + +// WithXIntOrString sets the XIntOrString field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XIntOrString field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXIntOrString(value bool) *JSONSchemaPropsApplyConfiguration { + b.XIntOrString = &value + return b +} + +// WithXListMapKeys adds the given value to the XListMapKeys field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the XListMapKeys field. +func (b *JSONSchemaPropsApplyConfiguration) WithXListMapKeys(values ...string) *JSONSchemaPropsApplyConfiguration { + for i := range values { + b.XListMapKeys = append(b.XListMapKeys, values[i]) + } + return b +} + +// WithXListType sets the XListType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XListType field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXListType(value string) *JSONSchemaPropsApplyConfiguration { + b.XListType = &value + return b +} + +// WithXMapType sets the XMapType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XMapType field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXMapType(value string) *JSONSchemaPropsApplyConfiguration { + b.XMapType = &value + return b +} + +// WithXValidations sets the XValidations field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the XValidations field is set to the value of the last call. +func (b *JSONSchemaPropsApplyConfiguration) WithXValidations(value v1.ValidationRules) *JSONSchemaPropsApplyConfiguration { + b.XValidations = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/selectablefield.go b/pkg/generated/applyconfigurations/apiextensions/v1/selectablefield.go new file mode 100644 index 00000000000..e03d8388ed1 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/selectablefield.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SelectableFieldApplyConfiguration represents an declarative configuration of the SelectableField type for use +// with apply. +type SelectableFieldApplyConfiguration struct { + JSONPath *string `json:"jsonPath,omitempty"` +} + +// SelectableFieldApplyConfiguration constructs an declarative configuration of the SelectableField type for use with +// apply. +func SelectableField() *SelectableFieldApplyConfiguration { + return &SelectableFieldApplyConfiguration{} +} + +// WithJSONPath sets the JSONPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the JSONPath field is set to the value of the last call. +func (b *SelectableFieldApplyConfiguration) WithJSONPath(value string) *SelectableFieldApplyConfiguration { + b.JSONPath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/servicereference.go b/pkg/generated/applyconfigurations/apiextensions/v1/servicereference.go new file mode 100644 index 00000000000..15f9b0c4d00 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/servicereference.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ServiceReferenceApplyConfiguration represents an declarative configuration of the ServiceReference type for use +// with apply. +type ServiceReferenceApplyConfiguration struct { + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` + Port *int32 `json:"port,omitempty"` +} + +// ServiceReferenceApplyConfiguration constructs an declarative configuration of the ServiceReference type for use with +// apply. +func ServiceReference() *ServiceReferenceApplyConfiguration { + return &ServiceReferenceApplyConfiguration{} +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceReferenceApplyConfiguration) WithNamespace(value string) *ServiceReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceReferenceApplyConfiguration) WithName(value string) *ServiceReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *ServiceReferenceApplyConfiguration) WithPath(value string) *ServiceReferenceApplyConfiguration { + b.Path = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *ServiceReferenceApplyConfiguration) WithPort(value int32) *ServiceReferenceApplyConfiguration { + b.Port = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/validationrule.go b/pkg/generated/applyconfigurations/apiextensions/v1/validationrule.go new file mode 100644 index 00000000000..b53056891a4 --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/validationrule.go @@ -0,0 +1,77 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" +) + +// ValidationRuleApplyConfiguration represents an declarative configuration of the ValidationRule type for use +// with apply. +type ValidationRuleApplyConfiguration struct { + Rule *string `json:"rule,omitempty"` + Message *string `json:"message,omitempty"` + MessageExpression *string `json:"messageExpression,omitempty"` + Reason *v1.FieldValueErrorReason `json:"reason,omitempty"` + FieldPath *string `json:"fieldPath,omitempty"` + OptionalOldSelf *bool `json:"optionalOldSelf,omitempty"` +} + +// ValidationRuleApplyConfiguration constructs an declarative configuration of the ValidationRule type for use with +// apply. +func ValidationRule() *ValidationRuleApplyConfiguration { + return &ValidationRuleApplyConfiguration{} +} + +// WithRule sets the Rule field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Rule field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithRule(value string) *ValidationRuleApplyConfiguration { + b.Rule = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithMessage(value string) *ValidationRuleApplyConfiguration { + b.Message = &value + return b +} + +// WithMessageExpression sets the MessageExpression field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MessageExpression field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithMessageExpression(value string) *ValidationRuleApplyConfiguration { + b.MessageExpression = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithReason(value v1.FieldValueErrorReason) *ValidationRuleApplyConfiguration { + b.Reason = &value + return b +} + +// WithFieldPath sets the FieldPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldPath field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithFieldPath(value string) *ValidationRuleApplyConfiguration { + b.FieldPath = &value + return b +} + +// WithOptionalOldSelf sets the OptionalOldSelf field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OptionalOldSelf field is set to the value of the last call. +func (b *ValidationRuleApplyConfiguration) WithOptionalOldSelf(value bool) *ValidationRuleApplyConfiguration { + b.OptionalOldSelf = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/webhookclientconfig.go b/pkg/generated/applyconfigurations/apiextensions/v1/webhookclientconfig.go new file mode 100644 index 00000000000..abe4eb0e85c --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/webhookclientconfig.go @@ -0,0 +1,48 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WebhookClientConfigApplyConfiguration represents an declarative configuration of the WebhookClientConfig type for use +// with apply. +type WebhookClientConfigApplyConfiguration struct { + URL *string `json:"url,omitempty"` + Service *ServiceReferenceApplyConfiguration `json:"service,omitempty"` + CABundle []byte `json:"caBundle,omitempty"` +} + +// WebhookClientConfigApplyConfiguration constructs an declarative configuration of the WebhookClientConfig type for use with +// apply. +func WebhookClientConfig() *WebhookClientConfigApplyConfiguration { + return &WebhookClientConfigApplyConfiguration{} +} + +// WithURL sets the URL field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the URL field is set to the value of the last call. +func (b *WebhookClientConfigApplyConfiguration) WithURL(value string) *WebhookClientConfigApplyConfiguration { + b.URL = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *WebhookClientConfigApplyConfiguration) WithService(value *ServiceReferenceApplyConfiguration) *WebhookClientConfigApplyConfiguration { + b.Service = value + return b +} + +// WithCABundle adds the given value to the CABundle field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CABundle field. +func (b *WebhookClientConfigApplyConfiguration) WithCABundle(values ...byte) *WebhookClientConfigApplyConfiguration { + for i := range values { + b.CABundle = append(b.CABundle, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/apiextensions/v1/webhookconversion.go b/pkg/generated/applyconfigurations/apiextensions/v1/webhookconversion.go new file mode 100644 index 00000000000..db4f66e8e3b --- /dev/null +++ b/pkg/generated/applyconfigurations/apiextensions/v1/webhookconversion.go @@ -0,0 +1,39 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WebhookConversionApplyConfiguration represents an declarative configuration of the WebhookConversion type for use +// with apply. +type WebhookConversionApplyConfiguration struct { + ClientConfig *WebhookClientConfigApplyConfiguration `json:"clientConfig,omitempty"` + ConversionReviewVersions []string `json:"conversionReviewVersions,omitempty"` +} + +// WebhookConversionApplyConfiguration constructs an declarative configuration of the WebhookConversion type for use with +// apply. +func WebhookConversion() *WebhookConversionApplyConfiguration { + return &WebhookConversionApplyConfiguration{} +} + +// WithClientConfig sets the ClientConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientConfig field is set to the value of the last call. +func (b *WebhookConversionApplyConfiguration) WithClientConfig(value *WebhookClientConfigApplyConfiguration) *WebhookConversionApplyConfiguration { + b.ClientConfig = value + return b +} + +// WithConversionReviewVersions adds the given value to the ConversionReviewVersions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ConversionReviewVersions field. +func (b *WebhookConversionApplyConfiguration) WithConversionReviewVersions(values ...string) *WebhookConversionApplyConfiguration { + for i := range values { + b.ConversionReviewVersions = append(b.ConversionReviewVersions, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/chain.go b/pkg/generated/applyconfigurations/apps/v1beta1/chain.go new file mode 100644 index 00000000000..9f44dfc6a8d --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/chain.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ChainApplyConfiguration represents an declarative configuration of the Chain type for use +// with apply. +type ChainApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ChainSpecApplyConfiguration `json:"spec,omitempty"` + Status *ChainStatusApplyConfiguration `json:"status,omitempty"` +} + +// Chain constructs an declarative configuration of the Chain type for use with +// apply. +func Chain(name, namespace string) *ChainApplyConfiguration { + b := &ChainApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Chain") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b +} + +// ExtractChain extracts the applied configuration owned by fieldManager from +// chain. If no managedFields are found in chain for fieldManager, a +// ChainApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// chain must be a unmodified Chain API object that was retrieved from the Kubernetes API. +// ExtractChain provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractChain(chain *appsv1beta1.Chain, fieldManager string) (*ChainApplyConfiguration, error) { + return extractChain(chain, fieldManager, "") +} + +// ExtractChainStatus is the same as ExtractChain except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractChainStatus(chain *appsv1beta1.Chain, fieldManager string) (*ChainApplyConfiguration, error) { + return extractChain(chain, fieldManager, "status") +} + +func extractChain(chain *appsv1beta1.Chain, fieldManager string, subresource string) (*ChainApplyConfiguration, error) { + b := &ChainApplyConfiguration{} + err := managedfields.ExtractInto(chain, internal.Parser().Type("com.github.superproj.onex.pkg.apis.apps.v1beta1.Chain"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(chain.Name) + b.WithNamespace(chain.Namespace) + + b.WithKind("Chain") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithKind(value string) *ChainApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithAPIVersion(value string) *ChainApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithName(value string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithGenerateName(value string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithNamespace(value string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithUID(value types.UID) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithResourceVersion(value string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithGeneration(value int64) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ChainApplyConfiguration) WithLabels(entries map[string]string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ChainApplyConfiguration) WithAnnotations(entries map[string]string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ChainApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ChainApplyConfiguration) WithFinalizers(values ...string) *ChainApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ChainApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithSpec(value *ChainSpecApplyConfiguration) *ChainApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ChainApplyConfiguration) WithStatus(value *ChainStatusApplyConfiguration) *ChainApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/chainspec.go b/pkg/generated/applyconfigurations/apps/v1beta1/chainspec.go new file mode 100644 index 00000000000..0a57d2ff572 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/chainspec.go @@ -0,0 +1,64 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ChainSpecApplyConfiguration represents an declarative configuration of the ChainSpec type for use +// with apply. +type ChainSpecApplyConfiguration struct { + DisplayName *string `json:"displayName,omitempty"` + MinerType *string `json:"minerType,omitempty"` + Image *string `json:"image,omitempty"` + MinMineIntervalSeconds *int32 `json:"minMineIntervalSeconds,omitempty"` + BootstrapAccount *string `json:"bootstrapAccount,omitempty"` +} + +// ChainSpecApplyConfiguration constructs an declarative configuration of the ChainSpec type for use with +// apply. +func ChainSpec() *ChainSpecApplyConfiguration { + return &ChainSpecApplyConfiguration{} +} + +// WithDisplayName sets the DisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisplayName field is set to the value of the last call. +func (b *ChainSpecApplyConfiguration) WithDisplayName(value string) *ChainSpecApplyConfiguration { + b.DisplayName = &value + return b +} + +// WithMinerType sets the MinerType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinerType field is set to the value of the last call. +func (b *ChainSpecApplyConfiguration) WithMinerType(value string) *ChainSpecApplyConfiguration { + b.MinerType = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ChainSpecApplyConfiguration) WithImage(value string) *ChainSpecApplyConfiguration { + b.Image = &value + return b +} + +// WithMinMineIntervalSeconds sets the MinMineIntervalSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinMineIntervalSeconds field is set to the value of the last call. +func (b *ChainSpecApplyConfiguration) WithMinMineIntervalSeconds(value int32) *ChainSpecApplyConfiguration { + b.MinMineIntervalSeconds = &value + return b +} + +// WithBootstrapAccount sets the BootstrapAccount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BootstrapAccount field is set to the value of the last call. +func (b *ChainSpecApplyConfiguration) WithBootstrapAccount(value string) *ChainSpecApplyConfiguration { + b.BootstrapAccount = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/chainstatus.go b/pkg/generated/applyconfigurations/apps/v1beta1/chainstatus.go new file mode 100644 index 00000000000..653b9d224df --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/chainstatus.go @@ -0,0 +1,59 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" +) + +// ChainStatusApplyConfiguration represents an declarative configuration of the ChainStatus type for use +// with apply. +type ChainStatusApplyConfiguration struct { + ConfigMapRef *LocalObjectReferenceApplyConfiguration `json:"configMapRef,omitempty"` + MinerRef *LocalObjectReferenceApplyConfiguration `json:"minerRef,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + Conditions *appsv1beta1.Conditions `json:"conditions,omitempty"` +} + +// ChainStatusApplyConfiguration constructs an declarative configuration of the ChainStatus type for use with +// apply. +func ChainStatus() *ChainStatusApplyConfiguration { + return &ChainStatusApplyConfiguration{} +} + +// WithConfigMapRef sets the ConfigMapRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMapRef field is set to the value of the last call. +func (b *ChainStatusApplyConfiguration) WithConfigMapRef(value *LocalObjectReferenceApplyConfiguration) *ChainStatusApplyConfiguration { + b.ConfigMapRef = value + return b +} + +// WithMinerRef sets the MinerRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinerRef field is set to the value of the last call. +func (b *ChainStatusApplyConfiguration) WithMinerRef(value *LocalObjectReferenceApplyConfiguration) *ChainStatusApplyConfiguration { + b.MinerRef = value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ChainStatusApplyConfiguration) WithObservedGeneration(value int64) *ChainStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *ChainStatusApplyConfiguration) WithConditions(value appsv1beta1.Conditions) *ChainStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/chargerequest.go b/pkg/generated/applyconfigurations/apps/v1beta1/chargerequest.go new file mode 100644 index 00000000000..3176396b31f --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/chargerequest.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ChargeRequestApplyConfiguration represents an declarative configuration of the ChargeRequest type for use +// with apply. +type ChargeRequestApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ChargeRequestSpecApplyConfiguration `json:"spec,omitempty"` + Status *ChargeRequestStatusApplyConfiguration `json:"status,omitempty"` +} + +// ChargeRequest constructs an declarative configuration of the ChargeRequest type for use with +// apply. +func ChargeRequest(name, namespace string) *ChargeRequestApplyConfiguration { + b := &ChargeRequestApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ChargeRequest") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b +} + +// ExtractChargeRequest extracts the applied configuration owned by fieldManager from +// chargeRequest. If no managedFields are found in chargeRequest for fieldManager, a +// ChargeRequestApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// chargeRequest must be a unmodified ChargeRequest API object that was retrieved from the Kubernetes API. +// ExtractChargeRequest provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractChargeRequest(chargeRequest *appsv1beta1.ChargeRequest, fieldManager string) (*ChargeRequestApplyConfiguration, error) { + return extractChargeRequest(chargeRequest, fieldManager, "") +} + +// ExtractChargeRequestStatus is the same as ExtractChargeRequest except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractChargeRequestStatus(chargeRequest *appsv1beta1.ChargeRequest, fieldManager string) (*ChargeRequestApplyConfiguration, error) { + return extractChargeRequest(chargeRequest, fieldManager, "status") +} + +func extractChargeRequest(chargeRequest *appsv1beta1.ChargeRequest, fieldManager string, subresource string) (*ChargeRequestApplyConfiguration, error) { + b := &ChargeRequestApplyConfiguration{} + err := managedfields.ExtractInto(chargeRequest, internal.Parser().Type("com.github.superproj.onex.pkg.apis.apps.v1beta1.ChargeRequest"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(chargeRequest.Name) + b.WithNamespace(chargeRequest.Namespace) + + b.WithKind("ChargeRequest") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithKind(value string) *ChargeRequestApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithAPIVersion(value string) *ChargeRequestApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithName(value string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithGenerateName(value string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithNamespace(value string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithUID(value types.UID) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithResourceVersion(value string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithGeneration(value int64) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ChargeRequestApplyConfiguration) WithLabels(entries map[string]string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ChargeRequestApplyConfiguration) WithAnnotations(entries map[string]string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ChargeRequestApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ChargeRequestApplyConfiguration) WithFinalizers(values ...string) *ChargeRequestApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ChargeRequestApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithSpec(value *ChargeRequestSpecApplyConfiguration) *ChargeRequestApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ChargeRequestApplyConfiguration) WithStatus(value *ChargeRequestStatusApplyConfiguration) *ChargeRequestApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/chargerequestspec.go b/pkg/generated/applyconfigurations/apps/v1beta1/chargerequestspec.go new file mode 100644 index 00000000000..e06a0085810 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/chargerequestspec.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ChargeRequestSpecApplyConfiguration represents an declarative configuration of the ChargeRequestSpec type for use +// with apply. +type ChargeRequestSpecApplyConfiguration struct { + From *string `json:"from,omitempty"` + Password *string `json:"password,omitempty"` +} + +// ChargeRequestSpecApplyConfiguration constructs an declarative configuration of the ChargeRequestSpec type for use with +// apply. +func ChargeRequestSpec() *ChargeRequestSpecApplyConfiguration { + return &ChargeRequestSpecApplyConfiguration{} +} + +// WithFrom sets the From field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the From field is set to the value of the last call. +func (b *ChargeRequestSpecApplyConfiguration) WithFrom(value string) *ChargeRequestSpecApplyConfiguration { + b.From = &value + return b +} + +// WithPassword sets the Password field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Password field is set to the value of the last call. +func (b *ChargeRequestSpecApplyConfiguration) WithPassword(value string) *ChargeRequestSpecApplyConfiguration { + b.Password = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/chargerequeststatus.go b/pkg/generated/applyconfigurations/apps/v1beta1/chargerequeststatus.go new file mode 100644 index 00000000000..2319bfba3bf --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/chargerequeststatus.go @@ -0,0 +1,32 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" +) + +// ChargeRequestStatusApplyConfiguration represents an declarative configuration of the ChargeRequestStatus type for use +// with apply. +type ChargeRequestStatusApplyConfiguration struct { + Conditions *v1beta1.Conditions `json:"conditions,omitempty"` +} + +// ChargeRequestStatusApplyConfiguration constructs an declarative configuration of the ChargeRequestStatus type for use with +// apply. +func ChargeRequestStatus() *ChargeRequestStatusApplyConfiguration { + return &ChargeRequestStatusApplyConfiguration{} +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *ChargeRequestStatusApplyConfiguration) WithConditions(value v1beta1.Conditions) *ChargeRequestStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/condition.go b/pkg/generated/applyconfigurations/apps/v1beta1/condition.go new file mode 100644 index 00000000000..12d3cdf48ed --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/condition.go @@ -0,0 +1,79 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ConditionApplyConfiguration represents an declarative configuration of the Condition type for use +// with apply. +type ConditionApplyConfiguration struct { + Type *v1beta1.ConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Severity *v1beta1.ConditionSeverity `json:"severity,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ConditionApplyConfiguration constructs an declarative configuration of the Condition type for use with +// apply. +func Condition() *ConditionApplyConfiguration { + return &ConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithType(value v1beta1.ConditionType) *ConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithSeverity sets the Severity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Severity field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithSeverity(value v1beta1.ConditionSeverity) *ConditionApplyConfiguration { + b.Severity = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithReason(value string) *ConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithMessage(value string) *ConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/localobjectreference.go b/pkg/generated/applyconfigurations/apps/v1beta1/localobjectreference.go new file mode 100644 index 00000000000..7b7afb15502 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/localobjectreference.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// LocalObjectReferenceApplyConfiguration represents an declarative configuration of the LocalObjectReference type for use +// with apply. +type LocalObjectReferenceApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// LocalObjectReferenceApplyConfiguration constructs an declarative configuration of the LocalObjectReference type for use with +// apply. +func LocalObjectReference() *LocalObjectReferenceApplyConfiguration { + return &LocalObjectReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LocalObjectReferenceApplyConfiguration) WithName(value string) *LocalObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/miner.go b/pkg/generated/applyconfigurations/apps/v1beta1/miner.go new file mode 100644 index 00000000000..5abfc5eee27 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/miner.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// MinerApplyConfiguration represents an declarative configuration of the Miner type for use +// with apply. +type MinerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MinerSpecApplyConfiguration `json:"spec,omitempty"` + Status *MinerStatusApplyConfiguration `json:"status,omitempty"` +} + +// Miner constructs an declarative configuration of the Miner type for use with +// apply. +func Miner(name, namespace string) *MinerApplyConfiguration { + b := &MinerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Miner") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b +} + +// ExtractMiner extracts the applied configuration owned by fieldManager from +// miner. If no managedFields are found in miner for fieldManager, a +// MinerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// miner must be a unmodified Miner API object that was retrieved from the Kubernetes API. +// ExtractMiner provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMiner(miner *appsv1beta1.Miner, fieldManager string) (*MinerApplyConfiguration, error) { + return extractMiner(miner, fieldManager, "") +} + +// ExtractMinerStatus is the same as ExtractMiner except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMinerStatus(miner *appsv1beta1.Miner, fieldManager string) (*MinerApplyConfiguration, error) { + return extractMiner(miner, fieldManager, "status") +} + +func extractMiner(miner *appsv1beta1.Miner, fieldManager string, subresource string) (*MinerApplyConfiguration, error) { + b := &MinerApplyConfiguration{} + err := managedfields.ExtractInto(miner, internal.Parser().Type("com.github.superproj.onex.pkg.apis.apps.v1beta1.Miner"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(miner.Name) + b.WithNamespace(miner.Namespace) + + b.WithKind("Miner") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithKind(value string) *MinerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithAPIVersion(value string) *MinerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithName(value string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithGenerateName(value string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithNamespace(value string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithUID(value types.UID) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithResourceVersion(value string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithGeneration(value int64) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MinerApplyConfiguration) WithLabels(entries map[string]string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MinerApplyConfiguration) WithAnnotations(entries map[string]string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MinerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MinerApplyConfiguration) WithFinalizers(values ...string) *MinerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *MinerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithSpec(value *MinerSpecApplyConfiguration) *MinerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MinerApplyConfiguration) WithStatus(value *MinerStatusApplyConfiguration) *MinerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/mineraddress.go b/pkg/generated/applyconfigurations/apps/v1beta1/mineraddress.go new file mode 100644 index 00000000000..f379569e517 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/mineraddress.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" +) + +// MinerAddressApplyConfiguration represents an declarative configuration of the MinerAddress type for use +// with apply. +type MinerAddressApplyConfiguration struct { + Type *v1beta1.MinerAddressType `json:"type,omitempty"` + Address *string `json:"address,omitempty"` +} + +// MinerAddressApplyConfiguration constructs an declarative configuration of the MinerAddress type for use with +// apply. +func MinerAddress() *MinerAddressApplyConfiguration { + return &MinerAddressApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *MinerAddressApplyConfiguration) WithType(value v1beta1.MinerAddressType) *MinerAddressApplyConfiguration { + b.Type = &value + return b +} + +// WithAddress sets the Address field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Address field is set to the value of the last call. +func (b *MinerAddressApplyConfiguration) WithAddress(value string) *MinerAddressApplyConfiguration { + b.Address = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/minerset.go b/pkg/generated/applyconfigurations/apps/v1beta1/minerset.go new file mode 100644 index 00000000000..7bb5571a217 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/minerset.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// MinerSetApplyConfiguration represents an declarative configuration of the MinerSet type for use +// with apply. +type MinerSetApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MinerSetSpecApplyConfiguration `json:"spec,omitempty"` + Status *MinerSetStatusApplyConfiguration `json:"status,omitempty"` +} + +// MinerSet constructs an declarative configuration of the MinerSet type for use with +// apply. +func MinerSet(name, namespace string) *MinerSetApplyConfiguration { + b := &MinerSetApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("MinerSet") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b +} + +// ExtractMinerSet extracts the applied configuration owned by fieldManager from +// minerSet. If no managedFields are found in minerSet for fieldManager, a +// MinerSetApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// minerSet must be a unmodified MinerSet API object that was retrieved from the Kubernetes API. +// ExtractMinerSet provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractMinerSet(minerSet *appsv1beta1.MinerSet, fieldManager string) (*MinerSetApplyConfiguration, error) { + return extractMinerSet(minerSet, fieldManager, "") +} + +// ExtractMinerSetStatus is the same as ExtractMinerSet except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractMinerSetStatus(minerSet *appsv1beta1.MinerSet, fieldManager string) (*MinerSetApplyConfiguration, error) { + return extractMinerSet(minerSet, fieldManager, "status") +} + +func extractMinerSet(minerSet *appsv1beta1.MinerSet, fieldManager string, subresource string) (*MinerSetApplyConfiguration, error) { + b := &MinerSetApplyConfiguration{} + err := managedfields.ExtractInto(minerSet, internal.Parser().Type("com.github.superproj.onex.pkg.apis.apps.v1beta1.MinerSet"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(minerSet.Name) + b.WithNamespace(minerSet.Namespace) + + b.WithKind("MinerSet") + b.WithAPIVersion("apps.onex.io/v1beta1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithKind(value string) *MinerSetApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithAPIVersion(value string) *MinerSetApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithName(value string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithGenerateName(value string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithNamespace(value string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithUID(value types.UID) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithResourceVersion(value string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithGeneration(value int64) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithCreationTimestamp(value metav1.Time) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MinerSetApplyConfiguration) WithLabels(entries map[string]string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MinerSetApplyConfiguration) WithAnnotations(entries map[string]string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *MinerSetApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *MinerSetApplyConfiguration) WithFinalizers(values ...string) *MinerSetApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *MinerSetApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithSpec(value *MinerSetSpecApplyConfiguration) *MinerSetApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *MinerSetApplyConfiguration) WithStatus(value *MinerSetStatusApplyConfiguration) *MinerSetApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/minersetspec.go b/pkg/generated/applyconfigurations/apps/v1beta1/minersetspec.go new file mode 100644 index 00000000000..934417dd61a --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/minersetspec.go @@ -0,0 +1,86 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" +) + +// MinerSetSpecApplyConfiguration represents an declarative configuration of the MinerSetSpec type for use +// with apply. +type MinerSetSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + Selector *v1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + Template *MinerTemplateSpecApplyConfiguration `json:"template,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DeletePolicy *string `json:"deletePolicy,omitempty"` + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` +} + +// MinerSetSpecApplyConfiguration constructs an declarative configuration of the MinerSetSpec type for use with +// apply. +func MinerSetSpec() *MinerSetSpecApplyConfiguration { + return &MinerSetSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithReplicas(value int32) *MinerSetSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithSelector(value *v1.LabelSelectorApplyConfiguration) *MinerSetSpecApplyConfiguration { + b.Selector = value + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithTemplate(value *MinerTemplateSpecApplyConfiguration) *MinerSetSpecApplyConfiguration { + b.Template = value + return b +} + +// WithDisplayName sets the DisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisplayName field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithDisplayName(value string) *MinerSetSpecApplyConfiguration { + b.DisplayName = &value + return b +} + +// WithDeletePolicy sets the DeletePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletePolicy field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithDeletePolicy(value string) *MinerSetSpecApplyConfiguration { + b.DeletePolicy = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithMinReadySeconds(value int32) *MinerSetSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithProgressDeadlineSeconds sets the ProgressDeadlineSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProgressDeadlineSeconds field is set to the value of the last call. +func (b *MinerSetSpecApplyConfiguration) WithProgressDeadlineSeconds(value int32) *MinerSetSpecApplyConfiguration { + b.ProgressDeadlineSeconds = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/minersetstatus.go b/pkg/generated/applyconfigurations/apps/v1beta1/minersetstatus.go new file mode 100644 index 00000000000..e700d13c9f0 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/minersetstatus.go @@ -0,0 +1,96 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + errors "github.com/superproj/onex/pkg/errors" +) + +// MinerSetStatusApplyConfiguration represents an declarative configuration of the MinerSetStatus type for use +// with apply. +type MinerSetStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + FailureReason *errors.MinerSetStatusError `json:"failureReason,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` + Conditions *v1beta1.Conditions `json:"conditions,omitempty"` +} + +// MinerSetStatusApplyConfiguration constructs an declarative configuration of the MinerSetStatus type for use with +// apply. +func MinerSetStatus() *MinerSetStatusApplyConfiguration { + return &MinerSetStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithReplicas(value int32) *MinerSetStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *MinerSetStatusApplyConfiguration { + b.FullyLabeledReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithReadyReplicas(value int32) *MinerSetStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithAvailableReplicas(value int32) *MinerSetStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithObservedGeneration(value int64) *MinerSetStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithFailureReason(value errors.MinerSetStatusError) *MinerSetStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithFailureMessage(value string) *MinerSetStatusApplyConfiguration { + b.FailureMessage = &value + return b +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MinerSetStatusApplyConfiguration) WithConditions(value v1beta1.Conditions) *MinerSetStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/minerspec.go b/pkg/generated/applyconfigurations/apps/v1beta1/minerspec.go new file mode 100644 index 00000000000..1f0de3906fa --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/minerspec.go @@ -0,0 +1,106 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// MinerSpecApplyConfiguration represents an declarative configuration of the MinerSpec type for use +// with apply. +type MinerSpecApplyConfiguration struct { + *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + MinerType *string `json:"minerType,omitempty"` + ChainName *string `json:"chainName,omitempty"` + RestartPolicy *v1.RestartPolicy `json:"restartPolicy,omitempty"` + PodDeletionTimeout *metav1.Duration `json:"podDeletionTimeout,omitempty"` +} + +// MinerSpecApplyConfiguration constructs an declarative configuration of the MinerSpec type for use with +// apply. +func MinerSpec() *MinerSpecApplyConfiguration { + return &MinerSpecApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MinerSpecApplyConfiguration) WithLabels(entries map[string]string) *MinerSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MinerSpecApplyConfiguration) WithAnnotations(entries map[string]string) *MinerSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +func (b *MinerSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &ObjectMetaApplyConfiguration{} + } +} + +// WithDisplayName sets the DisplayName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DisplayName field is set to the value of the last call. +func (b *MinerSpecApplyConfiguration) WithDisplayName(value string) *MinerSpecApplyConfiguration { + b.DisplayName = &value + return b +} + +// WithMinerType sets the MinerType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinerType field is set to the value of the last call. +func (b *MinerSpecApplyConfiguration) WithMinerType(value string) *MinerSpecApplyConfiguration { + b.MinerType = &value + return b +} + +// WithChainName sets the ChainName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ChainName field is set to the value of the last call. +func (b *MinerSpecApplyConfiguration) WithChainName(value string) *MinerSpecApplyConfiguration { + b.ChainName = &value + return b +} + +// WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartPolicy field is set to the value of the last call. +func (b *MinerSpecApplyConfiguration) WithRestartPolicy(value v1.RestartPolicy) *MinerSpecApplyConfiguration { + b.RestartPolicy = &value + return b +} + +// WithPodDeletionTimeout sets the PodDeletionTimeout field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodDeletionTimeout field is set to the value of the last call. +func (b *MinerSpecApplyConfiguration) WithPodDeletionTimeout(value metav1.Duration) *MinerSpecApplyConfiguration { + b.PodDeletionTimeout = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/minerstatus.go b/pkg/generated/applyconfigurations/apps/v1beta1/minerstatus.go new file mode 100644 index 00000000000..ec9acedb031 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/minerstatus.go @@ -0,0 +1,98 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + errors "github.com/superproj/onex/pkg/errors" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// MinerStatusApplyConfiguration represents an declarative configuration of the MinerStatus type for use +// with apply. +type MinerStatusApplyConfiguration struct { + PodRef *v1.ObjectReferenceApplyConfiguration `json:"podRef,omitempty"` + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + FailureReason *errors.MinerStatusError `json:"failureReason,omitempty"` + FailureMessage *string `json:"failureMessage,omitempty"` + Addresses *v1beta1.MinerAddresses `json:"addresses,omitempty"` + Phase *string `json:"phase,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + Conditions *v1beta1.Conditions `json:"conditions,omitempty"` +} + +// MinerStatusApplyConfiguration constructs an declarative configuration of the MinerStatus type for use with +// apply. +func MinerStatus() *MinerStatusApplyConfiguration { + return &MinerStatusApplyConfiguration{} +} + +// WithPodRef sets the PodRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodRef field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithPodRef(value *v1.ObjectReferenceApplyConfiguration) *MinerStatusApplyConfiguration { + b.PodRef = value + return b +} + +// WithLastUpdated sets the LastUpdated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastUpdated field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithLastUpdated(value metav1.Time) *MinerStatusApplyConfiguration { + b.LastUpdated = &value + return b +} + +// WithFailureReason sets the FailureReason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureReason field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithFailureReason(value errors.MinerStatusError) *MinerStatusApplyConfiguration { + b.FailureReason = &value + return b +} + +// WithFailureMessage sets the FailureMessage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureMessage field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithFailureMessage(value string) *MinerStatusApplyConfiguration { + b.FailureMessage = &value + return b +} + +// WithAddresses sets the Addresses field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Addresses field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithAddresses(value v1beta1.MinerAddresses) *MinerStatusApplyConfiguration { + b.Addresses = &value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithPhase(value string) *MinerStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithObservedGeneration(value int64) *MinerStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithConditions sets the Conditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Conditions field is set to the value of the last call. +func (b *MinerStatusApplyConfiguration) WithConditions(value v1beta1.Conditions) *MinerStatusApplyConfiguration { + b.Conditions = &value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/minertemplatespec.go b/pkg/generated/applyconfigurations/apps/v1beta1/minertemplatespec.go new file mode 100644 index 00000000000..764730b8450 --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/minertemplatespec.go @@ -0,0 +1,65 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// MinerTemplateSpecApplyConfiguration represents an declarative configuration of the MinerTemplateSpec type for use +// with apply. +type MinerTemplateSpecApplyConfiguration struct { + *ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *MinerSpecApplyConfiguration `json:"spec,omitempty"` +} + +// MinerTemplateSpecApplyConfiguration constructs an declarative configuration of the MinerTemplateSpec type for use with +// apply. +func MinerTemplateSpec() *MinerTemplateSpecApplyConfiguration { + return &MinerTemplateSpecApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *MinerTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *MinerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *MinerTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *MinerTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +func (b *MinerTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *MinerTemplateSpecApplyConfiguration) WithSpec(value *MinerSpecApplyConfiguration) *MinerTemplateSpecApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfigurations/apps/v1beta1/objectmeta.go b/pkg/generated/applyconfigurations/apps/v1beta1/objectmeta.go new file mode 100644 index 00000000000..fb5cf7f56dd --- /dev/null +++ b/pkg/generated/applyconfigurations/apps/v1beta1/objectmeta.go @@ -0,0 +1,49 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1beta1 + +// ObjectMetaApplyConfiguration represents an declarative configuration of the ObjectMeta type for use +// with apply. +type ObjectMetaApplyConfiguration struct { + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with +// apply. +func ObjectMeta() *ObjectMetaApplyConfiguration { + return &ObjectMetaApplyConfiguration{} +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/crossversionobjectreference.go b/pkg/generated/applyconfigurations/autoscaling/v1/crossversionobjectreference.go new file mode 100644 index 00000000000..c9141b2b068 --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/crossversionobjectreference.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CrossVersionObjectReferenceApplyConfiguration represents an declarative configuration of the CrossVersionObjectReference type for use +// with apply. +type CrossVersionObjectReferenceApplyConfiguration struct { + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` +} + +// CrossVersionObjectReferenceApplyConfiguration constructs an declarative configuration of the CrossVersionObjectReference type for use with +// apply. +func CrossVersionObjectReference() *CrossVersionObjectReferenceApplyConfiguration { + return &CrossVersionObjectReferenceApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *CrossVersionObjectReferenceApplyConfiguration) WithKind(value string) *CrossVersionObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *CrossVersionObjectReferenceApplyConfiguration) WithName(value string) *CrossVersionObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *CrossVersionObjectReferenceApplyConfiguration) WithAPIVersion(value string) *CrossVersionObjectReferenceApplyConfiguration { + b.APIVersion = &value + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go b/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go new file mode 100644 index 00000000000..b66305fdc40 --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscaler.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apiautoscalingv1 "k8s.io/api/autoscaling/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// HorizontalPodAutoscalerApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscaler type for use +// with apply. +type HorizontalPodAutoscalerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *HorizontalPodAutoscalerSpecApplyConfiguration `json:"spec,omitempty"` + Status *HorizontalPodAutoscalerStatusApplyConfiguration `json:"status,omitempty"` +} + +// HorizontalPodAutoscaler constructs an declarative configuration of the HorizontalPodAutoscaler type for use with +// apply. +func HorizontalPodAutoscaler(name, namespace string) *HorizontalPodAutoscalerApplyConfiguration { + b := &HorizontalPodAutoscalerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("HorizontalPodAutoscaler") + b.WithAPIVersion("autoscaling/v1") + return b +} + +// ExtractHorizontalPodAutoscaler extracts the applied configuration owned by fieldManager from +// horizontalPodAutoscaler. If no managedFields are found in horizontalPodAutoscaler for fieldManager, a +// HorizontalPodAutoscalerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// horizontalPodAutoscaler must be a unmodified HorizontalPodAutoscaler API object that was retrieved from the Kubernetes API. +// ExtractHorizontalPodAutoscaler provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractHorizontalPodAutoscaler(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "") +} + +// ExtractHorizontalPodAutoscalerStatus is the same as ExtractHorizontalPodAutoscaler except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractHorizontalPodAutoscalerStatus(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + return extractHorizontalPodAutoscaler(horizontalPodAutoscaler, fieldManager, "status") +} + +func extractHorizontalPodAutoscaler(horizontalPodAutoscaler *apiautoscalingv1.HorizontalPodAutoscaler, fieldManager string, subresource string) (*HorizontalPodAutoscalerApplyConfiguration, error) { + b := &HorizontalPodAutoscalerApplyConfiguration{} + err := managedfields.ExtractInto(horizontalPodAutoscaler, internal.Parser().Type("io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(horizontalPodAutoscaler.Name) + b.WithNamespace(horizontalPodAutoscaler.Namespace) + + b.WithKind("HorizontalPodAutoscaler") + b.WithAPIVersion("autoscaling/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithKind(value string) *HorizontalPodAutoscalerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithAPIVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithName(value string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithGenerateName(value string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithNamespace(value string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithUID(value types.UID) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithResourceVersion(value string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithGeneration(value int64) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithLabels(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithAnnotations(entries map[string]string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithFinalizers(values ...string) *HorizontalPodAutoscalerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *HorizontalPodAutoscalerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithSpec(value *HorizontalPodAutoscalerSpecApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *HorizontalPodAutoscalerApplyConfiguration) WithStatus(value *HorizontalPodAutoscalerStatusApplyConfiguration) *HorizontalPodAutoscalerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go b/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go new file mode 100644 index 00000000000..1575574405e --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscalerspec.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HorizontalPodAutoscalerSpecApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerSpec type for use +// with apply. +type HorizontalPodAutoscalerSpecApplyConfiguration struct { + ScaleTargetRef *CrossVersionObjectReferenceApplyConfiguration `json:"scaleTargetRef,omitempty"` + MinReplicas *int32 `json:"minReplicas,omitempty"` + MaxReplicas *int32 `json:"maxReplicas,omitempty"` + TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty"` +} + +// HorizontalPodAutoscalerSpecApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerSpec type for use with +// apply. +func HorizontalPodAutoscalerSpec() *HorizontalPodAutoscalerSpecApplyConfiguration { + return &HorizontalPodAutoscalerSpecApplyConfiguration{} +} + +// WithScaleTargetRef sets the ScaleTargetRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScaleTargetRef field is set to the value of the last call. +func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithScaleTargetRef(value *CrossVersionObjectReferenceApplyConfiguration) *HorizontalPodAutoscalerSpecApplyConfiguration { + b.ScaleTargetRef = value + return b +} + +// WithMinReplicas sets the MinReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReplicas field is set to the value of the last call. +func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMinReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { + b.MinReplicas = &value + return b +} + +// WithMaxReplicas sets the MaxReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxReplicas field is set to the value of the last call. +func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithMaxReplicas(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { + b.MaxReplicas = &value + return b +} + +// WithTargetCPUUtilizationPercentage sets the TargetCPUUtilizationPercentage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetCPUUtilizationPercentage field is set to the value of the last call. +func (b *HorizontalPodAutoscalerSpecApplyConfiguration) WithTargetCPUUtilizationPercentage(value int32) *HorizontalPodAutoscalerSpecApplyConfiguration { + b.TargetCPUUtilizationPercentage = &value + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go b/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go new file mode 100644 index 00000000000..483e8c18a4e --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/horizontalpodautoscalerstatus.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// HorizontalPodAutoscalerStatusApplyConfiguration represents an declarative configuration of the HorizontalPodAutoscalerStatus type for use +// with apply. +type HorizontalPodAutoscalerStatusApplyConfiguration struct { + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + LastScaleTime *v1.Time `json:"lastScaleTime,omitempty"` + CurrentReplicas *int32 `json:"currentReplicas,omitempty"` + DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` + CurrentCPUUtilizationPercentage *int32 `json:"currentCPUUtilizationPercentage,omitempty"` +} + +// HorizontalPodAutoscalerStatusApplyConfiguration constructs an declarative configuration of the HorizontalPodAutoscalerStatus type for use with +// apply. +func HorizontalPodAutoscalerStatus() *HorizontalPodAutoscalerStatusApplyConfiguration { + return &HorizontalPodAutoscalerStatusApplyConfiguration{} +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithObservedGeneration(value int64) *HorizontalPodAutoscalerStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithLastScaleTime sets the LastScaleTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastScaleTime field is set to the value of the last call. +func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithLastScaleTime(value v1.Time) *HorizontalPodAutoscalerStatusApplyConfiguration { + b.LastScaleTime = &value + return b +} + +// WithCurrentReplicas sets the CurrentReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentReplicas field is set to the value of the last call. +func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { + b.CurrentReplicas = &value + return b +} + +// WithDesiredReplicas sets the DesiredReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DesiredReplicas field is set to the value of the last call. +func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithDesiredReplicas(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { + b.DesiredReplicas = &value + return b +} + +// WithCurrentCPUUtilizationPercentage sets the CurrentCPUUtilizationPercentage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentCPUUtilizationPercentage field is set to the value of the last call. +func (b *HorizontalPodAutoscalerStatusApplyConfiguration) WithCurrentCPUUtilizationPercentage(value int32) *HorizontalPodAutoscalerStatusApplyConfiguration { + b.CurrentCPUUtilizationPercentage = &value + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/scale.go b/pkg/generated/applyconfigurations/autoscaling/v1/scale.go new file mode 100644 index 00000000000..ee178403c17 --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/scale.go @@ -0,0 +1,206 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// ScaleApplyConfiguration represents an declarative configuration of the Scale type for use +// with apply. +type ScaleApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ScaleSpecApplyConfiguration `json:"spec,omitempty"` + Status *ScaleStatusApplyConfiguration `json:"status,omitempty"` +} + +// ScaleApplyConfiguration constructs an declarative configuration of the Scale type for use with +// apply. +func Scale() *ScaleApplyConfiguration { + b := &ScaleApplyConfiguration{} + b.WithKind("Scale") + b.WithAPIVersion("autoscaling/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithKind(value string) *ScaleApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithAPIVersion(value string) *ScaleApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGenerateName(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithNamespace(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithUID(value types.UID) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithResourceVersion(value string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithGeneration(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ScaleApplyConfiguration) WithLabels(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ScaleApplyConfiguration) WithAnnotations(entries map[string]string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ScaleApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ScaleApplyConfiguration) WithFinalizers(values ...string) *ScaleApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ScaleApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithSpec(value *ScaleSpecApplyConfiguration) *ScaleApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ScaleApplyConfiguration) WithStatus(value *ScaleStatusApplyConfiguration) *ScaleApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/scalespec.go b/pkg/generated/applyconfigurations/autoscaling/v1/scalespec.go new file mode 100644 index 00000000000..ed0500e42f9 --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/scalespec.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScaleSpecApplyConfiguration represents an declarative configuration of the ScaleSpec type for use +// with apply. +type ScaleSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` +} + +// ScaleSpecApplyConfiguration constructs an declarative configuration of the ScaleSpec type for use with +// apply. +func ScaleSpec() *ScaleSpecApplyConfiguration { + return &ScaleSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ScaleSpecApplyConfiguration) WithReplicas(value int32) *ScaleSpecApplyConfiguration { + b.Replicas = &value + return b +} diff --git a/pkg/generated/applyconfigurations/autoscaling/v1/scalestatus.go b/pkg/generated/applyconfigurations/autoscaling/v1/scalestatus.go new file mode 100644 index 00000000000..23017a50472 --- /dev/null +++ b/pkg/generated/applyconfigurations/autoscaling/v1/scalestatus.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScaleStatusApplyConfiguration represents an declarative configuration of the ScaleStatus type for use +// with apply. +type ScaleStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + Selector *string `json:"selector,omitempty"` +} + +// ScaleStatusApplyConfiguration constructs an declarative configuration of the ScaleStatus type for use with +// apply. +func ScaleStatus() *ScaleStatusApplyConfiguration { + return &ScaleStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ScaleStatusApplyConfiguration) WithReplicas(value int32) *ScaleStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *ScaleStatusApplyConfiguration) WithSelector(value string) *ScaleStatusApplyConfiguration { + b.Selector = &value + return b +} diff --git a/pkg/generated/applyconfigurations/coordination/v1/lease.go b/pkg/generated/applyconfigurations/coordination/v1/lease.go new file mode 100644 index 00000000000..86ac36cf830 --- /dev/null +++ b/pkg/generated/applyconfigurations/coordination/v1/lease.go @@ -0,0 +1,238 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicoordinationv1 "k8s.io/api/coordination/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// LeaseApplyConfiguration represents an declarative configuration of the Lease type for use +// with apply. +type LeaseApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *LeaseSpecApplyConfiguration `json:"spec,omitempty"` +} + +// Lease constructs an declarative configuration of the Lease type for use with +// apply. +func Lease(name, namespace string) *LeaseApplyConfiguration { + b := &LeaseApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Lease") + b.WithAPIVersion("coordination.k8s.io/v1") + return b +} + +// ExtractLease extracts the applied configuration owned by fieldManager from +// lease. If no managedFields are found in lease for fieldManager, a +// LeaseApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// lease must be a unmodified Lease API object that was retrieved from the Kubernetes API. +// ExtractLease provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLease(lease *apicoordinationv1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { + return extractLease(lease, fieldManager, "") +} + +// ExtractLeaseStatus is the same as ExtractLease except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLeaseStatus(lease *apicoordinationv1.Lease, fieldManager string) (*LeaseApplyConfiguration, error) { + return extractLease(lease, fieldManager, "status") +} + +func extractLease(lease *apicoordinationv1.Lease, fieldManager string, subresource string) (*LeaseApplyConfiguration, error) { + b := &LeaseApplyConfiguration{} + err := managedfields.ExtractInto(lease, internal.Parser().Type("io.k8s.api.coordination.v1.Lease"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(lease.Name) + b.WithNamespace(lease.Namespace) + + b.WithKind("Lease") + b.WithAPIVersion("coordination.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithKind(value string) *LeaseApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithAPIVersion(value string) *LeaseApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithName(value string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithGenerateName(value string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithNamespace(value string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithUID(value types.UID) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithResourceVersion(value string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithGeneration(value int64) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *LeaseApplyConfiguration) WithLabels(entries map[string]string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *LeaseApplyConfiguration) WithAnnotations(entries map[string]string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *LeaseApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *LeaseApplyConfiguration) WithFinalizers(values ...string) *LeaseApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *LeaseApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *LeaseApplyConfiguration) WithSpec(value *LeaseSpecApplyConfiguration) *LeaseApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfigurations/coordination/v1/leasespec.go b/pkg/generated/applyconfigurations/coordination/v1/leasespec.go new file mode 100644 index 00000000000..fbfe93d0973 --- /dev/null +++ b/pkg/generated/applyconfigurations/coordination/v1/leasespec.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LeaseSpecApplyConfiguration represents an declarative configuration of the LeaseSpec type for use +// with apply. +type LeaseSpecApplyConfiguration struct { + HolderIdentity *string `json:"holderIdentity,omitempty"` + LeaseDurationSeconds *int32 `json:"leaseDurationSeconds,omitempty"` + AcquireTime *v1.MicroTime `json:"acquireTime,omitempty"` + RenewTime *v1.MicroTime `json:"renewTime,omitempty"` + LeaseTransitions *int32 `json:"leaseTransitions,omitempty"` +} + +// LeaseSpecApplyConfiguration constructs an declarative configuration of the LeaseSpec type for use with +// apply. +func LeaseSpec() *LeaseSpecApplyConfiguration { + return &LeaseSpecApplyConfiguration{} +} + +// WithHolderIdentity sets the HolderIdentity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HolderIdentity field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithHolderIdentity(value string) *LeaseSpecApplyConfiguration { + b.HolderIdentity = &value + return b +} + +// WithLeaseDurationSeconds sets the LeaseDurationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LeaseDurationSeconds field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithLeaseDurationSeconds(value int32) *LeaseSpecApplyConfiguration { + b.LeaseDurationSeconds = &value + return b +} + +// WithAcquireTime sets the AcquireTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AcquireTime field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithAcquireTime(value v1.MicroTime) *LeaseSpecApplyConfiguration { + b.AcquireTime = &value + return b +} + +// WithRenewTime sets the RenewTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RenewTime field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithRenewTime(value v1.MicroTime) *LeaseSpecApplyConfiguration { + b.RenewTime = &value + return b +} + +// WithLeaseTransitions sets the LeaseTransitions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LeaseTransitions field is set to the value of the last call. +func (b *LeaseSpecApplyConfiguration) WithLeaseTransitions(value int32) *LeaseSpecApplyConfiguration { + b.LeaseTransitions = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/affinity.go b/pkg/generated/applyconfigurations/core/v1/affinity.go new file mode 100644 index 00000000000..bba64a1fbfb --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/affinity.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AffinityApplyConfiguration represents an declarative configuration of the Affinity type for use +// with apply. +type AffinityApplyConfiguration struct { + NodeAffinity *NodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` + PodAffinity *PodAffinityApplyConfiguration `json:"podAffinity,omitempty"` + PodAntiAffinity *PodAntiAffinityApplyConfiguration `json:"podAntiAffinity,omitempty"` +} + +// AffinityApplyConfiguration constructs an declarative configuration of the Affinity type for use with +// apply. +func Affinity() *AffinityApplyConfiguration { + return &AffinityApplyConfiguration{} +} + +// WithNodeAffinity sets the NodeAffinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeAffinity field is set to the value of the last call. +func (b *AffinityApplyConfiguration) WithNodeAffinity(value *NodeAffinityApplyConfiguration) *AffinityApplyConfiguration { + b.NodeAffinity = value + return b +} + +// WithPodAffinity sets the PodAffinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodAffinity field is set to the value of the last call. +func (b *AffinityApplyConfiguration) WithPodAffinity(value *PodAffinityApplyConfiguration) *AffinityApplyConfiguration { + b.PodAffinity = value + return b +} + +// WithPodAntiAffinity sets the PodAntiAffinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodAntiAffinity field is set to the value of the last call. +func (b *AffinityApplyConfiguration) WithPodAntiAffinity(value *PodAntiAffinityApplyConfiguration) *AffinityApplyConfiguration { + b.PodAntiAffinity = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/apparmorprofile.go b/pkg/generated/applyconfigurations/core/v1/apparmorprofile.go new file mode 100644 index 00000000000..f58262649f0 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/apparmorprofile.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// AppArmorProfileApplyConfiguration represents an declarative configuration of the AppArmorProfile type for use +// with apply. +type AppArmorProfileApplyConfiguration struct { + Type *v1.AppArmorProfileType `json:"type,omitempty"` + LocalhostProfile *string `json:"localhostProfile,omitempty"` +} + +// AppArmorProfileApplyConfiguration constructs an declarative configuration of the AppArmorProfile type for use with +// apply. +func AppArmorProfile() *AppArmorProfileApplyConfiguration { + return &AppArmorProfileApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *AppArmorProfileApplyConfiguration) WithType(value v1.AppArmorProfileType) *AppArmorProfileApplyConfiguration { + b.Type = &value + return b +} + +// WithLocalhostProfile sets the LocalhostProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LocalhostProfile field is set to the value of the last call. +func (b *AppArmorProfileApplyConfiguration) WithLocalhostProfile(value string) *AppArmorProfileApplyConfiguration { + b.LocalhostProfile = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/attachedvolume.go b/pkg/generated/applyconfigurations/core/v1/attachedvolume.go new file mode 100644 index 00000000000..9925bf2439c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/attachedvolume.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// AttachedVolumeApplyConfiguration represents an declarative configuration of the AttachedVolume type for use +// with apply. +type AttachedVolumeApplyConfiguration struct { + Name *v1.UniqueVolumeName `json:"name,omitempty"` + DevicePath *string `json:"devicePath,omitempty"` +} + +// AttachedVolumeApplyConfiguration constructs an declarative configuration of the AttachedVolume type for use with +// apply. +func AttachedVolume() *AttachedVolumeApplyConfiguration { + return &AttachedVolumeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *AttachedVolumeApplyConfiguration) WithName(value v1.UniqueVolumeName) *AttachedVolumeApplyConfiguration { + b.Name = &value + return b +} + +// WithDevicePath sets the DevicePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DevicePath field is set to the value of the last call. +func (b *AttachedVolumeApplyConfiguration) WithDevicePath(value string) *AttachedVolumeApplyConfiguration { + b.DevicePath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/awselasticblockstorevolumesource.go b/pkg/generated/applyconfigurations/core/v1/awselasticblockstorevolumesource.go new file mode 100644 index 00000000000..fce0029801b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/awselasticblockstorevolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AWSElasticBlockStoreVolumeSourceApplyConfiguration represents an declarative configuration of the AWSElasticBlockStoreVolumeSource type for use +// with apply. +type AWSElasticBlockStoreVolumeSourceApplyConfiguration struct { + VolumeID *string `json:"volumeID,omitempty"` + FSType *string `json:"fsType,omitempty"` + Partition *int32 `json:"partition,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// AWSElasticBlockStoreVolumeSourceApplyConfiguration constructs an declarative configuration of the AWSElasticBlockStoreVolumeSource type for use with +// apply. +func AWSElasticBlockStoreVolumeSource() *AWSElasticBlockStoreVolumeSourceApplyConfiguration { + return &AWSElasticBlockStoreVolumeSourceApplyConfiguration{} +} + +// WithVolumeID sets the VolumeID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeID field is set to the value of the last call. +func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithVolumeID(value string) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { + b.VolumeID = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithFSType(value string) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithPartition sets the Partition field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Partition field is set to the value of the last call. +func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithPartition(value int32) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { + b.Partition = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *AWSElasticBlockStoreVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AWSElasticBlockStoreVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/azurediskvolumesource.go b/pkg/generated/applyconfigurations/core/v1/azurediskvolumesource.go new file mode 100644 index 00000000000..e6aaaaaa7ff --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/azurediskvolumesource.go @@ -0,0 +1,77 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// AzureDiskVolumeSourceApplyConfiguration represents an declarative configuration of the AzureDiskVolumeSource type for use +// with apply. +type AzureDiskVolumeSourceApplyConfiguration struct { + DiskName *string `json:"diskName,omitempty"` + DataDiskURI *string `json:"diskURI,omitempty"` + CachingMode *v1.AzureDataDiskCachingMode `json:"cachingMode,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Kind *v1.AzureDataDiskKind `json:"kind,omitempty"` +} + +// AzureDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the AzureDiskVolumeSource type for use with +// apply. +func AzureDiskVolumeSource() *AzureDiskVolumeSourceApplyConfiguration { + return &AzureDiskVolumeSourceApplyConfiguration{} +} + +// WithDiskName sets the DiskName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DiskName field is set to the value of the last call. +func (b *AzureDiskVolumeSourceApplyConfiguration) WithDiskName(value string) *AzureDiskVolumeSourceApplyConfiguration { + b.DiskName = &value + return b +} + +// WithDataDiskURI sets the DataDiskURI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DataDiskURI field is set to the value of the last call. +func (b *AzureDiskVolumeSourceApplyConfiguration) WithDataDiskURI(value string) *AzureDiskVolumeSourceApplyConfiguration { + b.DataDiskURI = &value + return b +} + +// WithCachingMode sets the CachingMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CachingMode field is set to the value of the last call. +func (b *AzureDiskVolumeSourceApplyConfiguration) WithCachingMode(value v1.AzureDataDiskCachingMode) *AzureDiskVolumeSourceApplyConfiguration { + b.CachingMode = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *AzureDiskVolumeSourceApplyConfiguration) WithFSType(value string) *AzureDiskVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *AzureDiskVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AzureDiskVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *AzureDiskVolumeSourceApplyConfiguration) WithKind(value v1.AzureDataDiskKind) *AzureDiskVolumeSourceApplyConfiguration { + b.Kind = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/azurefilepersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/azurefilepersistentvolumesource.go new file mode 100644 index 00000000000..24a24ba5cba --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/azurefilepersistentvolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AzureFilePersistentVolumeSourceApplyConfiguration represents an declarative configuration of the AzureFilePersistentVolumeSource type for use +// with apply. +type AzureFilePersistentVolumeSourceApplyConfiguration struct { + SecretName *string `json:"secretName,omitempty"` + ShareName *string `json:"shareName,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretNamespace *string `json:"secretNamespace,omitempty"` +} + +// AzureFilePersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the AzureFilePersistentVolumeSource type for use with +// apply. +func AzureFilePersistentVolumeSource() *AzureFilePersistentVolumeSourceApplyConfiguration { + return &AzureFilePersistentVolumeSourceApplyConfiguration{} +} + +// WithSecretName sets the SecretName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretName field is set to the value of the last call. +func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithSecretName(value string) *AzureFilePersistentVolumeSourceApplyConfiguration { + b.SecretName = &value + return b +} + +// WithShareName sets the ShareName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShareName field is set to the value of the last call. +func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithShareName(value string) *AzureFilePersistentVolumeSourceApplyConfiguration { + b.ShareName = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AzureFilePersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithSecretNamespace sets the SecretNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretNamespace field is set to the value of the last call. +func (b *AzureFilePersistentVolumeSourceApplyConfiguration) WithSecretNamespace(value string) *AzureFilePersistentVolumeSourceApplyConfiguration { + b.SecretNamespace = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/azurefilevolumesource.go b/pkg/generated/applyconfigurations/core/v1/azurefilevolumesource.go new file mode 100644 index 00000000000..5ffddf07e3a --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/azurefilevolumesource.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// AzureFileVolumeSourceApplyConfiguration represents an declarative configuration of the AzureFileVolumeSource type for use +// with apply. +type AzureFileVolumeSourceApplyConfiguration struct { + SecretName *string `json:"secretName,omitempty"` + ShareName *string `json:"shareName,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// AzureFileVolumeSourceApplyConfiguration constructs an declarative configuration of the AzureFileVolumeSource type for use with +// apply. +func AzureFileVolumeSource() *AzureFileVolumeSourceApplyConfiguration { + return &AzureFileVolumeSourceApplyConfiguration{} +} + +// WithSecretName sets the SecretName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretName field is set to the value of the last call. +func (b *AzureFileVolumeSourceApplyConfiguration) WithSecretName(value string) *AzureFileVolumeSourceApplyConfiguration { + b.SecretName = &value + return b +} + +// WithShareName sets the ShareName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShareName field is set to the value of the last call. +func (b *AzureFileVolumeSourceApplyConfiguration) WithShareName(value string) *AzureFileVolumeSourceApplyConfiguration { + b.ShareName = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *AzureFileVolumeSourceApplyConfiguration) WithReadOnly(value bool) *AzureFileVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/capabilities.go b/pkg/generated/applyconfigurations/core/v1/capabilities.go new file mode 100644 index 00000000000..b55fe252a23 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/capabilities.go @@ -0,0 +1,45 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// CapabilitiesApplyConfiguration represents an declarative configuration of the Capabilities type for use +// with apply. +type CapabilitiesApplyConfiguration struct { + Add []v1.Capability `json:"add,omitempty"` + Drop []v1.Capability `json:"drop,omitempty"` +} + +// CapabilitiesApplyConfiguration constructs an declarative configuration of the Capabilities type for use with +// apply. +func Capabilities() *CapabilitiesApplyConfiguration { + return &CapabilitiesApplyConfiguration{} +} + +// WithAdd adds the given value to the Add field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Add field. +func (b *CapabilitiesApplyConfiguration) WithAdd(values ...v1.Capability) *CapabilitiesApplyConfiguration { + for i := range values { + b.Add = append(b.Add, values[i]) + } + return b +} + +// WithDrop adds the given value to the Drop field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Drop field. +func (b *CapabilitiesApplyConfiguration) WithDrop(values ...v1.Capability) *CapabilitiesApplyConfiguration { + for i := range values { + b.Drop = append(b.Drop, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/cephfspersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/cephfspersistentvolumesource.go new file mode 100644 index 00000000000..54b848566de --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/cephfspersistentvolumesource.go @@ -0,0 +1,75 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CephFSPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CephFSPersistentVolumeSource type for use +// with apply. +type CephFSPersistentVolumeSourceApplyConfiguration struct { + Monitors []string `json:"monitors,omitempty"` + Path *string `json:"path,omitempty"` + User *string `json:"user,omitempty"` + SecretFile *string `json:"secretFile,omitempty"` + SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// CephFSPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CephFSPersistentVolumeSource type for use with +// apply. +func CephFSPersistentVolumeSource() *CephFSPersistentVolumeSourceApplyConfiguration { + return &CephFSPersistentVolumeSourceApplyConfiguration{} +} + +// WithMonitors adds the given value to the Monitors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Monitors field. +func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithMonitors(values ...string) *CephFSPersistentVolumeSourceApplyConfiguration { + for i := range values { + b.Monitors = append(b.Monitors, values[i]) + } + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithPath(value string) *CephFSPersistentVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithUser(value string) *CephFSPersistentVolumeSourceApplyConfiguration { + b.User = &value + return b +} + +// WithSecretFile sets the SecretFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretFile field is set to the value of the last call. +func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithSecretFile(value string) *CephFSPersistentVolumeSourceApplyConfiguration { + b.SecretFile = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *CephFSPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *CephFSPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CephFSPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/cephfsvolumesource.go b/pkg/generated/applyconfigurations/core/v1/cephfsvolumesource.go new file mode 100644 index 00000000000..a3659522602 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/cephfsvolumesource.go @@ -0,0 +1,75 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CephFSVolumeSourceApplyConfiguration represents an declarative configuration of the CephFSVolumeSource type for use +// with apply. +type CephFSVolumeSourceApplyConfiguration struct { + Monitors []string `json:"monitors,omitempty"` + Path *string `json:"path,omitempty"` + User *string `json:"user,omitempty"` + SecretFile *string `json:"secretFile,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// CephFSVolumeSourceApplyConfiguration constructs an declarative configuration of the CephFSVolumeSource type for use with +// apply. +func CephFSVolumeSource() *CephFSVolumeSourceApplyConfiguration { + return &CephFSVolumeSourceApplyConfiguration{} +} + +// WithMonitors adds the given value to the Monitors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Monitors field. +func (b *CephFSVolumeSourceApplyConfiguration) WithMonitors(values ...string) *CephFSVolumeSourceApplyConfiguration { + for i := range values { + b.Monitors = append(b.Monitors, values[i]) + } + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *CephFSVolumeSourceApplyConfiguration) WithPath(value string) *CephFSVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *CephFSVolumeSourceApplyConfiguration) WithUser(value string) *CephFSVolumeSourceApplyConfiguration { + b.User = &value + return b +} + +// WithSecretFile sets the SecretFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretFile field is set to the value of the last call. +func (b *CephFSVolumeSourceApplyConfiguration) WithSecretFile(value string) *CephFSVolumeSourceApplyConfiguration { + b.SecretFile = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *CephFSVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *CephFSVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *CephFSVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CephFSVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/cinderpersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/cinderpersistentvolumesource.go new file mode 100644 index 00000000000..c549b5aceb9 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/cinderpersistentvolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CinderPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CinderPersistentVolumeSource type for use +// with apply. +type CinderPersistentVolumeSourceApplyConfiguration struct { + VolumeID *string `json:"volumeID,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` +} + +// CinderPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CinderPersistentVolumeSource type for use with +// apply. +func CinderPersistentVolumeSource() *CinderPersistentVolumeSourceApplyConfiguration { + return &CinderPersistentVolumeSourceApplyConfiguration{} +} + +// WithVolumeID sets the VolumeID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeID field is set to the value of the last call. +func (b *CinderPersistentVolumeSourceApplyConfiguration) WithVolumeID(value string) *CinderPersistentVolumeSourceApplyConfiguration { + b.VolumeID = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *CinderPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *CinderPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *CinderPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CinderPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *CinderPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *CinderPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/cindervolumesource.go b/pkg/generated/applyconfigurations/core/v1/cindervolumesource.go new file mode 100644 index 00000000000..699642ded9a --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/cindervolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CinderVolumeSourceApplyConfiguration represents an declarative configuration of the CinderVolumeSource type for use +// with apply. +type CinderVolumeSourceApplyConfiguration struct { + VolumeID *string `json:"volumeID,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` +} + +// CinderVolumeSourceApplyConfiguration constructs an declarative configuration of the CinderVolumeSource type for use with +// apply. +func CinderVolumeSource() *CinderVolumeSourceApplyConfiguration { + return &CinderVolumeSourceApplyConfiguration{} +} + +// WithVolumeID sets the VolumeID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeID field is set to the value of the last call. +func (b *CinderVolumeSourceApplyConfiguration) WithVolumeID(value string) *CinderVolumeSourceApplyConfiguration { + b.VolumeID = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *CinderVolumeSourceApplyConfiguration) WithFSType(value string) *CinderVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *CinderVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CinderVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *CinderVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *CinderVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/claimsource.go b/pkg/generated/applyconfigurations/core/v1/claimsource.go new file mode 100644 index 00000000000..6495864772e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/claimsource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ClaimSourceApplyConfiguration represents an declarative configuration of the ClaimSource type for use +// with apply. +type ClaimSourceApplyConfiguration struct { + ResourceClaimName *string `json:"resourceClaimName,omitempty"` + ResourceClaimTemplateName *string `json:"resourceClaimTemplateName,omitempty"` +} + +// ClaimSourceApplyConfiguration constructs an declarative configuration of the ClaimSource type for use with +// apply. +func ClaimSource() *ClaimSourceApplyConfiguration { + return &ClaimSourceApplyConfiguration{} +} + +// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimName field is set to the value of the last call. +func (b *ClaimSourceApplyConfiguration) WithResourceClaimName(value string) *ClaimSourceApplyConfiguration { + b.ResourceClaimName = &value + return b +} + +// WithResourceClaimTemplateName sets the ResourceClaimTemplateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimTemplateName field is set to the value of the last call. +func (b *ClaimSourceApplyConfiguration) WithResourceClaimTemplateName(value string) *ClaimSourceApplyConfiguration { + b.ResourceClaimTemplateName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/clientipconfig.go b/pkg/generated/applyconfigurations/core/v1/clientipconfig.go new file mode 100644 index 00000000000..00ee231609f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/clientipconfig.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ClientIPConfigApplyConfiguration represents an declarative configuration of the ClientIPConfig type for use +// with apply. +type ClientIPConfigApplyConfiguration struct { + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` +} + +// ClientIPConfigApplyConfiguration constructs an declarative configuration of the ClientIPConfig type for use with +// apply. +func ClientIPConfig() *ClientIPConfigApplyConfiguration { + return &ClientIPConfigApplyConfiguration{} +} + +// WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeoutSeconds field is set to the value of the last call. +func (b *ClientIPConfigApplyConfiguration) WithTimeoutSeconds(value int32) *ClientIPConfigApplyConfiguration { + b.TimeoutSeconds = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/clustertrustbundleprojection.go b/pkg/generated/applyconfigurations/core/v1/clustertrustbundleprojection.go new file mode 100644 index 00000000000..3354f6cb2ea --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/clustertrustbundleprojection.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" +) + +// ClusterTrustBundleProjectionApplyConfiguration represents an declarative configuration of the ClusterTrustBundleProjection type for use +// with apply. +type ClusterTrustBundleProjectionApplyConfiguration struct { + Name *string `json:"name,omitempty"` + SignerName *string `json:"signerName,omitempty"` + LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` + Optional *bool `json:"optional,omitempty"` + Path *string `json:"path,omitempty"` +} + +// ClusterTrustBundleProjectionApplyConfiguration constructs an declarative configuration of the ClusterTrustBundleProjection type for use with +// apply. +func ClusterTrustBundleProjection() *ClusterTrustBundleProjectionApplyConfiguration { + return &ClusterTrustBundleProjectionApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ClusterTrustBundleProjectionApplyConfiguration) WithName(value string) *ClusterTrustBundleProjectionApplyConfiguration { + b.Name = &value + return b +} + +// WithSignerName sets the SignerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SignerName field is set to the value of the last call. +func (b *ClusterTrustBundleProjectionApplyConfiguration) WithSignerName(value string) *ClusterTrustBundleProjectionApplyConfiguration { + b.SignerName = &value + return b +} + +// WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelSelector field is set to the value of the last call. +func (b *ClusterTrustBundleProjectionApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *ClusterTrustBundleProjectionApplyConfiguration { + b.LabelSelector = value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *ClusterTrustBundleProjectionApplyConfiguration) WithOptional(value bool) *ClusterTrustBundleProjectionApplyConfiguration { + b.Optional = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *ClusterTrustBundleProjectionApplyConfiguration) WithPath(value string) *ClusterTrustBundleProjectionApplyConfiguration { + b.Path = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/componentcondition.go b/pkg/generated/applyconfigurations/core/v1/componentcondition.go new file mode 100644 index 00000000000..3c97e6e2916 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/componentcondition.go @@ -0,0 +1,59 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ComponentConditionApplyConfiguration represents an declarative configuration of the ComponentCondition type for use +// with apply. +type ComponentConditionApplyConfiguration struct { + Type *v1.ComponentConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + Message *string `json:"message,omitempty"` + Error *string `json:"error,omitempty"` +} + +// ComponentConditionApplyConfiguration constructs an declarative configuration of the ComponentCondition type for use with +// apply. +func ComponentCondition() *ComponentConditionApplyConfiguration { + return &ComponentConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ComponentConditionApplyConfiguration) WithType(value v1.ComponentConditionType) *ComponentConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ComponentConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ComponentConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ComponentConditionApplyConfiguration) WithMessage(value string) *ComponentConditionApplyConfiguration { + b.Message = &value + return b +} + +// WithError sets the Error field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Error field is set to the value of the last call. +func (b *ComponentConditionApplyConfiguration) WithError(value string) *ComponentConditionApplyConfiguration { + b.Error = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/componentstatus.go b/pkg/generated/applyconfigurations/core/v1/componentstatus.go new file mode 100644 index 00000000000..40e4168b2df --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/componentstatus.go @@ -0,0 +1,241 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ComponentStatusApplyConfiguration represents an declarative configuration of the ComponentStatus type for use +// with apply. +type ComponentStatusApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Conditions []ComponentConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ComponentStatus constructs an declarative configuration of the ComponentStatus type for use with +// apply. +func ComponentStatus(name string) *ComponentStatusApplyConfiguration { + b := &ComponentStatusApplyConfiguration{} + b.WithName(name) + b.WithKind("ComponentStatus") + b.WithAPIVersion("v1") + return b +} + +// ExtractComponentStatus extracts the applied configuration owned by fieldManager from +// componentStatus. If no managedFields are found in componentStatus for fieldManager, a +// ComponentStatusApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// componentStatus must be a unmodified ComponentStatus API object that was retrieved from the Kubernetes API. +// ExtractComponentStatus provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractComponentStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string) (*ComponentStatusApplyConfiguration, error) { + return extractComponentStatus(componentStatus, fieldManager, "") +} + +// ExtractComponentStatusStatus is the same as ExtractComponentStatus except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractComponentStatusStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string) (*ComponentStatusApplyConfiguration, error) { + return extractComponentStatus(componentStatus, fieldManager, "status") +} + +func extractComponentStatus(componentStatus *apicorev1.ComponentStatus, fieldManager string, subresource string) (*ComponentStatusApplyConfiguration, error) { + b := &ComponentStatusApplyConfiguration{} + err := managedfields.ExtractInto(componentStatus, internal.Parser().Type("io.k8s.api.core.v1.ComponentStatus"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(componentStatus.Name) + + b.WithKind("ComponentStatus") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithKind(value string) *ComponentStatusApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithAPIVersion(value string) *ComponentStatusApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithName(value string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithGenerateName(value string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithNamespace(value string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithUID(value types.UID) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithResourceVersion(value string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithGeneration(value int64) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ComponentStatusApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ComponentStatusApplyConfiguration) WithLabels(entries map[string]string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ComponentStatusApplyConfiguration) WithAnnotations(entries map[string]string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ComponentStatusApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ComponentStatusApplyConfiguration) WithFinalizers(values ...string) *ComponentStatusApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ComponentStatusApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ComponentStatusApplyConfiguration) WithConditions(values ...*ComponentConditionApplyConfiguration) *ComponentStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/configmap.go b/pkg/generated/applyconfigurations/core/v1/configmap.go new file mode 100644 index 00000000000..97095a8f4c8 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/configmap.go @@ -0,0 +1,268 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ConfigMapApplyConfiguration represents an declarative configuration of the ConfigMap type for use +// with apply. +type ConfigMapApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Immutable *bool `json:"immutable,omitempty"` + Data map[string]string `json:"data,omitempty"` + BinaryData map[string][]byte `json:"binaryData,omitempty"` +} + +// ConfigMap constructs an declarative configuration of the ConfigMap type for use with +// apply. +func ConfigMap(name, namespace string) *ConfigMapApplyConfiguration { + b := &ConfigMapApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ConfigMap") + b.WithAPIVersion("v1") + return b +} + +// ExtractConfigMap extracts the applied configuration owned by fieldManager from +// configMap. If no managedFields are found in configMap for fieldManager, a +// ConfigMapApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// configMap must be a unmodified ConfigMap API object that was retrieved from the Kubernetes API. +// ExtractConfigMap provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractConfigMap(configMap *corev1.ConfigMap, fieldManager string) (*ConfigMapApplyConfiguration, error) { + return extractConfigMap(configMap, fieldManager, "") +} + +// ExtractConfigMapStatus is the same as ExtractConfigMap except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractConfigMapStatus(configMap *corev1.ConfigMap, fieldManager string) (*ConfigMapApplyConfiguration, error) { + return extractConfigMap(configMap, fieldManager, "status") +} + +func extractConfigMap(configMap *corev1.ConfigMap, fieldManager string, subresource string) (*ConfigMapApplyConfiguration, error) { + b := &ConfigMapApplyConfiguration{} + err := managedfields.ExtractInto(configMap, internal.Parser().Type("io.k8s.api.core.v1.ConfigMap"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(configMap.Name) + b.WithNamespace(configMap.Namespace) + + b.WithKind("ConfigMap") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithKind(value string) *ConfigMapApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithAPIVersion(value string) *ConfigMapApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithName(value string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithGenerateName(value string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithNamespace(value string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithUID(value types.UID) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithResourceVersion(value string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithGeneration(value int64) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ConfigMapApplyConfiguration) WithLabels(entries map[string]string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ConfigMapApplyConfiguration) WithAnnotations(entries map[string]string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ConfigMapApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ConfigMapApplyConfiguration) WithFinalizers(values ...string) *ConfigMapApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ConfigMapApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithImmutable sets the Immutable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Immutable field is set to the value of the last call. +func (b *ConfigMapApplyConfiguration) WithImmutable(value bool) *ConfigMapApplyConfiguration { + b.Immutable = &value + return b +} + +// WithData puts the entries into the Data field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Data field, +// overwriting an existing map entries in Data field with the same key. +func (b *ConfigMapApplyConfiguration) WithData(entries map[string]string) *ConfigMapApplyConfiguration { + if b.Data == nil && len(entries) > 0 { + b.Data = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Data[k] = v + } + return b +} + +// WithBinaryData puts the entries into the BinaryData field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the BinaryData field, +// overwriting an existing map entries in BinaryData field with the same key. +func (b *ConfigMapApplyConfiguration) WithBinaryData(entries map[string][]byte) *ConfigMapApplyConfiguration { + if b.BinaryData == nil && len(entries) > 0 { + b.BinaryData = make(map[string][]byte, len(entries)) + } + for k, v := range entries { + b.BinaryData[k] = v + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/configmapenvsource.go b/pkg/generated/applyconfigurations/core/v1/configmapenvsource.go new file mode 100644 index 00000000000..ccf8f097378 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/configmapenvsource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConfigMapEnvSourceApplyConfiguration represents an declarative configuration of the ConfigMapEnvSource type for use +// with apply. +type ConfigMapEnvSourceApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Optional *bool `json:"optional,omitempty"` +} + +// ConfigMapEnvSourceApplyConfiguration constructs an declarative configuration of the ConfigMapEnvSource type for use with +// apply. +func ConfigMapEnvSource() *ConfigMapEnvSourceApplyConfiguration { + return &ConfigMapEnvSourceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConfigMapEnvSourceApplyConfiguration) WithName(value string) *ConfigMapEnvSourceApplyConfiguration { + b.Name = &value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *ConfigMapEnvSourceApplyConfiguration) WithOptional(value bool) *ConfigMapEnvSourceApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/configmapkeyselector.go b/pkg/generated/applyconfigurations/core/v1/configmapkeyselector.go new file mode 100644 index 00000000000..6704a72a605 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/configmapkeyselector.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConfigMapKeySelectorApplyConfiguration represents an declarative configuration of the ConfigMapKeySelector type for use +// with apply. +type ConfigMapKeySelectorApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Key *string `json:"key,omitempty"` + Optional *bool `json:"optional,omitempty"` +} + +// ConfigMapKeySelectorApplyConfiguration constructs an declarative configuration of the ConfigMapKeySelector type for use with +// apply. +func ConfigMapKeySelector() *ConfigMapKeySelectorApplyConfiguration { + return &ConfigMapKeySelectorApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConfigMapKeySelectorApplyConfiguration) WithName(value string) *ConfigMapKeySelectorApplyConfiguration { + b.Name = &value + return b +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *ConfigMapKeySelectorApplyConfiguration) WithKey(value string) *ConfigMapKeySelectorApplyConfiguration { + b.Key = &value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *ConfigMapKeySelectorApplyConfiguration) WithOptional(value bool) *ConfigMapKeySelectorApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/configmapnodeconfigsource.go b/pkg/generated/applyconfigurations/core/v1/configmapnodeconfigsource.go new file mode 100644 index 00000000000..21f90a909a2 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/configmapnodeconfigsource.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// ConfigMapNodeConfigSourceApplyConfiguration represents an declarative configuration of the ConfigMapNodeConfigSource type for use +// with apply. +type ConfigMapNodeConfigSourceApplyConfiguration struct { + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` + UID *types.UID `json:"uid,omitempty"` + ResourceVersion *string `json:"resourceVersion,omitempty"` + KubeletConfigKey *string `json:"kubeletConfigKey,omitempty"` +} + +// ConfigMapNodeConfigSourceApplyConfiguration constructs an declarative configuration of the ConfigMapNodeConfigSource type for use with +// apply. +func ConfigMapNodeConfigSource() *ConfigMapNodeConfigSourceApplyConfiguration { + return &ConfigMapNodeConfigSourceApplyConfiguration{} +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithNamespace(value string) *ConfigMapNodeConfigSourceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithName(value string) *ConfigMapNodeConfigSourceApplyConfiguration { + b.Name = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithUID(value types.UID) *ConfigMapNodeConfigSourceApplyConfiguration { + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithResourceVersion(value string) *ConfigMapNodeConfigSourceApplyConfiguration { + b.ResourceVersion = &value + return b +} + +// WithKubeletConfigKey sets the KubeletConfigKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeletConfigKey field is set to the value of the last call. +func (b *ConfigMapNodeConfigSourceApplyConfiguration) WithKubeletConfigKey(value string) *ConfigMapNodeConfigSourceApplyConfiguration { + b.KubeletConfigKey = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/configmapprojection.go b/pkg/generated/applyconfigurations/core/v1/configmapprojection.go new file mode 100644 index 00000000000..4399a61aa9c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/configmapprojection.go @@ -0,0 +1,51 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConfigMapProjectionApplyConfiguration represents an declarative configuration of the ConfigMapProjection type for use +// with apply. +type ConfigMapProjectionApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Items []KeyToPathApplyConfiguration `json:"items,omitempty"` + Optional *bool `json:"optional,omitempty"` +} + +// ConfigMapProjectionApplyConfiguration constructs an declarative configuration of the ConfigMapProjection type for use with +// apply. +func ConfigMapProjection() *ConfigMapProjectionApplyConfiguration { + return &ConfigMapProjectionApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConfigMapProjectionApplyConfiguration) WithName(value string) *ConfigMapProjectionApplyConfiguration { + b.Name = &value + return b +} + +// WithItems adds the given value to the Items field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Items field. +func (b *ConfigMapProjectionApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *ConfigMapProjectionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithItems") + } + b.Items = append(b.Items, *values[i]) + } + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *ConfigMapProjectionApplyConfiguration) WithOptional(value bool) *ConfigMapProjectionApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/configmapvolumesource.go b/pkg/generated/applyconfigurations/core/v1/configmapvolumesource.go new file mode 100644 index 00000000000..73a223a1c86 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/configmapvolumesource.go @@ -0,0 +1,60 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ConfigMapVolumeSourceApplyConfiguration represents an declarative configuration of the ConfigMapVolumeSource type for use +// with apply. +type ConfigMapVolumeSourceApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Items []KeyToPathApplyConfiguration `json:"items,omitempty"` + DefaultMode *int32 `json:"defaultMode,omitempty"` + Optional *bool `json:"optional,omitempty"` +} + +// ConfigMapVolumeSourceApplyConfiguration constructs an declarative configuration of the ConfigMapVolumeSource type for use with +// apply. +func ConfigMapVolumeSource() *ConfigMapVolumeSourceApplyConfiguration { + return &ConfigMapVolumeSourceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ConfigMapVolumeSourceApplyConfiguration) WithName(value string) *ConfigMapVolumeSourceApplyConfiguration { + b.Name = &value + return b +} + +// WithItems adds the given value to the Items field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Items field. +func (b *ConfigMapVolumeSourceApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *ConfigMapVolumeSourceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithItems") + } + b.Items = append(b.Items, *values[i]) + } + return b +} + +// WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultMode field is set to the value of the last call. +func (b *ConfigMapVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *ConfigMapVolumeSourceApplyConfiguration { + b.DefaultMode = &value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *ConfigMapVolumeSourceApplyConfiguration) WithOptional(value bool) *ConfigMapVolumeSourceApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/container.go b/pkg/generated/applyconfigurations/core/v1/container.go new file mode 100644 index 00000000000..78d889eb069 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/container.go @@ -0,0 +1,273 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// ContainerApplyConfiguration represents an declarative configuration of the Container type for use +// with apply. +type ContainerApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Image *string `json:"image,omitempty"` + Command []string `json:"command,omitempty"` + Args []string `json:"args,omitempty"` + WorkingDir *string `json:"workingDir,omitempty"` + Ports []ContainerPortApplyConfiguration `json:"ports,omitempty"` + EnvFrom []EnvFromSourceApplyConfiguration `json:"envFrom,omitempty"` + Env []EnvVarApplyConfiguration `json:"env,omitempty"` + Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` + RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` + VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` + VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` + LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` + ReadinessProbe *ProbeApplyConfiguration `json:"readinessProbe,omitempty"` + StartupProbe *ProbeApplyConfiguration `json:"startupProbe,omitempty"` + Lifecycle *LifecycleApplyConfiguration `json:"lifecycle,omitempty"` + TerminationMessagePath *string `json:"terminationMessagePath,omitempty"` + TerminationMessagePolicy *corev1.TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty"` + ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + SecurityContext *SecurityContextApplyConfiguration `json:"securityContext,omitempty"` + Stdin *bool `json:"stdin,omitempty"` + StdinOnce *bool `json:"stdinOnce,omitempty"` + TTY *bool `json:"tty,omitempty"` +} + +// ContainerApplyConfiguration constructs an declarative configuration of the Container type for use with +// apply. +func Container() *ContainerApplyConfiguration { + return &ContainerApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithName(value string) *ContainerApplyConfiguration { + b.Name = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithImage(value string) *ContainerApplyConfiguration { + b.Image = &value + return b +} + +// WithCommand adds the given value to the Command field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Command field. +func (b *ContainerApplyConfiguration) WithCommand(values ...string) *ContainerApplyConfiguration { + for i := range values { + b.Command = append(b.Command, values[i]) + } + return b +} + +// WithArgs adds the given value to the Args field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Args field. +func (b *ContainerApplyConfiguration) WithArgs(values ...string) *ContainerApplyConfiguration { + for i := range values { + b.Args = append(b.Args, values[i]) + } + return b +} + +// WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkingDir field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithWorkingDir(value string) *ContainerApplyConfiguration { + b.WorkingDir = &value + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *ContainerApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} + +// WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EnvFrom field. +func (b *ContainerApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEnvFrom") + } + b.EnvFrom = append(b.EnvFrom, *values[i]) + } + return b +} + +// WithEnv adds the given value to the Env field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Env field. +func (b *ContainerApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) + } + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerApplyConfiguration { + b.Resources = value + return b +} + +// WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResizePolicy field. +func (b *ContainerApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResizePolicy") + } + b.ResizePolicy = append(b.ResizePolicy, *values[i]) + } + return b +} + +// WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartPolicy field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *ContainerApplyConfiguration { + b.RestartPolicy = &value + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *ContainerApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeMounts") + } + b.VolumeMounts = append(b.VolumeMounts, *values[i]) + } + return b +} + +// WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeDevices field. +func (b *ContainerApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *ContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeDevices") + } + b.VolumeDevices = append(b.VolumeDevices, *values[i]) + } + return b +} + +// WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LivenessProbe field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { + b.LivenessProbe = value + return b +} + +// WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadinessProbe field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { + b.ReadinessProbe = value + return b +} + +// WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartupProbe field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *ContainerApplyConfiguration { + b.StartupProbe = value + return b +} + +// WithLifecycle sets the Lifecycle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Lifecycle field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *ContainerApplyConfiguration { + b.Lifecycle = value + return b +} + +// WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationMessagePath field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithTerminationMessagePath(value string) *ContainerApplyConfiguration { + b.TerminationMessagePath = &value + return b +} + +// WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationMessagePolicy field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *ContainerApplyConfiguration { + b.TerminationMessagePolicy = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *ContainerApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *ContainerApplyConfiguration { + b.SecurityContext = value + return b +} + +// WithStdin sets the Stdin field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Stdin field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithStdin(value bool) *ContainerApplyConfiguration { + b.Stdin = &value + return b +} + +// WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StdinOnce field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithStdinOnce(value bool) *ContainerApplyConfiguration { + b.StdinOnce = &value + return b +} + +// WithTTY sets the TTY field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TTY field is set to the value of the last call. +func (b *ContainerApplyConfiguration) WithTTY(value bool) *ContainerApplyConfiguration { + b.TTY = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerimage.go b/pkg/generated/applyconfigurations/core/v1/containerimage.go new file mode 100644 index 00000000000..7eb1462313b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerimage.go @@ -0,0 +1,39 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ContainerImageApplyConfiguration represents an declarative configuration of the ContainerImage type for use +// with apply. +type ContainerImageApplyConfiguration struct { + Names []string `json:"names,omitempty"` + SizeBytes *int64 `json:"sizeBytes,omitempty"` +} + +// ContainerImageApplyConfiguration constructs an declarative configuration of the ContainerImage type for use with +// apply. +func ContainerImage() *ContainerImageApplyConfiguration { + return &ContainerImageApplyConfiguration{} +} + +// WithNames adds the given value to the Names field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Names field. +func (b *ContainerImageApplyConfiguration) WithNames(values ...string) *ContainerImageApplyConfiguration { + for i := range values { + b.Names = append(b.Names, values[i]) + } + return b +} + +// WithSizeBytes sets the SizeBytes field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SizeBytes field is set to the value of the last call. +func (b *ContainerImageApplyConfiguration) WithSizeBytes(value int64) *ContainerImageApplyConfiguration { + b.SizeBytes = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerport.go b/pkg/generated/applyconfigurations/core/v1/containerport.go new file mode 100644 index 00000000000..e7e5fe96e94 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerport.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ContainerPortApplyConfiguration represents an declarative configuration of the ContainerPort type for use +// with apply. +type ContainerPortApplyConfiguration struct { + Name *string `json:"name,omitempty"` + HostPort *int32 `json:"hostPort,omitempty"` + ContainerPort *int32 `json:"containerPort,omitempty"` + Protocol *v1.Protocol `json:"protocol,omitempty"` + HostIP *string `json:"hostIP,omitempty"` +} + +// ContainerPortApplyConfiguration constructs an declarative configuration of the ContainerPort type for use with +// apply. +func ContainerPort() *ContainerPortApplyConfiguration { + return &ContainerPortApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ContainerPortApplyConfiguration) WithName(value string) *ContainerPortApplyConfiguration { + b.Name = &value + return b +} + +// WithHostPort sets the HostPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPort field is set to the value of the last call. +func (b *ContainerPortApplyConfiguration) WithHostPort(value int32) *ContainerPortApplyConfiguration { + b.HostPort = &value + return b +} + +// WithContainerPort sets the ContainerPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerPort field is set to the value of the last call. +func (b *ContainerPortApplyConfiguration) WithContainerPort(value int32) *ContainerPortApplyConfiguration { + b.ContainerPort = &value + return b +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *ContainerPortApplyConfiguration) WithProtocol(value v1.Protocol) *ContainerPortApplyConfiguration { + b.Protocol = &value + return b +} + +// WithHostIP sets the HostIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostIP field is set to the value of the last call. +func (b *ContainerPortApplyConfiguration) WithHostIP(value string) *ContainerPortApplyConfiguration { + b.HostIP = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerresizepolicy.go b/pkg/generated/applyconfigurations/core/v1/containerresizepolicy.go new file mode 100644 index 00000000000..2431500dcb1 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerresizepolicy.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ContainerResizePolicyApplyConfiguration represents an declarative configuration of the ContainerResizePolicy type for use +// with apply. +type ContainerResizePolicyApplyConfiguration struct { + ResourceName *v1.ResourceName `json:"resourceName,omitempty"` + RestartPolicy *v1.ResourceResizeRestartPolicy `json:"restartPolicy,omitempty"` +} + +// ContainerResizePolicyApplyConfiguration constructs an declarative configuration of the ContainerResizePolicy type for use with +// apply. +func ContainerResizePolicy() *ContainerResizePolicyApplyConfiguration { + return &ContainerResizePolicyApplyConfiguration{} +} + +// WithResourceName sets the ResourceName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceName field is set to the value of the last call. +func (b *ContainerResizePolicyApplyConfiguration) WithResourceName(value v1.ResourceName) *ContainerResizePolicyApplyConfiguration { + b.ResourceName = &value + return b +} + +// WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartPolicy field is set to the value of the last call. +func (b *ContainerResizePolicyApplyConfiguration) WithRestartPolicy(value v1.ResourceResizeRestartPolicy) *ContainerResizePolicyApplyConfiguration { + b.RestartPolicy = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerstate.go b/pkg/generated/applyconfigurations/core/v1/containerstate.go new file mode 100644 index 00000000000..03bdd6177d5 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerstate.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ContainerStateApplyConfiguration represents an declarative configuration of the ContainerState type for use +// with apply. +type ContainerStateApplyConfiguration struct { + Waiting *ContainerStateWaitingApplyConfiguration `json:"waiting,omitempty"` + Running *ContainerStateRunningApplyConfiguration `json:"running,omitempty"` + Terminated *ContainerStateTerminatedApplyConfiguration `json:"terminated,omitempty"` +} + +// ContainerStateApplyConfiguration constructs an declarative configuration of the ContainerState type for use with +// apply. +func ContainerState() *ContainerStateApplyConfiguration { + return &ContainerStateApplyConfiguration{} +} + +// WithWaiting sets the Waiting field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Waiting field is set to the value of the last call. +func (b *ContainerStateApplyConfiguration) WithWaiting(value *ContainerStateWaitingApplyConfiguration) *ContainerStateApplyConfiguration { + b.Waiting = value + return b +} + +// WithRunning sets the Running field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Running field is set to the value of the last call. +func (b *ContainerStateApplyConfiguration) WithRunning(value *ContainerStateRunningApplyConfiguration) *ContainerStateApplyConfiguration { + b.Running = value + return b +} + +// WithTerminated sets the Terminated field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Terminated field is set to the value of the last call. +func (b *ContainerStateApplyConfiguration) WithTerminated(value *ContainerStateTerminatedApplyConfiguration) *ContainerStateApplyConfiguration { + b.Terminated = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerstaterunning.go b/pkg/generated/applyconfigurations/core/v1/containerstaterunning.go new file mode 100644 index 00000000000..4cb954b4c3b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerstaterunning.go @@ -0,0 +1,32 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ContainerStateRunningApplyConfiguration represents an declarative configuration of the ContainerStateRunning type for use +// with apply. +type ContainerStateRunningApplyConfiguration struct { + StartedAt *v1.Time `json:"startedAt,omitempty"` +} + +// ContainerStateRunningApplyConfiguration constructs an declarative configuration of the ContainerStateRunning type for use with +// apply. +func ContainerStateRunning() *ContainerStateRunningApplyConfiguration { + return &ContainerStateRunningApplyConfiguration{} +} + +// WithStartedAt sets the StartedAt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartedAt field is set to the value of the last call. +func (b *ContainerStateRunningApplyConfiguration) WithStartedAt(value v1.Time) *ContainerStateRunningApplyConfiguration { + b.StartedAt = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerstateterminated.go b/pkg/generated/applyconfigurations/core/v1/containerstateterminated.go new file mode 100644 index 00000000000..6bd2f10a373 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerstateterminated.go @@ -0,0 +1,86 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ContainerStateTerminatedApplyConfiguration represents an declarative configuration of the ContainerStateTerminated type for use +// with apply. +type ContainerStateTerminatedApplyConfiguration struct { + ExitCode *int32 `json:"exitCode,omitempty"` + Signal *int32 `json:"signal,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + StartedAt *v1.Time `json:"startedAt,omitempty"` + FinishedAt *v1.Time `json:"finishedAt,omitempty"` + ContainerID *string `json:"containerID,omitempty"` +} + +// ContainerStateTerminatedApplyConfiguration constructs an declarative configuration of the ContainerStateTerminated type for use with +// apply. +func ContainerStateTerminated() *ContainerStateTerminatedApplyConfiguration { + return &ContainerStateTerminatedApplyConfiguration{} +} + +// WithExitCode sets the ExitCode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExitCode field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithExitCode(value int32) *ContainerStateTerminatedApplyConfiguration { + b.ExitCode = &value + return b +} + +// WithSignal sets the Signal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Signal field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithSignal(value int32) *ContainerStateTerminatedApplyConfiguration { + b.Signal = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithReason(value string) *ContainerStateTerminatedApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithMessage(value string) *ContainerStateTerminatedApplyConfiguration { + b.Message = &value + return b +} + +// WithStartedAt sets the StartedAt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartedAt field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithStartedAt(value v1.Time) *ContainerStateTerminatedApplyConfiguration { + b.StartedAt = &value + return b +} + +// WithFinishedAt sets the FinishedAt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FinishedAt field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithFinishedAt(value v1.Time) *ContainerStateTerminatedApplyConfiguration { + b.FinishedAt = &value + return b +} + +// WithContainerID sets the ContainerID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerID field is set to the value of the last call. +func (b *ContainerStateTerminatedApplyConfiguration) WithContainerID(value string) *ContainerStateTerminatedApplyConfiguration { + b.ContainerID = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerstatewaiting.go b/pkg/generated/applyconfigurations/core/v1/containerstatewaiting.go new file mode 100644 index 00000000000..0e1a9fde369 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerstatewaiting.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ContainerStateWaitingApplyConfiguration represents an declarative configuration of the ContainerStateWaiting type for use +// with apply. +type ContainerStateWaitingApplyConfiguration struct { + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ContainerStateWaitingApplyConfiguration constructs an declarative configuration of the ContainerStateWaiting type for use with +// apply. +func ContainerStateWaiting() *ContainerStateWaitingApplyConfiguration { + return &ContainerStateWaitingApplyConfiguration{} +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ContainerStateWaitingApplyConfiguration) WithReason(value string) *ContainerStateWaitingApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ContainerStateWaitingApplyConfiguration) WithMessage(value string) *ContainerStateWaitingApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/containerstatus.go b/pkg/generated/applyconfigurations/core/v1/containerstatus.go new file mode 100644 index 00000000000..6d490e9e3f8 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/containerstatus.go @@ -0,0 +1,136 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// ContainerStatusApplyConfiguration represents an declarative configuration of the ContainerStatus type for use +// with apply. +type ContainerStatusApplyConfiguration struct { + Name *string `json:"name,omitempty"` + State *ContainerStateApplyConfiguration `json:"state,omitempty"` + LastTerminationState *ContainerStateApplyConfiguration `json:"lastState,omitempty"` + Ready *bool `json:"ready,omitempty"` + RestartCount *int32 `json:"restartCount,omitempty"` + Image *string `json:"image,omitempty"` + ImageID *string `json:"imageID,omitempty"` + ContainerID *string `json:"containerID,omitempty"` + Started *bool `json:"started,omitempty"` + AllocatedResources *corev1.ResourceList `json:"allocatedResources,omitempty"` + Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + VolumeMounts []VolumeMountStatusApplyConfiguration `json:"volumeMounts,omitempty"` +} + +// ContainerStatusApplyConfiguration constructs an declarative configuration of the ContainerStatus type for use with +// apply. +func ContainerStatus() *ContainerStatusApplyConfiguration { + return &ContainerStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithName(value string) *ContainerStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithState sets the State field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the State field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { + b.State = value + return b +} + +// WithLastTerminationState sets the LastTerminationState field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTerminationState field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithLastTerminationState(value *ContainerStateApplyConfiguration) *ContainerStatusApplyConfiguration { + b.LastTerminationState = value + return b +} + +// WithReady sets the Ready field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ready field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithReady(value bool) *ContainerStatusApplyConfiguration { + b.Ready = &value + return b +} + +// WithRestartCount sets the RestartCount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartCount field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithRestartCount(value int32) *ContainerStatusApplyConfiguration { + b.RestartCount = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithImage(value string) *ContainerStatusApplyConfiguration { + b.Image = &value + return b +} + +// WithImageID sets the ImageID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImageID field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithImageID(value string) *ContainerStatusApplyConfiguration { + b.ImageID = &value + return b +} + +// WithContainerID sets the ContainerID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerID field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithContainerID(value string) *ContainerStatusApplyConfiguration { + b.ContainerID = &value + return b +} + +// WithStarted sets the Started field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Started field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithStarted(value bool) *ContainerStatusApplyConfiguration { + b.Started = &value + return b +} + +// WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedResources field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithAllocatedResources(value corev1.ResourceList) *ContainerStatusApplyConfiguration { + b.AllocatedResources = &value + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *ContainerStatusApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *ContainerStatusApplyConfiguration { + b.Resources = value + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *ContainerStatusApplyConfiguration) WithVolumeMounts(values ...*VolumeMountStatusApplyConfiguration) *ContainerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeMounts") + } + b.VolumeMounts = append(b.VolumeMounts, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/csipersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/csipersistentvolumesource.go new file mode 100644 index 00000000000..a053c79cd96 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/csipersistentvolumesource.go @@ -0,0 +1,115 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CSIPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the CSIPersistentVolumeSource type for use +// with apply. +type CSIPersistentVolumeSourceApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + VolumeHandle *string `json:"volumeHandle,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + FSType *string `json:"fsType,omitempty"` + VolumeAttributes map[string]string `json:"volumeAttributes,omitempty"` + ControllerPublishSecretRef *SecretReferenceApplyConfiguration `json:"controllerPublishSecretRef,omitempty"` + NodeStageSecretRef *SecretReferenceApplyConfiguration `json:"nodeStageSecretRef,omitempty"` + NodePublishSecretRef *SecretReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"` + ControllerExpandSecretRef *SecretReferenceApplyConfiguration `json:"controllerExpandSecretRef,omitempty"` + NodeExpandSecretRef *SecretReferenceApplyConfiguration `json:"nodeExpandSecretRef,omitempty"` +} + +// CSIPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the CSIPersistentVolumeSource type for use with +// apply. +func CSIPersistentVolumeSource() *CSIPersistentVolumeSourceApplyConfiguration { + return &CSIPersistentVolumeSourceApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithDriver(value string) *CSIPersistentVolumeSourceApplyConfiguration { + b.Driver = &value + return b +} + +// WithVolumeHandle sets the VolumeHandle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeHandle field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeHandle(value string) *CSIPersistentVolumeSourceApplyConfiguration { + b.VolumeHandle = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CSIPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *CSIPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithVolumeAttributes puts the entries into the VolumeAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the VolumeAttributes field, +// overwriting an existing map entries in VolumeAttributes field with the same key. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithVolumeAttributes(entries map[string]string) *CSIPersistentVolumeSourceApplyConfiguration { + if b.VolumeAttributes == nil && len(entries) > 0 { + b.VolumeAttributes = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.VolumeAttributes[k] = v + } + return b +} + +// WithControllerPublishSecretRef sets the ControllerPublishSecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerPublishSecretRef field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerPublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { + b.ControllerPublishSecretRef = value + return b +} + +// WithNodeStageSecretRef sets the NodeStageSecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeStageSecretRef field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeStageSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { + b.NodeStageSecretRef = value + return b +} + +// WithNodePublishSecretRef sets the NodePublishSecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodePublishSecretRef field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodePublishSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { + b.NodePublishSecretRef = value + return b +} + +// WithControllerExpandSecretRef sets the ControllerExpandSecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ControllerExpandSecretRef field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithControllerExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { + b.ControllerExpandSecretRef = value + return b +} + +// WithNodeExpandSecretRef sets the NodeExpandSecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeExpandSecretRef field is set to the value of the last call. +func (b *CSIPersistentVolumeSourceApplyConfiguration) WithNodeExpandSecretRef(value *SecretReferenceApplyConfiguration) *CSIPersistentVolumeSourceApplyConfiguration { + b.NodeExpandSecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/csivolumesource.go b/pkg/generated/applyconfigurations/core/v1/csivolumesource.go new file mode 100644 index 00000000000..6aaedfb93a1 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/csivolumesource.go @@ -0,0 +1,70 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// CSIVolumeSourceApplyConfiguration represents an declarative configuration of the CSIVolumeSource type for use +// with apply. +type CSIVolumeSourceApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + FSType *string `json:"fsType,omitempty"` + VolumeAttributes map[string]string `json:"volumeAttributes,omitempty"` + NodePublishSecretRef *LocalObjectReferenceApplyConfiguration `json:"nodePublishSecretRef,omitempty"` +} + +// CSIVolumeSourceApplyConfiguration constructs an declarative configuration of the CSIVolumeSource type for use with +// apply. +func CSIVolumeSource() *CSIVolumeSourceApplyConfiguration { + return &CSIVolumeSourceApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *CSIVolumeSourceApplyConfiguration) WithDriver(value string) *CSIVolumeSourceApplyConfiguration { + b.Driver = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *CSIVolumeSourceApplyConfiguration) WithReadOnly(value bool) *CSIVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *CSIVolumeSourceApplyConfiguration) WithFSType(value string) *CSIVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithVolumeAttributes puts the entries into the VolumeAttributes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the VolumeAttributes field, +// overwriting an existing map entries in VolumeAttributes field with the same key. +func (b *CSIVolumeSourceApplyConfiguration) WithVolumeAttributes(entries map[string]string) *CSIVolumeSourceApplyConfiguration { + if b.VolumeAttributes == nil && len(entries) > 0 { + b.VolumeAttributes = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.VolumeAttributes[k] = v + } + return b +} + +// WithNodePublishSecretRef sets the NodePublishSecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodePublishSecretRef field is set to the value of the last call. +func (b *CSIVolumeSourceApplyConfiguration) WithNodePublishSecretRef(value *LocalObjectReferenceApplyConfiguration) *CSIVolumeSourceApplyConfiguration { + b.NodePublishSecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/daemonendpoint.go b/pkg/generated/applyconfigurations/core/v1/daemonendpoint.go new file mode 100644 index 00000000000..7f2594249e5 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/daemonendpoint.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// DaemonEndpointApplyConfiguration represents an declarative configuration of the DaemonEndpoint type for use +// with apply. +type DaemonEndpointApplyConfiguration struct { + Port *int32 `json:"Port,omitempty"` +} + +// DaemonEndpointApplyConfiguration constructs an declarative configuration of the DaemonEndpoint type for use with +// apply. +func DaemonEndpoint() *DaemonEndpointApplyConfiguration { + return &DaemonEndpointApplyConfiguration{} +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *DaemonEndpointApplyConfiguration) WithPort(value int32) *DaemonEndpointApplyConfiguration { + b.Port = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/downwardapiprojection.go b/pkg/generated/applyconfigurations/core/v1/downwardapiprojection.go new file mode 100644 index 00000000000..95920b09ad7 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/downwardapiprojection.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// DownwardAPIProjectionApplyConfiguration represents an declarative configuration of the DownwardAPIProjection type for use +// with apply. +type DownwardAPIProjectionApplyConfiguration struct { + Items []DownwardAPIVolumeFileApplyConfiguration `json:"items,omitempty"` +} + +// DownwardAPIProjectionApplyConfiguration constructs an declarative configuration of the DownwardAPIProjection type for use with +// apply. +func DownwardAPIProjection() *DownwardAPIProjectionApplyConfiguration { + return &DownwardAPIProjectionApplyConfiguration{} +} + +// WithItems adds the given value to the Items field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Items field. +func (b *DownwardAPIProjectionApplyConfiguration) WithItems(values ...*DownwardAPIVolumeFileApplyConfiguration) *DownwardAPIProjectionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithItems") + } + b.Items = append(b.Items, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/downwardapivolumefile.go b/pkg/generated/applyconfigurations/core/v1/downwardapivolumefile.go new file mode 100644 index 00000000000..2b4fb3323c3 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/downwardapivolumefile.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// DownwardAPIVolumeFileApplyConfiguration represents an declarative configuration of the DownwardAPIVolumeFile type for use +// with apply. +type DownwardAPIVolumeFileApplyConfiguration struct { + Path *string `json:"path,omitempty"` + FieldRef *ObjectFieldSelectorApplyConfiguration `json:"fieldRef,omitempty"` + ResourceFieldRef *ResourceFieldSelectorApplyConfiguration `json:"resourceFieldRef,omitempty"` + Mode *int32 `json:"mode,omitempty"` +} + +// DownwardAPIVolumeFileApplyConfiguration constructs an declarative configuration of the DownwardAPIVolumeFile type for use with +// apply. +func DownwardAPIVolumeFile() *DownwardAPIVolumeFileApplyConfiguration { + return &DownwardAPIVolumeFileApplyConfiguration{} +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *DownwardAPIVolumeFileApplyConfiguration) WithPath(value string) *DownwardAPIVolumeFileApplyConfiguration { + b.Path = &value + return b +} + +// WithFieldRef sets the FieldRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldRef field is set to the value of the last call. +func (b *DownwardAPIVolumeFileApplyConfiguration) WithFieldRef(value *ObjectFieldSelectorApplyConfiguration) *DownwardAPIVolumeFileApplyConfiguration { + b.FieldRef = value + return b +} + +// WithResourceFieldRef sets the ResourceFieldRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceFieldRef field is set to the value of the last call. +func (b *DownwardAPIVolumeFileApplyConfiguration) WithResourceFieldRef(value *ResourceFieldSelectorApplyConfiguration) *DownwardAPIVolumeFileApplyConfiguration { + b.ResourceFieldRef = value + return b +} + +// WithMode sets the Mode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mode field is set to the value of the last call. +func (b *DownwardAPIVolumeFileApplyConfiguration) WithMode(value int32) *DownwardAPIVolumeFileApplyConfiguration { + b.Mode = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/downwardapivolumesource.go b/pkg/generated/applyconfigurations/core/v1/downwardapivolumesource.go new file mode 100644 index 00000000000..bf84ad6b7bc --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/downwardapivolumesource.go @@ -0,0 +1,42 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// DownwardAPIVolumeSourceApplyConfiguration represents an declarative configuration of the DownwardAPIVolumeSource type for use +// with apply. +type DownwardAPIVolumeSourceApplyConfiguration struct { + Items []DownwardAPIVolumeFileApplyConfiguration `json:"items,omitempty"` + DefaultMode *int32 `json:"defaultMode,omitempty"` +} + +// DownwardAPIVolumeSourceApplyConfiguration constructs an declarative configuration of the DownwardAPIVolumeSource type for use with +// apply. +func DownwardAPIVolumeSource() *DownwardAPIVolumeSourceApplyConfiguration { + return &DownwardAPIVolumeSourceApplyConfiguration{} +} + +// WithItems adds the given value to the Items field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Items field. +func (b *DownwardAPIVolumeSourceApplyConfiguration) WithItems(values ...*DownwardAPIVolumeFileApplyConfiguration) *DownwardAPIVolumeSourceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithItems") + } + b.Items = append(b.Items, *values[i]) + } + return b +} + +// WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultMode field is set to the value of the last call. +func (b *DownwardAPIVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *DownwardAPIVolumeSourceApplyConfiguration { + b.DefaultMode = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/emptydirvolumesource.go b/pkg/generated/applyconfigurations/core/v1/emptydirvolumesource.go new file mode 100644 index 00000000000..b4d0179bf70 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/emptydirvolumesource.go @@ -0,0 +1,42 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// EmptyDirVolumeSourceApplyConfiguration represents an declarative configuration of the EmptyDirVolumeSource type for use +// with apply. +type EmptyDirVolumeSourceApplyConfiguration struct { + Medium *v1.StorageMedium `json:"medium,omitempty"` + SizeLimit *resource.Quantity `json:"sizeLimit,omitempty"` +} + +// EmptyDirVolumeSourceApplyConfiguration constructs an declarative configuration of the EmptyDirVolumeSource type for use with +// apply. +func EmptyDirVolumeSource() *EmptyDirVolumeSourceApplyConfiguration { + return &EmptyDirVolumeSourceApplyConfiguration{} +} + +// WithMedium sets the Medium field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Medium field is set to the value of the last call. +func (b *EmptyDirVolumeSourceApplyConfiguration) WithMedium(value v1.StorageMedium) *EmptyDirVolumeSourceApplyConfiguration { + b.Medium = &value + return b +} + +// WithSizeLimit sets the SizeLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SizeLimit field is set to the value of the last call. +func (b *EmptyDirVolumeSourceApplyConfiguration) WithSizeLimit(value resource.Quantity) *EmptyDirVolumeSourceApplyConfiguration { + b.SizeLimit = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/endpointaddress.go b/pkg/generated/applyconfigurations/core/v1/endpointaddress.go new file mode 100644 index 00000000000..b9df2ce7074 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/endpointaddress.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EndpointAddressApplyConfiguration represents an declarative configuration of the EndpointAddress type for use +// with apply. +type EndpointAddressApplyConfiguration struct { + IP *string `json:"ip,omitempty"` + Hostname *string `json:"hostname,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + TargetRef *ObjectReferenceApplyConfiguration `json:"targetRef,omitempty"` +} + +// EndpointAddressApplyConfiguration constructs an declarative configuration of the EndpointAddress type for use with +// apply. +func EndpointAddress() *EndpointAddressApplyConfiguration { + return &EndpointAddressApplyConfiguration{} +} + +// WithIP sets the IP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IP field is set to the value of the last call. +func (b *EndpointAddressApplyConfiguration) WithIP(value string) *EndpointAddressApplyConfiguration { + b.IP = &value + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *EndpointAddressApplyConfiguration) WithHostname(value string) *EndpointAddressApplyConfiguration { + b.Hostname = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *EndpointAddressApplyConfiguration) WithNodeName(value string) *EndpointAddressApplyConfiguration { + b.NodeName = &value + return b +} + +// WithTargetRef sets the TargetRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetRef field is set to the value of the last call. +func (b *EndpointAddressApplyConfiguration) WithTargetRef(value *ObjectReferenceApplyConfiguration) *EndpointAddressApplyConfiguration { + b.TargetRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/endpointport.go b/pkg/generated/applyconfigurations/core/v1/endpointport.go new file mode 100644 index 00000000000..510eee15100 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/endpointport.go @@ -0,0 +1,59 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// EndpointPortApplyConfiguration represents an declarative configuration of the EndpointPort type for use +// with apply. +type EndpointPortApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Port *int32 `json:"port,omitempty"` + Protocol *v1.Protocol `json:"protocol,omitempty"` + AppProtocol *string `json:"appProtocol,omitempty"` +} + +// EndpointPortApplyConfiguration constructs an declarative configuration of the EndpointPort type for use with +// apply. +func EndpointPort() *EndpointPortApplyConfiguration { + return &EndpointPortApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EndpointPortApplyConfiguration) WithName(value string) *EndpointPortApplyConfiguration { + b.Name = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *EndpointPortApplyConfiguration) WithPort(value int32) *EndpointPortApplyConfiguration { + b.Port = &value + return b +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *EndpointPortApplyConfiguration) WithProtocol(value v1.Protocol) *EndpointPortApplyConfiguration { + b.Protocol = &value + return b +} + +// WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AppProtocol field is set to the value of the last call. +func (b *EndpointPortApplyConfiguration) WithAppProtocol(value string) *EndpointPortApplyConfiguration { + b.AppProtocol = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/endpoints.go b/pkg/generated/applyconfigurations/core/v1/endpoints.go new file mode 100644 index 00000000000..cfaa53c2677 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/endpoints.go @@ -0,0 +1,243 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// EndpointsApplyConfiguration represents an declarative configuration of the Endpoints type for use +// with apply. +type EndpointsApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Subsets []EndpointSubsetApplyConfiguration `json:"subsets,omitempty"` +} + +// Endpoints constructs an declarative configuration of the Endpoints type for use with +// apply. +func Endpoints(name, namespace string) *EndpointsApplyConfiguration { + b := &EndpointsApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Endpoints") + b.WithAPIVersion("v1") + return b +} + +// ExtractEndpoints extracts the applied configuration owned by fieldManager from +// endpoints. If no managedFields are found in endpoints for fieldManager, a +// EndpointsApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// endpoints must be a unmodified Endpoints API object that was retrieved from the Kubernetes API. +// ExtractEndpoints provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEndpoints(endpoints *apicorev1.Endpoints, fieldManager string) (*EndpointsApplyConfiguration, error) { + return extractEndpoints(endpoints, fieldManager, "") +} + +// ExtractEndpointsStatus is the same as ExtractEndpoints except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEndpointsStatus(endpoints *apicorev1.Endpoints, fieldManager string) (*EndpointsApplyConfiguration, error) { + return extractEndpoints(endpoints, fieldManager, "status") +} + +func extractEndpoints(endpoints *apicorev1.Endpoints, fieldManager string, subresource string) (*EndpointsApplyConfiguration, error) { + b := &EndpointsApplyConfiguration{} + err := managedfields.ExtractInto(endpoints, internal.Parser().Type("io.k8s.api.core.v1.Endpoints"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(endpoints.Name) + b.WithNamespace(endpoints.Namespace) + + b.WithKind("Endpoints") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithKind(value string) *EndpointsApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithAPIVersion(value string) *EndpointsApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithName(value string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithGenerateName(value string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithNamespace(value string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithUID(value types.UID) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithResourceVersion(value string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithGeneration(value int64) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *EndpointsApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EndpointsApplyConfiguration) WithLabels(entries map[string]string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EndpointsApplyConfiguration) WithAnnotations(entries map[string]string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *EndpointsApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *EndpointsApplyConfiguration) WithFinalizers(values ...string) *EndpointsApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *EndpointsApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSubsets adds the given value to the Subsets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Subsets field. +func (b *EndpointsApplyConfiguration) WithSubsets(values ...*EndpointSubsetApplyConfiguration) *EndpointsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSubsets") + } + b.Subsets = append(b.Subsets, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/endpointsubset.go b/pkg/generated/applyconfigurations/core/v1/endpointsubset.go new file mode 100644 index 00000000000..c610bc1c66d --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/endpointsubset.go @@ -0,0 +1,61 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EndpointSubsetApplyConfiguration represents an declarative configuration of the EndpointSubset type for use +// with apply. +type EndpointSubsetApplyConfiguration struct { + Addresses []EndpointAddressApplyConfiguration `json:"addresses,omitempty"` + NotReadyAddresses []EndpointAddressApplyConfiguration `json:"notReadyAddresses,omitempty"` + Ports []EndpointPortApplyConfiguration `json:"ports,omitempty"` +} + +// EndpointSubsetApplyConfiguration constructs an declarative configuration of the EndpointSubset type for use with +// apply. +func EndpointSubset() *EndpointSubsetApplyConfiguration { + return &EndpointSubsetApplyConfiguration{} +} + +// WithAddresses adds the given value to the Addresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Addresses field. +func (b *EndpointSubsetApplyConfiguration) WithAddresses(values ...*EndpointAddressApplyConfiguration) *EndpointSubsetApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAddresses") + } + b.Addresses = append(b.Addresses, *values[i]) + } + return b +} + +// WithNotReadyAddresses adds the given value to the NotReadyAddresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NotReadyAddresses field. +func (b *EndpointSubsetApplyConfiguration) WithNotReadyAddresses(values ...*EndpointAddressApplyConfiguration) *EndpointSubsetApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithNotReadyAddresses") + } + b.NotReadyAddresses = append(b.NotReadyAddresses, *values[i]) + } + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *EndpointSubsetApplyConfiguration) WithPorts(values ...*EndpointPortApplyConfiguration) *EndpointSubsetApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/envfromsource.go b/pkg/generated/applyconfigurations/core/v1/envfromsource.go new file mode 100644 index 00000000000..11518ea6e2f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/envfromsource.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EnvFromSourceApplyConfiguration represents an declarative configuration of the EnvFromSource type for use +// with apply. +type EnvFromSourceApplyConfiguration struct { + Prefix *string `json:"prefix,omitempty"` + ConfigMapRef *ConfigMapEnvSourceApplyConfiguration `json:"configMapRef,omitempty"` + SecretRef *SecretEnvSourceApplyConfiguration `json:"secretRef,omitempty"` +} + +// EnvFromSourceApplyConfiguration constructs an declarative configuration of the EnvFromSource type for use with +// apply. +func EnvFromSource() *EnvFromSourceApplyConfiguration { + return &EnvFromSourceApplyConfiguration{} +} + +// WithPrefix sets the Prefix field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Prefix field is set to the value of the last call. +func (b *EnvFromSourceApplyConfiguration) WithPrefix(value string) *EnvFromSourceApplyConfiguration { + b.Prefix = &value + return b +} + +// WithConfigMapRef sets the ConfigMapRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMapRef field is set to the value of the last call. +func (b *EnvFromSourceApplyConfiguration) WithConfigMapRef(value *ConfigMapEnvSourceApplyConfiguration) *EnvFromSourceApplyConfiguration { + b.ConfigMapRef = value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *EnvFromSourceApplyConfiguration) WithSecretRef(value *SecretEnvSourceApplyConfiguration) *EnvFromSourceApplyConfiguration { + b.SecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/envvar.go b/pkg/generated/applyconfigurations/core/v1/envvar.go new file mode 100644 index 00000000000..cff564302b6 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/envvar.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EnvVarApplyConfiguration represents an declarative configuration of the EnvVar type for use +// with apply. +type EnvVarApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` + ValueFrom *EnvVarSourceApplyConfiguration `json:"valueFrom,omitempty"` +} + +// EnvVarApplyConfiguration constructs an declarative configuration of the EnvVar type for use with +// apply. +func EnvVar() *EnvVarApplyConfiguration { + return &EnvVarApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EnvVarApplyConfiguration) WithName(value string) *EnvVarApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *EnvVarApplyConfiguration) WithValue(value string) *EnvVarApplyConfiguration { + b.Value = &value + return b +} + +// WithValueFrom sets the ValueFrom field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ValueFrom field is set to the value of the last call. +func (b *EnvVarApplyConfiguration) WithValueFrom(value *EnvVarSourceApplyConfiguration) *EnvVarApplyConfiguration { + b.ValueFrom = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/envvarsource.go b/pkg/generated/applyconfigurations/core/v1/envvarsource.go new file mode 100644 index 00000000000..f0690b92944 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/envvarsource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EnvVarSourceApplyConfiguration represents an declarative configuration of the EnvVarSource type for use +// with apply. +type EnvVarSourceApplyConfiguration struct { + FieldRef *ObjectFieldSelectorApplyConfiguration `json:"fieldRef,omitempty"` + ResourceFieldRef *ResourceFieldSelectorApplyConfiguration `json:"resourceFieldRef,omitempty"` + ConfigMapKeyRef *ConfigMapKeySelectorApplyConfiguration `json:"configMapKeyRef,omitempty"` + SecretKeyRef *SecretKeySelectorApplyConfiguration `json:"secretKeyRef,omitempty"` +} + +// EnvVarSourceApplyConfiguration constructs an declarative configuration of the EnvVarSource type for use with +// apply. +func EnvVarSource() *EnvVarSourceApplyConfiguration { + return &EnvVarSourceApplyConfiguration{} +} + +// WithFieldRef sets the FieldRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldRef field is set to the value of the last call. +func (b *EnvVarSourceApplyConfiguration) WithFieldRef(value *ObjectFieldSelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { + b.FieldRef = value + return b +} + +// WithResourceFieldRef sets the ResourceFieldRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceFieldRef field is set to the value of the last call. +func (b *EnvVarSourceApplyConfiguration) WithResourceFieldRef(value *ResourceFieldSelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { + b.ResourceFieldRef = value + return b +} + +// WithConfigMapKeyRef sets the ConfigMapKeyRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMapKeyRef field is set to the value of the last call. +func (b *EnvVarSourceApplyConfiguration) WithConfigMapKeyRef(value *ConfigMapKeySelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { + b.ConfigMapKeyRef = value + return b +} + +// WithSecretKeyRef sets the SecretKeyRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretKeyRef field is set to the value of the last call. +func (b *EnvVarSourceApplyConfiguration) WithSecretKeyRef(value *SecretKeySelectorApplyConfiguration) *EnvVarSourceApplyConfiguration { + b.SecretKeyRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/ephemeralcontainer.go b/pkg/generated/applyconfigurations/core/v1/ephemeralcontainer.go new file mode 100644 index 00000000000..ad528690305 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/ephemeralcontainer.go @@ -0,0 +1,259 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// EphemeralContainerApplyConfiguration represents an declarative configuration of the EphemeralContainer type for use +// with apply. +type EphemeralContainerApplyConfiguration struct { + EphemeralContainerCommonApplyConfiguration `json:",inline"` + TargetContainerName *string `json:"targetContainerName,omitempty"` +} + +// EphemeralContainerApplyConfiguration constructs an declarative configuration of the EphemeralContainer type for use with +// apply. +func EphemeralContainer() *EphemeralContainerApplyConfiguration { + return &EphemeralContainerApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithName(value string) *EphemeralContainerApplyConfiguration { + b.Name = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithImage(value string) *EphemeralContainerApplyConfiguration { + b.Image = &value + return b +} + +// WithCommand adds the given value to the Command field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Command field. +func (b *EphemeralContainerApplyConfiguration) WithCommand(values ...string) *EphemeralContainerApplyConfiguration { + for i := range values { + b.Command = append(b.Command, values[i]) + } + return b +} + +// WithArgs adds the given value to the Args field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Args field. +func (b *EphemeralContainerApplyConfiguration) WithArgs(values ...string) *EphemeralContainerApplyConfiguration { + for i := range values { + b.Args = append(b.Args, values[i]) + } + return b +} + +// WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkingDir field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithWorkingDir(value string) *EphemeralContainerApplyConfiguration { + b.WorkingDir = &value + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *EphemeralContainerApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} + +// WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EnvFrom field. +func (b *EphemeralContainerApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEnvFrom") + } + b.EnvFrom = append(b.EnvFrom, *values[i]) + } + return b +} + +// WithEnv adds the given value to the Env field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Env field. +func (b *EphemeralContainerApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) + } + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *EphemeralContainerApplyConfiguration { + b.Resources = value + return b +} + +// WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResizePolicy field. +func (b *EphemeralContainerApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResizePolicy") + } + b.ResizePolicy = append(b.ResizePolicy, *values[i]) + } + return b +} + +// WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartPolicy field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *EphemeralContainerApplyConfiguration { + b.RestartPolicy = &value + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *EphemeralContainerApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeMounts") + } + b.VolumeMounts = append(b.VolumeMounts, *values[i]) + } + return b +} + +// WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeDevices field. +func (b *EphemeralContainerApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *EphemeralContainerApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeDevices") + } + b.VolumeDevices = append(b.VolumeDevices, *values[i]) + } + return b +} + +// WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LivenessProbe field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration { + b.LivenessProbe = value + return b +} + +// WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadinessProbe field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration { + b.ReadinessProbe = value + return b +} + +// WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartupProbe field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *EphemeralContainerApplyConfiguration { + b.StartupProbe = value + return b +} + +// WithLifecycle sets the Lifecycle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Lifecycle field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *EphemeralContainerApplyConfiguration { + b.Lifecycle = value + return b +} + +// WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationMessagePath field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithTerminationMessagePath(value string) *EphemeralContainerApplyConfiguration { + b.TerminationMessagePath = &value + return b +} + +// WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationMessagePolicy field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *EphemeralContainerApplyConfiguration { + b.TerminationMessagePolicy = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *EphemeralContainerApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *EphemeralContainerApplyConfiguration { + b.SecurityContext = value + return b +} + +// WithStdin sets the Stdin field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Stdin field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithStdin(value bool) *EphemeralContainerApplyConfiguration { + b.Stdin = &value + return b +} + +// WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StdinOnce field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithStdinOnce(value bool) *EphemeralContainerApplyConfiguration { + b.StdinOnce = &value + return b +} + +// WithTTY sets the TTY field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TTY field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithTTY(value bool) *EphemeralContainerApplyConfiguration { + b.TTY = &value + return b +} + +// WithTargetContainerName sets the TargetContainerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetContainerName field is set to the value of the last call. +func (b *EphemeralContainerApplyConfiguration) WithTargetContainerName(value string) *EphemeralContainerApplyConfiguration { + b.TargetContainerName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/ephemeralcontainercommon.go b/pkg/generated/applyconfigurations/core/v1/ephemeralcontainercommon.go new file mode 100644 index 00000000000..1fcfa2782c7 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/ephemeralcontainercommon.go @@ -0,0 +1,273 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// EphemeralContainerCommonApplyConfiguration represents an declarative configuration of the EphemeralContainerCommon type for use +// with apply. +type EphemeralContainerCommonApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Image *string `json:"image,omitempty"` + Command []string `json:"command,omitempty"` + Args []string `json:"args,omitempty"` + WorkingDir *string `json:"workingDir,omitempty"` + Ports []ContainerPortApplyConfiguration `json:"ports,omitempty"` + EnvFrom []EnvFromSourceApplyConfiguration `json:"envFrom,omitempty"` + Env []EnvVarApplyConfiguration `json:"env,omitempty"` + Resources *ResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + ResizePolicy []ContainerResizePolicyApplyConfiguration `json:"resizePolicy,omitempty"` + RestartPolicy *corev1.ContainerRestartPolicy `json:"restartPolicy,omitempty"` + VolumeMounts []VolumeMountApplyConfiguration `json:"volumeMounts,omitempty"` + VolumeDevices []VolumeDeviceApplyConfiguration `json:"volumeDevices,omitempty"` + LivenessProbe *ProbeApplyConfiguration `json:"livenessProbe,omitempty"` + ReadinessProbe *ProbeApplyConfiguration `json:"readinessProbe,omitempty"` + StartupProbe *ProbeApplyConfiguration `json:"startupProbe,omitempty"` + Lifecycle *LifecycleApplyConfiguration `json:"lifecycle,omitempty"` + TerminationMessagePath *string `json:"terminationMessagePath,omitempty"` + TerminationMessagePolicy *corev1.TerminationMessagePolicy `json:"terminationMessagePolicy,omitempty"` + ImagePullPolicy *corev1.PullPolicy `json:"imagePullPolicy,omitempty"` + SecurityContext *SecurityContextApplyConfiguration `json:"securityContext,omitempty"` + Stdin *bool `json:"stdin,omitempty"` + StdinOnce *bool `json:"stdinOnce,omitempty"` + TTY *bool `json:"tty,omitempty"` +} + +// EphemeralContainerCommonApplyConfiguration constructs an declarative configuration of the EphemeralContainerCommon type for use with +// apply. +func EphemeralContainerCommon() *EphemeralContainerCommonApplyConfiguration { + return &EphemeralContainerCommonApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithName(value string) *EphemeralContainerCommonApplyConfiguration { + b.Name = &value + return b +} + +// WithImage sets the Image field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Image field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithImage(value string) *EphemeralContainerCommonApplyConfiguration { + b.Image = &value + return b +} + +// WithCommand adds the given value to the Command field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Command field. +func (b *EphemeralContainerCommonApplyConfiguration) WithCommand(values ...string) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + b.Command = append(b.Command, values[i]) + } + return b +} + +// WithArgs adds the given value to the Args field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Args field. +func (b *EphemeralContainerCommonApplyConfiguration) WithArgs(values ...string) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + b.Args = append(b.Args, values[i]) + } + return b +} + +// WithWorkingDir sets the WorkingDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WorkingDir field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithWorkingDir(value string) *EphemeralContainerCommonApplyConfiguration { + b.WorkingDir = &value + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *EphemeralContainerCommonApplyConfiguration) WithPorts(values ...*ContainerPortApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} + +// WithEnvFrom adds the given value to the EnvFrom field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EnvFrom field. +func (b *EphemeralContainerCommonApplyConfiguration) WithEnvFrom(values ...*EnvFromSourceApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEnvFrom") + } + b.EnvFrom = append(b.EnvFrom, *values[i]) + } + return b +} + +// WithEnv adds the given value to the Env field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Env field. +func (b *EphemeralContainerCommonApplyConfiguration) WithEnv(values ...*EnvVarApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEnv") + } + b.Env = append(b.Env, *values[i]) + } + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithResources(value *ResourceRequirementsApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + b.Resources = value + return b +} + +// WithResizePolicy adds the given value to the ResizePolicy field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResizePolicy field. +func (b *EphemeralContainerCommonApplyConfiguration) WithResizePolicy(values ...*ContainerResizePolicyApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResizePolicy") + } + b.ResizePolicy = append(b.ResizePolicy, *values[i]) + } + return b +} + +// WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartPolicy field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithRestartPolicy(value corev1.ContainerRestartPolicy) *EphemeralContainerCommonApplyConfiguration { + b.RestartPolicy = &value + return b +} + +// WithVolumeMounts adds the given value to the VolumeMounts field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeMounts field. +func (b *EphemeralContainerCommonApplyConfiguration) WithVolumeMounts(values ...*VolumeMountApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeMounts") + } + b.VolumeMounts = append(b.VolumeMounts, *values[i]) + } + return b +} + +// WithVolumeDevices adds the given value to the VolumeDevices field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumeDevices field. +func (b *EphemeralContainerCommonApplyConfiguration) WithVolumeDevices(values ...*VolumeDeviceApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumeDevices") + } + b.VolumeDevices = append(b.VolumeDevices, *values[i]) + } + return b +} + +// WithLivenessProbe sets the LivenessProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LivenessProbe field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithLivenessProbe(value *ProbeApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + b.LivenessProbe = value + return b +} + +// WithReadinessProbe sets the ReadinessProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadinessProbe field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithReadinessProbe(value *ProbeApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + b.ReadinessProbe = value + return b +} + +// WithStartupProbe sets the StartupProbe field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartupProbe field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithStartupProbe(value *ProbeApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + b.StartupProbe = value + return b +} + +// WithLifecycle sets the Lifecycle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Lifecycle field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithLifecycle(value *LifecycleApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + b.Lifecycle = value + return b +} + +// WithTerminationMessagePath sets the TerminationMessagePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationMessagePath field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithTerminationMessagePath(value string) *EphemeralContainerCommonApplyConfiguration { + b.TerminationMessagePath = &value + return b +} + +// WithTerminationMessagePolicy sets the TerminationMessagePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationMessagePolicy field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithTerminationMessagePolicy(value corev1.TerminationMessagePolicy) *EphemeralContainerCommonApplyConfiguration { + b.TerminationMessagePolicy = &value + return b +} + +// WithImagePullPolicy sets the ImagePullPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ImagePullPolicy field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithImagePullPolicy(value corev1.PullPolicy) *EphemeralContainerCommonApplyConfiguration { + b.ImagePullPolicy = &value + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithSecurityContext(value *SecurityContextApplyConfiguration) *EphemeralContainerCommonApplyConfiguration { + b.SecurityContext = value + return b +} + +// WithStdin sets the Stdin field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Stdin field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithStdin(value bool) *EphemeralContainerCommonApplyConfiguration { + b.Stdin = &value + return b +} + +// WithStdinOnce sets the StdinOnce field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StdinOnce field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithStdinOnce(value bool) *EphemeralContainerCommonApplyConfiguration { + b.StdinOnce = &value + return b +} + +// WithTTY sets the TTY field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TTY field is set to the value of the last call. +func (b *EphemeralContainerCommonApplyConfiguration) WithTTY(value bool) *EphemeralContainerCommonApplyConfiguration { + b.TTY = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/ephemeralvolumesource.go b/pkg/generated/applyconfigurations/core/v1/ephemeralvolumesource.go new file mode 100644 index 00000000000..f899aea0883 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/ephemeralvolumesource.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EphemeralVolumeSourceApplyConfiguration represents an declarative configuration of the EphemeralVolumeSource type for use +// with apply. +type EphemeralVolumeSourceApplyConfiguration struct { + VolumeClaimTemplate *PersistentVolumeClaimTemplateApplyConfiguration `json:"volumeClaimTemplate,omitempty"` +} + +// EphemeralVolumeSourceApplyConfiguration constructs an declarative configuration of the EphemeralVolumeSource type for use with +// apply. +func EphemeralVolumeSource() *EphemeralVolumeSourceApplyConfiguration { + return &EphemeralVolumeSourceApplyConfiguration{} +} + +// WithVolumeClaimTemplate sets the VolumeClaimTemplate field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeClaimTemplate field is set to the value of the last call. +func (b *EphemeralVolumeSourceApplyConfiguration) WithVolumeClaimTemplate(value *PersistentVolumeClaimTemplateApplyConfiguration) *EphemeralVolumeSourceApplyConfiguration { + b.VolumeClaimTemplate = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/event.go b/pkg/generated/applyconfigurations/core/v1/event.go new file mode 100644 index 00000000000..daf6c435196 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/event.go @@ -0,0 +1,355 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// EventApplyConfiguration represents an declarative configuration of the Event type for use +// with apply. +type EventApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + InvolvedObject *ObjectReferenceApplyConfiguration `json:"involvedObject,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` + Source *EventSourceApplyConfiguration `json:"source,omitempty"` + FirstTimestamp *metav1.Time `json:"firstTimestamp,omitempty"` + LastTimestamp *metav1.Time `json:"lastTimestamp,omitempty"` + Count *int32 `json:"count,omitempty"` + Type *string `json:"type,omitempty"` + EventTime *metav1.MicroTime `json:"eventTime,omitempty"` + Series *EventSeriesApplyConfiguration `json:"series,omitempty"` + Action *string `json:"action,omitempty"` + Related *ObjectReferenceApplyConfiguration `json:"related,omitempty"` + ReportingController *string `json:"reportingComponent,omitempty"` + ReportingInstance *string `json:"reportingInstance,omitempty"` +} + +// Event constructs an declarative configuration of the Event type for use with +// apply. +func Event(name, namespace string) *EventApplyConfiguration { + b := &EventApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Event") + b.WithAPIVersion("v1") + return b +} + +// ExtractEvent extracts the applied configuration owned by fieldManager from +// event. If no managedFields are found in event for fieldManager, a +// EventApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// event must be a unmodified Event API object that was retrieved from the Kubernetes API. +// ExtractEvent provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractEvent(event *apicorev1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "") +} + +// ExtractEventStatus is the same as ExtractEvent except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractEventStatus(event *apicorev1.Event, fieldManager string) (*EventApplyConfiguration, error) { + return extractEvent(event, fieldManager, "status") +} + +func extractEvent(event *apicorev1.Event, fieldManager string, subresource string) (*EventApplyConfiguration, error) { + b := &EventApplyConfiguration{} + err := managedfields.ExtractInto(event, internal.Parser().Type("io.k8s.api.core.v1.Event"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(event.Name) + b.WithNamespace(event.Namespace) + + b.WithKind("Event") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *EventApplyConfiguration) WithKind(value string) *EventApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *EventApplyConfiguration) WithAPIVersion(value string) *EventApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *EventApplyConfiguration) WithName(value string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *EventApplyConfiguration) WithGenerateName(value string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *EventApplyConfiguration) WithNamespace(value string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *EventApplyConfiguration) WithUID(value types.UID) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *EventApplyConfiguration) WithResourceVersion(value string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *EventApplyConfiguration) WithGeneration(value int64) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *EventApplyConfiguration) WithCreationTimestamp(value metav1.Time) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *EventApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *EventApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *EventApplyConfiguration) WithLabels(entries map[string]string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *EventApplyConfiguration) WithAnnotations(entries map[string]string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *EventApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *EventApplyConfiguration) WithFinalizers(values ...string) *EventApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *EventApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithInvolvedObject sets the InvolvedObject field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InvolvedObject field is set to the value of the last call. +func (b *EventApplyConfiguration) WithInvolvedObject(value *ObjectReferenceApplyConfiguration) *EventApplyConfiguration { + b.InvolvedObject = value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *EventApplyConfiguration) WithReason(value string) *EventApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *EventApplyConfiguration) WithMessage(value string) *EventApplyConfiguration { + b.Message = &value + return b +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *EventApplyConfiguration) WithSource(value *EventSourceApplyConfiguration) *EventApplyConfiguration { + b.Source = value + return b +} + +// WithFirstTimestamp sets the FirstTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FirstTimestamp field is set to the value of the last call. +func (b *EventApplyConfiguration) WithFirstTimestamp(value metav1.Time) *EventApplyConfiguration { + b.FirstTimestamp = &value + return b +} + +// WithLastTimestamp sets the LastTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTimestamp field is set to the value of the last call. +func (b *EventApplyConfiguration) WithLastTimestamp(value metav1.Time) *EventApplyConfiguration { + b.LastTimestamp = &value + return b +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *EventApplyConfiguration) WithCount(value int32) *EventApplyConfiguration { + b.Count = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *EventApplyConfiguration) WithType(value string) *EventApplyConfiguration { + b.Type = &value + return b +} + +// WithEventTime sets the EventTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EventTime field is set to the value of the last call. +func (b *EventApplyConfiguration) WithEventTime(value metav1.MicroTime) *EventApplyConfiguration { + b.EventTime = &value + return b +} + +// WithSeries sets the Series field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Series field is set to the value of the last call. +func (b *EventApplyConfiguration) WithSeries(value *EventSeriesApplyConfiguration) *EventApplyConfiguration { + b.Series = value + return b +} + +// WithAction sets the Action field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Action field is set to the value of the last call. +func (b *EventApplyConfiguration) WithAction(value string) *EventApplyConfiguration { + b.Action = &value + return b +} + +// WithRelated sets the Related field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Related field is set to the value of the last call. +func (b *EventApplyConfiguration) WithRelated(value *ObjectReferenceApplyConfiguration) *EventApplyConfiguration { + b.Related = value + return b +} + +// WithReportingController sets the ReportingController field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReportingController field is set to the value of the last call. +func (b *EventApplyConfiguration) WithReportingController(value string) *EventApplyConfiguration { + b.ReportingController = &value + return b +} + +// WithReportingInstance sets the ReportingInstance field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReportingInstance field is set to the value of the last call. +func (b *EventApplyConfiguration) WithReportingInstance(value string) *EventApplyConfiguration { + b.ReportingInstance = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/eventseries.go b/pkg/generated/applyconfigurations/core/v1/eventseries.go new file mode 100644 index 00000000000..cbeba39522c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/eventseries.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EventSeriesApplyConfiguration represents an declarative configuration of the EventSeries type for use +// with apply. +type EventSeriesApplyConfiguration struct { + Count *int32 `json:"count,omitempty"` + LastObservedTime *v1.MicroTime `json:"lastObservedTime,omitempty"` +} + +// EventSeriesApplyConfiguration constructs an declarative configuration of the EventSeries type for use with +// apply. +func EventSeries() *EventSeriesApplyConfiguration { + return &EventSeriesApplyConfiguration{} +} + +// WithCount sets the Count field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Count field is set to the value of the last call. +func (b *EventSeriesApplyConfiguration) WithCount(value int32) *EventSeriesApplyConfiguration { + b.Count = &value + return b +} + +// WithLastObservedTime sets the LastObservedTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastObservedTime field is set to the value of the last call. +func (b *EventSeriesApplyConfiguration) WithLastObservedTime(value v1.MicroTime) *EventSeriesApplyConfiguration { + b.LastObservedTime = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/eventsource.go b/pkg/generated/applyconfigurations/core/v1/eventsource.go new file mode 100644 index 00000000000..d893521fb34 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/eventsource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// EventSourceApplyConfiguration represents an declarative configuration of the EventSource type for use +// with apply. +type EventSourceApplyConfiguration struct { + Component *string `json:"component,omitempty"` + Host *string `json:"host,omitempty"` +} + +// EventSourceApplyConfiguration constructs an declarative configuration of the EventSource type for use with +// apply. +func EventSource() *EventSourceApplyConfiguration { + return &EventSourceApplyConfiguration{} +} + +// WithComponent sets the Component field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Component field is set to the value of the last call. +func (b *EventSourceApplyConfiguration) WithComponent(value string) *EventSourceApplyConfiguration { + b.Component = &value + return b +} + +// WithHost sets the Host field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Host field is set to the value of the last call. +func (b *EventSourceApplyConfiguration) WithHost(value string) *EventSourceApplyConfiguration { + b.Host = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/execaction.go b/pkg/generated/applyconfigurations/core/v1/execaction.go new file mode 100644 index 00000000000..4e90d201c54 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/execaction.go @@ -0,0 +1,30 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ExecActionApplyConfiguration represents an declarative configuration of the ExecAction type for use +// with apply. +type ExecActionApplyConfiguration struct { + Command []string `json:"command,omitempty"` +} + +// ExecActionApplyConfiguration constructs an declarative configuration of the ExecAction type for use with +// apply. +func ExecAction() *ExecActionApplyConfiguration { + return &ExecActionApplyConfiguration{} +} + +// WithCommand adds the given value to the Command field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Command field. +func (b *ExecActionApplyConfiguration) WithCommand(values ...string) *ExecActionApplyConfiguration { + for i := range values { + b.Command = append(b.Command, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/fcvolumesource.go b/pkg/generated/applyconfigurations/core/v1/fcvolumesource.go new file mode 100644 index 00000000000..7e9d0a3e422 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/fcvolumesource.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FCVolumeSourceApplyConfiguration represents an declarative configuration of the FCVolumeSource type for use +// with apply. +type FCVolumeSourceApplyConfiguration struct { + TargetWWNs []string `json:"targetWWNs,omitempty"` + Lun *int32 `json:"lun,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + WWIDs []string `json:"wwids,omitempty"` +} + +// FCVolumeSourceApplyConfiguration constructs an declarative configuration of the FCVolumeSource type for use with +// apply. +func FCVolumeSource() *FCVolumeSourceApplyConfiguration { + return &FCVolumeSourceApplyConfiguration{} +} + +// WithTargetWWNs adds the given value to the TargetWWNs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TargetWWNs field. +func (b *FCVolumeSourceApplyConfiguration) WithTargetWWNs(values ...string) *FCVolumeSourceApplyConfiguration { + for i := range values { + b.TargetWWNs = append(b.TargetWWNs, values[i]) + } + return b +} + +// WithLun sets the Lun field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Lun field is set to the value of the last call. +func (b *FCVolumeSourceApplyConfiguration) WithLun(value int32) *FCVolumeSourceApplyConfiguration { + b.Lun = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *FCVolumeSourceApplyConfiguration) WithFSType(value string) *FCVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *FCVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FCVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithWWIDs adds the given value to the WWIDs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the WWIDs field. +func (b *FCVolumeSourceApplyConfiguration) WithWWIDs(values ...string) *FCVolumeSourceApplyConfiguration { + for i := range values { + b.WWIDs = append(b.WWIDs, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/flexpersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/flexpersistentvolumesource.go new file mode 100644 index 00000000000..afbe73e0ff0 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/flexpersistentvolumesource.go @@ -0,0 +1,70 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FlexPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the FlexPersistentVolumeSource type for use +// with apply. +type FlexPersistentVolumeSourceApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + FSType *string `json:"fsType,omitempty"` + SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Options map[string]string `json:"options,omitempty"` +} + +// FlexPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the FlexPersistentVolumeSource type for use with +// apply. +func FlexPersistentVolumeSource() *FlexPersistentVolumeSourceApplyConfiguration { + return &FlexPersistentVolumeSourceApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *FlexPersistentVolumeSourceApplyConfiguration) WithDriver(value string) *FlexPersistentVolumeSourceApplyConfiguration { + b.Driver = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *FlexPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *FlexPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *FlexPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *FlexPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *FlexPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FlexPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithOptions puts the entries into the Options field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Options field, +// overwriting an existing map entries in Options field with the same key. +func (b *FlexPersistentVolumeSourceApplyConfiguration) WithOptions(entries map[string]string) *FlexPersistentVolumeSourceApplyConfiguration { + if b.Options == nil && len(entries) > 0 { + b.Options = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Options[k] = v + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/flexvolumesource.go b/pkg/generated/applyconfigurations/core/v1/flexvolumesource.go new file mode 100644 index 00000000000..f330643bce3 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/flexvolumesource.go @@ -0,0 +1,70 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FlexVolumeSourceApplyConfiguration represents an declarative configuration of the FlexVolumeSource type for use +// with apply. +type FlexVolumeSourceApplyConfiguration struct { + Driver *string `json:"driver,omitempty"` + FSType *string `json:"fsType,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Options map[string]string `json:"options,omitempty"` +} + +// FlexVolumeSourceApplyConfiguration constructs an declarative configuration of the FlexVolumeSource type for use with +// apply. +func FlexVolumeSource() *FlexVolumeSourceApplyConfiguration { + return &FlexVolumeSourceApplyConfiguration{} +} + +// WithDriver sets the Driver field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Driver field is set to the value of the last call. +func (b *FlexVolumeSourceApplyConfiguration) WithDriver(value string) *FlexVolumeSourceApplyConfiguration { + b.Driver = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *FlexVolumeSourceApplyConfiguration) WithFSType(value string) *FlexVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *FlexVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *FlexVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *FlexVolumeSourceApplyConfiguration) WithReadOnly(value bool) *FlexVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithOptions puts the entries into the Options field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Options field, +// overwriting an existing map entries in Options field with the same key. +func (b *FlexVolumeSourceApplyConfiguration) WithOptions(entries map[string]string) *FlexVolumeSourceApplyConfiguration { + if b.Options == nil && len(entries) > 0 { + b.Options = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Options[k] = v + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/flockervolumesource.go b/pkg/generated/applyconfigurations/core/v1/flockervolumesource.go new file mode 100644 index 00000000000..5b93a19eb93 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/flockervolumesource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FlockerVolumeSourceApplyConfiguration represents an declarative configuration of the FlockerVolumeSource type for use +// with apply. +type FlockerVolumeSourceApplyConfiguration struct { + DatasetName *string `json:"datasetName,omitempty"` + DatasetUUID *string `json:"datasetUUID,omitempty"` +} + +// FlockerVolumeSourceApplyConfiguration constructs an declarative configuration of the FlockerVolumeSource type for use with +// apply. +func FlockerVolumeSource() *FlockerVolumeSourceApplyConfiguration { + return &FlockerVolumeSourceApplyConfiguration{} +} + +// WithDatasetName sets the DatasetName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DatasetName field is set to the value of the last call. +func (b *FlockerVolumeSourceApplyConfiguration) WithDatasetName(value string) *FlockerVolumeSourceApplyConfiguration { + b.DatasetName = &value + return b +} + +// WithDatasetUUID sets the DatasetUUID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DatasetUUID field is set to the value of the last call. +func (b *FlockerVolumeSourceApplyConfiguration) WithDatasetUUID(value string) *FlockerVolumeSourceApplyConfiguration { + b.DatasetUUID = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go b/pkg/generated/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go new file mode 100644 index 00000000000..f3d425c6c85 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/gcepersistentdiskvolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GCEPersistentDiskVolumeSourceApplyConfiguration represents an declarative configuration of the GCEPersistentDiskVolumeSource type for use +// with apply. +type GCEPersistentDiskVolumeSourceApplyConfiguration struct { + PDName *string `json:"pdName,omitempty"` + FSType *string `json:"fsType,omitempty"` + Partition *int32 `json:"partition,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// GCEPersistentDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the GCEPersistentDiskVolumeSource type for use with +// apply. +func GCEPersistentDiskVolumeSource() *GCEPersistentDiskVolumeSourceApplyConfiguration { + return &GCEPersistentDiskVolumeSourceApplyConfiguration{} +} + +// WithPDName sets the PDName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PDName field is set to the value of the last call. +func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithPDName(value string) *GCEPersistentDiskVolumeSourceApplyConfiguration { + b.PDName = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithFSType(value string) *GCEPersistentDiskVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithPartition sets the Partition field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Partition field is set to the value of the last call. +func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithPartition(value int32) *GCEPersistentDiskVolumeSourceApplyConfiguration { + b.Partition = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *GCEPersistentDiskVolumeSourceApplyConfiguration) WithReadOnly(value bool) *GCEPersistentDiskVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/gitrepovolumesource.go b/pkg/generated/applyconfigurations/core/v1/gitrepovolumesource.go new file mode 100644 index 00000000000..d2b0fab8c5e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/gitrepovolumesource.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GitRepoVolumeSourceApplyConfiguration represents an declarative configuration of the GitRepoVolumeSource type for use +// with apply. +type GitRepoVolumeSourceApplyConfiguration struct { + Repository *string `json:"repository,omitempty"` + Revision *string `json:"revision,omitempty"` + Directory *string `json:"directory,omitempty"` +} + +// GitRepoVolumeSourceApplyConfiguration constructs an declarative configuration of the GitRepoVolumeSource type for use with +// apply. +func GitRepoVolumeSource() *GitRepoVolumeSourceApplyConfiguration { + return &GitRepoVolumeSourceApplyConfiguration{} +} + +// WithRepository sets the Repository field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Repository field is set to the value of the last call. +func (b *GitRepoVolumeSourceApplyConfiguration) WithRepository(value string) *GitRepoVolumeSourceApplyConfiguration { + b.Repository = &value + return b +} + +// WithRevision sets the Revision field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Revision field is set to the value of the last call. +func (b *GitRepoVolumeSourceApplyConfiguration) WithRevision(value string) *GitRepoVolumeSourceApplyConfiguration { + b.Revision = &value + return b +} + +// WithDirectory sets the Directory field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Directory field is set to the value of the last call. +func (b *GitRepoVolumeSourceApplyConfiguration) WithDirectory(value string) *GitRepoVolumeSourceApplyConfiguration { + b.Directory = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/glusterfspersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/glusterfspersistentvolumesource.go new file mode 100644 index 00000000000..f3a78e0248b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/glusterfspersistentvolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GlusterfsPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the GlusterfsPersistentVolumeSource type for use +// with apply. +type GlusterfsPersistentVolumeSourceApplyConfiguration struct { + EndpointsName *string `json:"endpoints,omitempty"` + Path *string `json:"path,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + EndpointsNamespace *string `json:"endpointsNamespace,omitempty"` +} + +// GlusterfsPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the GlusterfsPersistentVolumeSource type for use with +// apply. +func GlusterfsPersistentVolumeSource() *GlusterfsPersistentVolumeSourceApplyConfiguration { + return &GlusterfsPersistentVolumeSourceApplyConfiguration{} +} + +// WithEndpointsName sets the EndpointsName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndpointsName field is set to the value of the last call. +func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithEndpointsName(value string) *GlusterfsPersistentVolumeSourceApplyConfiguration { + b.EndpointsName = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithPath(value string) *GlusterfsPersistentVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *GlusterfsPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithEndpointsNamespace sets the EndpointsNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndpointsNamespace field is set to the value of the last call. +func (b *GlusterfsPersistentVolumeSourceApplyConfiguration) WithEndpointsNamespace(value string) *GlusterfsPersistentVolumeSourceApplyConfiguration { + b.EndpointsNamespace = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/glusterfsvolumesource.go b/pkg/generated/applyconfigurations/core/v1/glusterfsvolumesource.go new file mode 100644 index 00000000000..cb0d048b40a --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/glusterfsvolumesource.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GlusterfsVolumeSourceApplyConfiguration represents an declarative configuration of the GlusterfsVolumeSource type for use +// with apply. +type GlusterfsVolumeSourceApplyConfiguration struct { + EndpointsName *string `json:"endpoints,omitempty"` + Path *string `json:"path,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// GlusterfsVolumeSourceApplyConfiguration constructs an declarative configuration of the GlusterfsVolumeSource type for use with +// apply. +func GlusterfsVolumeSource() *GlusterfsVolumeSourceApplyConfiguration { + return &GlusterfsVolumeSourceApplyConfiguration{} +} + +// WithEndpointsName sets the EndpointsName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EndpointsName field is set to the value of the last call. +func (b *GlusterfsVolumeSourceApplyConfiguration) WithEndpointsName(value string) *GlusterfsVolumeSourceApplyConfiguration { + b.EndpointsName = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *GlusterfsVolumeSourceApplyConfiguration) WithPath(value string) *GlusterfsVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *GlusterfsVolumeSourceApplyConfiguration) WithReadOnly(value bool) *GlusterfsVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/grpcaction.go b/pkg/generated/applyconfigurations/core/v1/grpcaction.go new file mode 100644 index 00000000000..6d7fcfc3b5d --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/grpcaction.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GRPCActionApplyConfiguration represents an declarative configuration of the GRPCAction type for use +// with apply. +type GRPCActionApplyConfiguration struct { + Port *int32 `json:"port,omitempty"` + Service *string `json:"service,omitempty"` +} + +// GRPCActionApplyConfiguration constructs an declarative configuration of the GRPCAction type for use with +// apply. +func GRPCAction() *GRPCActionApplyConfiguration { + return &GRPCActionApplyConfiguration{} +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *GRPCActionApplyConfiguration) WithPort(value int32) *GRPCActionApplyConfiguration { + b.Port = &value + return b +} + +// WithService sets the Service field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Service field is set to the value of the last call. +func (b *GRPCActionApplyConfiguration) WithService(value string) *GRPCActionApplyConfiguration { + b.Service = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/hostalias.go b/pkg/generated/applyconfigurations/core/v1/hostalias.go new file mode 100644 index 00000000000..8a7440b35cd --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/hostalias.go @@ -0,0 +1,39 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HostAliasApplyConfiguration represents an declarative configuration of the HostAlias type for use +// with apply. +type HostAliasApplyConfiguration struct { + IP *string `json:"ip,omitempty"` + Hostnames []string `json:"hostnames,omitempty"` +} + +// HostAliasApplyConfiguration constructs an declarative configuration of the HostAlias type for use with +// apply. +func HostAlias() *HostAliasApplyConfiguration { + return &HostAliasApplyConfiguration{} +} + +// WithIP sets the IP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IP field is set to the value of the last call. +func (b *HostAliasApplyConfiguration) WithIP(value string) *HostAliasApplyConfiguration { + b.IP = &value + return b +} + +// WithHostnames adds the given value to the Hostnames field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Hostnames field. +func (b *HostAliasApplyConfiguration) WithHostnames(values ...string) *HostAliasApplyConfiguration { + for i := range values { + b.Hostnames = append(b.Hostnames, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/hostip.go b/pkg/generated/applyconfigurations/core/v1/hostip.go new file mode 100644 index 00000000000..e48cf5054b9 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/hostip.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HostIPApplyConfiguration represents an declarative configuration of the HostIP type for use +// with apply. +type HostIPApplyConfiguration struct { + IP *string `json:"ip,omitempty"` +} + +// HostIPApplyConfiguration constructs an declarative configuration of the HostIP type for use with +// apply. +func HostIP() *HostIPApplyConfiguration { + return &HostIPApplyConfiguration{} +} + +// WithIP sets the IP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IP field is set to the value of the last call. +func (b *HostIPApplyConfiguration) WithIP(value string) *HostIPApplyConfiguration { + b.IP = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/hostpathvolumesource.go b/pkg/generated/applyconfigurations/core/v1/hostpathvolumesource.go new file mode 100644 index 00000000000..836824224ab --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/hostpathvolumesource.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// HostPathVolumeSourceApplyConfiguration represents an declarative configuration of the HostPathVolumeSource type for use +// with apply. +type HostPathVolumeSourceApplyConfiguration struct { + Path *string `json:"path,omitempty"` + Type *v1.HostPathType `json:"type,omitempty"` +} + +// HostPathVolumeSourceApplyConfiguration constructs an declarative configuration of the HostPathVolumeSource type for use with +// apply. +func HostPathVolumeSource() *HostPathVolumeSourceApplyConfiguration { + return &HostPathVolumeSourceApplyConfiguration{} +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *HostPathVolumeSourceApplyConfiguration) WithPath(value string) *HostPathVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *HostPathVolumeSourceApplyConfiguration) WithType(value v1.HostPathType) *HostPathVolumeSourceApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/httpgetaction.go b/pkg/generated/applyconfigurations/core/v1/httpgetaction.go new file mode 100644 index 00000000000..4d9b17dfec1 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/httpgetaction.go @@ -0,0 +1,74 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// HTTPGetActionApplyConfiguration represents an declarative configuration of the HTTPGetAction type for use +// with apply. +type HTTPGetActionApplyConfiguration struct { + Path *string `json:"path,omitempty"` + Port *intstr.IntOrString `json:"port,omitempty"` + Host *string `json:"host,omitempty"` + Scheme *v1.URIScheme `json:"scheme,omitempty"` + HTTPHeaders []HTTPHeaderApplyConfiguration `json:"httpHeaders,omitempty"` +} + +// HTTPGetActionApplyConfiguration constructs an declarative configuration of the HTTPGetAction type for use with +// apply. +func HTTPGetAction() *HTTPGetActionApplyConfiguration { + return &HTTPGetActionApplyConfiguration{} +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *HTTPGetActionApplyConfiguration) WithPath(value string) *HTTPGetActionApplyConfiguration { + b.Path = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *HTTPGetActionApplyConfiguration) WithPort(value intstr.IntOrString) *HTTPGetActionApplyConfiguration { + b.Port = &value + return b +} + +// WithHost sets the Host field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Host field is set to the value of the last call. +func (b *HTTPGetActionApplyConfiguration) WithHost(value string) *HTTPGetActionApplyConfiguration { + b.Host = &value + return b +} + +// WithScheme sets the Scheme field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Scheme field is set to the value of the last call. +func (b *HTTPGetActionApplyConfiguration) WithScheme(value v1.URIScheme) *HTTPGetActionApplyConfiguration { + b.Scheme = &value + return b +} + +// WithHTTPHeaders adds the given value to the HTTPHeaders field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HTTPHeaders field. +func (b *HTTPGetActionApplyConfiguration) WithHTTPHeaders(values ...*HTTPHeaderApplyConfiguration) *HTTPGetActionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHTTPHeaders") + } + b.HTTPHeaders = append(b.HTTPHeaders, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/httpheader.go b/pkg/generated/applyconfigurations/core/v1/httpheader.go new file mode 100644 index 00000000000..397cbf1bc9f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/httpheader.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// HTTPHeaderApplyConfiguration represents an declarative configuration of the HTTPHeader type for use +// with apply. +type HTTPHeaderApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// HTTPHeaderApplyConfiguration constructs an declarative configuration of the HTTPHeader type for use with +// apply. +func HTTPHeader() *HTTPHeaderApplyConfiguration { + return &HTTPHeaderApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *HTTPHeaderApplyConfiguration) WithName(value string) *HTTPHeaderApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *HTTPHeaderApplyConfiguration) WithValue(value string) *HTTPHeaderApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/iscsipersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/iscsipersistentvolumesource.go new file mode 100644 index 00000000000..273750acad4 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/iscsipersistentvolumesource.go @@ -0,0 +1,120 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ISCSIPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the ISCSIPersistentVolumeSource type for use +// with apply. +type ISCSIPersistentVolumeSourceApplyConfiguration struct { + TargetPortal *string `json:"targetPortal,omitempty"` + IQN *string `json:"iqn,omitempty"` + Lun *int32 `json:"lun,omitempty"` + ISCSIInterface *string `json:"iscsiInterface,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Portals []string `json:"portals,omitempty"` + DiscoveryCHAPAuth *bool `json:"chapAuthDiscovery,omitempty"` + SessionCHAPAuth *bool `json:"chapAuthSession,omitempty"` + SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` + InitiatorName *string `json:"initiatorName,omitempty"` +} + +// ISCSIPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the ISCSIPersistentVolumeSource type for use with +// apply. +func ISCSIPersistentVolumeSource() *ISCSIPersistentVolumeSourceApplyConfiguration { + return &ISCSIPersistentVolumeSourceApplyConfiguration{} +} + +// WithTargetPortal sets the TargetPortal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPortal field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithTargetPortal(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.TargetPortal = &value + return b +} + +// WithIQN sets the IQN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IQN field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithIQN(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.IQN = &value + return b +} + +// WithLun sets the Lun field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Lun field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithLun(value int32) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.Lun = &value + return b +} + +// WithISCSIInterface sets the ISCSIInterface field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ISCSIInterface field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithISCSIInterface(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.ISCSIInterface = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithPortals adds the given value to the Portals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Portals field. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithPortals(values ...string) *ISCSIPersistentVolumeSourceApplyConfiguration { + for i := range values { + b.Portals = append(b.Portals, values[i]) + } + return b +} + +// WithDiscoveryCHAPAuth sets the DiscoveryCHAPAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DiscoveryCHAPAuth field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithDiscoveryCHAPAuth(value bool) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.DiscoveryCHAPAuth = &value + return b +} + +// WithSessionCHAPAuth sets the SessionCHAPAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionCHAPAuth field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithSessionCHAPAuth(value bool) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.SessionCHAPAuth = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithInitiatorName sets the InitiatorName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InitiatorName field is set to the value of the last call. +func (b *ISCSIPersistentVolumeSourceApplyConfiguration) WithInitiatorName(value string) *ISCSIPersistentVolumeSourceApplyConfiguration { + b.InitiatorName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/iscsivolumesource.go b/pkg/generated/applyconfigurations/core/v1/iscsivolumesource.go new file mode 100644 index 00000000000..409dff312c0 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/iscsivolumesource.go @@ -0,0 +1,120 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ISCSIVolumeSourceApplyConfiguration represents an declarative configuration of the ISCSIVolumeSource type for use +// with apply. +type ISCSIVolumeSourceApplyConfiguration struct { + TargetPortal *string `json:"targetPortal,omitempty"` + IQN *string `json:"iqn,omitempty"` + Lun *int32 `json:"lun,omitempty"` + ISCSIInterface *string `json:"iscsiInterface,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + Portals []string `json:"portals,omitempty"` + DiscoveryCHAPAuth *bool `json:"chapAuthDiscovery,omitempty"` + SessionCHAPAuth *bool `json:"chapAuthSession,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` + InitiatorName *string `json:"initiatorName,omitempty"` +} + +// ISCSIVolumeSourceApplyConfiguration constructs an declarative configuration of the ISCSIVolumeSource type for use with +// apply. +func ISCSIVolumeSource() *ISCSIVolumeSourceApplyConfiguration { + return &ISCSIVolumeSourceApplyConfiguration{} +} + +// WithTargetPortal sets the TargetPortal field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPortal field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithTargetPortal(value string) *ISCSIVolumeSourceApplyConfiguration { + b.TargetPortal = &value + return b +} + +// WithIQN sets the IQN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IQN field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithIQN(value string) *ISCSIVolumeSourceApplyConfiguration { + b.IQN = &value + return b +} + +// WithLun sets the Lun field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Lun field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithLun(value int32) *ISCSIVolumeSourceApplyConfiguration { + b.Lun = &value + return b +} + +// WithISCSIInterface sets the ISCSIInterface field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ISCSIInterface field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithISCSIInterface(value string) *ISCSIVolumeSourceApplyConfiguration { + b.ISCSIInterface = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithFSType(value string) *ISCSIVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ISCSIVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithPortals adds the given value to the Portals field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Portals field. +func (b *ISCSIVolumeSourceApplyConfiguration) WithPortals(values ...string) *ISCSIVolumeSourceApplyConfiguration { + for i := range values { + b.Portals = append(b.Portals, values[i]) + } + return b +} + +// WithDiscoveryCHAPAuth sets the DiscoveryCHAPAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DiscoveryCHAPAuth field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithDiscoveryCHAPAuth(value bool) *ISCSIVolumeSourceApplyConfiguration { + b.DiscoveryCHAPAuth = &value + return b +} + +// WithSessionCHAPAuth sets the SessionCHAPAuth field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionCHAPAuth field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithSessionCHAPAuth(value bool) *ISCSIVolumeSourceApplyConfiguration { + b.SessionCHAPAuth = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *ISCSIVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithInitiatorName sets the InitiatorName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InitiatorName field is set to the value of the last call. +func (b *ISCSIVolumeSourceApplyConfiguration) WithInitiatorName(value string) *ISCSIVolumeSourceApplyConfiguration { + b.InitiatorName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/keytopath.go b/pkg/generated/applyconfigurations/core/v1/keytopath.go new file mode 100644 index 00000000000..6fb7b502cec --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/keytopath.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// KeyToPathApplyConfiguration represents an declarative configuration of the KeyToPath type for use +// with apply. +type KeyToPathApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Path *string `json:"path,omitempty"` + Mode *int32 `json:"mode,omitempty"` +} + +// KeyToPathApplyConfiguration constructs an declarative configuration of the KeyToPath type for use with +// apply. +func KeyToPath() *KeyToPathApplyConfiguration { + return &KeyToPathApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *KeyToPathApplyConfiguration) WithKey(value string) *KeyToPathApplyConfiguration { + b.Key = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *KeyToPathApplyConfiguration) WithPath(value string) *KeyToPathApplyConfiguration { + b.Path = &value + return b +} + +// WithMode sets the Mode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Mode field is set to the value of the last call. +func (b *KeyToPathApplyConfiguration) WithMode(value int32) *KeyToPathApplyConfiguration { + b.Mode = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/lifecycle.go b/pkg/generated/applyconfigurations/core/v1/lifecycle.go new file mode 100644 index 00000000000..a8c2759fbd2 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/lifecycle.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LifecycleApplyConfiguration represents an declarative configuration of the Lifecycle type for use +// with apply. +type LifecycleApplyConfiguration struct { + PostStart *LifecycleHandlerApplyConfiguration `json:"postStart,omitempty"` + PreStop *LifecycleHandlerApplyConfiguration `json:"preStop,omitempty"` +} + +// LifecycleApplyConfiguration constructs an declarative configuration of the Lifecycle type for use with +// apply. +func Lifecycle() *LifecycleApplyConfiguration { + return &LifecycleApplyConfiguration{} +} + +// WithPostStart sets the PostStart field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PostStart field is set to the value of the last call. +func (b *LifecycleApplyConfiguration) WithPostStart(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration { + b.PostStart = value + return b +} + +// WithPreStop sets the PreStop field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreStop field is set to the value of the last call. +func (b *LifecycleApplyConfiguration) WithPreStop(value *LifecycleHandlerApplyConfiguration) *LifecycleApplyConfiguration { + b.PreStop = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/lifecyclehandler.go b/pkg/generated/applyconfigurations/core/v1/lifecyclehandler.go new file mode 100644 index 00000000000..c614fbd64af --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/lifecyclehandler.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LifecycleHandlerApplyConfiguration represents an declarative configuration of the LifecycleHandler type for use +// with apply. +type LifecycleHandlerApplyConfiguration struct { + Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` + HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"` + TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"` + Sleep *SleepActionApplyConfiguration `json:"sleep,omitempty"` +} + +// LifecycleHandlerApplyConfiguration constructs an declarative configuration of the LifecycleHandler type for use with +// apply. +func LifecycleHandler() *LifecycleHandlerApplyConfiguration { + return &LifecycleHandlerApplyConfiguration{} +} + +// WithExec sets the Exec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Exec field is set to the value of the last call. +func (b *LifecycleHandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { + b.Exec = value + return b +} + +// WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPGet field is set to the value of the last call. +func (b *LifecycleHandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { + b.HTTPGet = value + return b +} + +// WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TCPSocket field is set to the value of the last call. +func (b *LifecycleHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { + b.TCPSocket = value + return b +} + +// WithSleep sets the Sleep field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Sleep field is set to the value of the last call. +func (b *LifecycleHandlerApplyConfiguration) WithSleep(value *SleepActionApplyConfiguration) *LifecycleHandlerApplyConfiguration { + b.Sleep = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/limitrange.go b/pkg/generated/applyconfigurations/core/v1/limitrange.go new file mode 100644 index 00000000000..464de157923 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/limitrange.go @@ -0,0 +1,238 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// LimitRangeApplyConfiguration represents an declarative configuration of the LimitRange type for use +// with apply. +type LimitRangeApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *LimitRangeSpecApplyConfiguration `json:"spec,omitempty"` +} + +// LimitRange constructs an declarative configuration of the LimitRange type for use with +// apply. +func LimitRange(name, namespace string) *LimitRangeApplyConfiguration { + b := &LimitRangeApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("LimitRange") + b.WithAPIVersion("v1") + return b +} + +// ExtractLimitRange extracts the applied configuration owned by fieldManager from +// limitRange. If no managedFields are found in limitRange for fieldManager, a +// LimitRangeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// limitRange must be a unmodified LimitRange API object that was retrieved from the Kubernetes API. +// ExtractLimitRange provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractLimitRange(limitRange *apicorev1.LimitRange, fieldManager string) (*LimitRangeApplyConfiguration, error) { + return extractLimitRange(limitRange, fieldManager, "") +} + +// ExtractLimitRangeStatus is the same as ExtractLimitRange except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractLimitRangeStatus(limitRange *apicorev1.LimitRange, fieldManager string) (*LimitRangeApplyConfiguration, error) { + return extractLimitRange(limitRange, fieldManager, "status") +} + +func extractLimitRange(limitRange *apicorev1.LimitRange, fieldManager string, subresource string) (*LimitRangeApplyConfiguration, error) { + b := &LimitRangeApplyConfiguration{} + err := managedfields.ExtractInto(limitRange, internal.Parser().Type("io.k8s.api.core.v1.LimitRange"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(limitRange.Name) + b.WithNamespace(limitRange.Namespace) + + b.WithKind("LimitRange") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithKind(value string) *LimitRangeApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithAPIVersion(value string) *LimitRangeApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithName(value string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithGenerateName(value string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithNamespace(value string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithUID(value types.UID) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithResourceVersion(value string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithGeneration(value int64) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *LimitRangeApplyConfiguration) WithLabels(entries map[string]string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *LimitRangeApplyConfiguration) WithAnnotations(entries map[string]string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *LimitRangeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *LimitRangeApplyConfiguration) WithFinalizers(values ...string) *LimitRangeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *LimitRangeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *LimitRangeApplyConfiguration) WithSpec(value *LimitRangeSpecApplyConfiguration) *LimitRangeApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/limitrangeitem.go b/pkg/generated/applyconfigurations/core/v1/limitrangeitem.go new file mode 100644 index 00000000000..2d79a1d9d32 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/limitrangeitem.go @@ -0,0 +1,77 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// LimitRangeItemApplyConfiguration represents an declarative configuration of the LimitRangeItem type for use +// with apply. +type LimitRangeItemApplyConfiguration struct { + Type *v1.LimitType `json:"type,omitempty"` + Max *v1.ResourceList `json:"max,omitempty"` + Min *v1.ResourceList `json:"min,omitempty"` + Default *v1.ResourceList `json:"default,omitempty"` + DefaultRequest *v1.ResourceList `json:"defaultRequest,omitempty"` + MaxLimitRequestRatio *v1.ResourceList `json:"maxLimitRequestRatio,omitempty"` +} + +// LimitRangeItemApplyConfiguration constructs an declarative configuration of the LimitRangeItem type for use with +// apply. +func LimitRangeItem() *LimitRangeItemApplyConfiguration { + return &LimitRangeItemApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *LimitRangeItemApplyConfiguration) WithType(value v1.LimitType) *LimitRangeItemApplyConfiguration { + b.Type = &value + return b +} + +// WithMax sets the Max field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Max field is set to the value of the last call. +func (b *LimitRangeItemApplyConfiguration) WithMax(value v1.ResourceList) *LimitRangeItemApplyConfiguration { + b.Max = &value + return b +} + +// WithMin sets the Min field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Min field is set to the value of the last call. +func (b *LimitRangeItemApplyConfiguration) WithMin(value v1.ResourceList) *LimitRangeItemApplyConfiguration { + b.Min = &value + return b +} + +// WithDefault sets the Default field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Default field is set to the value of the last call. +func (b *LimitRangeItemApplyConfiguration) WithDefault(value v1.ResourceList) *LimitRangeItemApplyConfiguration { + b.Default = &value + return b +} + +// WithDefaultRequest sets the DefaultRequest field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultRequest field is set to the value of the last call. +func (b *LimitRangeItemApplyConfiguration) WithDefaultRequest(value v1.ResourceList) *LimitRangeItemApplyConfiguration { + b.DefaultRequest = &value + return b +} + +// WithMaxLimitRequestRatio sets the MaxLimitRequestRatio field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxLimitRequestRatio field is set to the value of the last call. +func (b *LimitRangeItemApplyConfiguration) WithMaxLimitRequestRatio(value v1.ResourceList) *LimitRangeItemApplyConfiguration { + b.MaxLimitRequestRatio = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/limitrangespec.go b/pkg/generated/applyconfigurations/core/v1/limitrangespec.go new file mode 100644 index 00000000000..6f07e0c7db1 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/limitrangespec.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LimitRangeSpecApplyConfiguration represents an declarative configuration of the LimitRangeSpec type for use +// with apply. +type LimitRangeSpecApplyConfiguration struct { + Limits []LimitRangeItemApplyConfiguration `json:"limits,omitempty"` +} + +// LimitRangeSpecApplyConfiguration constructs an declarative configuration of the LimitRangeSpec type for use with +// apply. +func LimitRangeSpec() *LimitRangeSpecApplyConfiguration { + return &LimitRangeSpecApplyConfiguration{} +} + +// WithLimits adds the given value to the Limits field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Limits field. +func (b *LimitRangeSpecApplyConfiguration) WithLimits(values ...*LimitRangeItemApplyConfiguration) *LimitRangeSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithLimits") + } + b.Limits = append(b.Limits, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/loadbalanceringress.go b/pkg/generated/applyconfigurations/core/v1/loadbalanceringress.go new file mode 100644 index 00000000000..7b397d6fc07 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/loadbalanceringress.go @@ -0,0 +1,64 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// LoadBalancerIngressApplyConfiguration represents an declarative configuration of the LoadBalancerIngress type for use +// with apply. +type LoadBalancerIngressApplyConfiguration struct { + IP *string `json:"ip,omitempty"` + Hostname *string `json:"hostname,omitempty"` + IPMode *v1.LoadBalancerIPMode `json:"ipMode,omitempty"` + Ports []PortStatusApplyConfiguration `json:"ports,omitempty"` +} + +// LoadBalancerIngressApplyConfiguration constructs an declarative configuration of the LoadBalancerIngress type for use with +// apply. +func LoadBalancerIngress() *LoadBalancerIngressApplyConfiguration { + return &LoadBalancerIngressApplyConfiguration{} +} + +// WithIP sets the IP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IP field is set to the value of the last call. +func (b *LoadBalancerIngressApplyConfiguration) WithIP(value string) *LoadBalancerIngressApplyConfiguration { + b.IP = &value + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *LoadBalancerIngressApplyConfiguration) WithHostname(value string) *LoadBalancerIngressApplyConfiguration { + b.Hostname = &value + return b +} + +// WithIPMode sets the IPMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IPMode field is set to the value of the last call. +func (b *LoadBalancerIngressApplyConfiguration) WithIPMode(value v1.LoadBalancerIPMode) *LoadBalancerIngressApplyConfiguration { + b.IPMode = &value + return b +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *LoadBalancerIngressApplyConfiguration) WithPorts(values ...*PortStatusApplyConfiguration) *LoadBalancerIngressApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/loadbalancerstatus.go b/pkg/generated/applyconfigurations/core/v1/loadbalancerstatus.go new file mode 100644 index 00000000000..c96f0f31bd6 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/loadbalancerstatus.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LoadBalancerStatusApplyConfiguration represents an declarative configuration of the LoadBalancerStatus type for use +// with apply. +type LoadBalancerStatusApplyConfiguration struct { + Ingress []LoadBalancerIngressApplyConfiguration `json:"ingress,omitempty"` +} + +// LoadBalancerStatusApplyConfiguration constructs an declarative configuration of the LoadBalancerStatus type for use with +// apply. +func LoadBalancerStatus() *LoadBalancerStatusApplyConfiguration { + return &LoadBalancerStatusApplyConfiguration{} +} + +// WithIngress adds the given value to the Ingress field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ingress field. +func (b *LoadBalancerStatusApplyConfiguration) WithIngress(values ...*LoadBalancerIngressApplyConfiguration) *LoadBalancerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithIngress") + } + b.Ingress = append(b.Ingress, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/localobjectreference.go b/pkg/generated/applyconfigurations/core/v1/localobjectreference.go new file mode 100644 index 00000000000..077dc586b59 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/localobjectreference.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LocalObjectReferenceApplyConfiguration represents an declarative configuration of the LocalObjectReference type for use +// with apply. +type LocalObjectReferenceApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// LocalObjectReferenceApplyConfiguration constructs an declarative configuration of the LocalObjectReference type for use with +// apply. +func LocalObjectReference() *LocalObjectReferenceApplyConfiguration { + return &LocalObjectReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *LocalObjectReferenceApplyConfiguration) WithName(value string) *LocalObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/localvolumesource.go b/pkg/generated/applyconfigurations/core/v1/localvolumesource.go new file mode 100644 index 00000000000..5226f46775e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/localvolumesource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LocalVolumeSourceApplyConfiguration represents an declarative configuration of the LocalVolumeSource type for use +// with apply. +type LocalVolumeSourceApplyConfiguration struct { + Path *string `json:"path,omitempty"` + FSType *string `json:"fsType,omitempty"` +} + +// LocalVolumeSourceApplyConfiguration constructs an declarative configuration of the LocalVolumeSource type for use with +// apply. +func LocalVolumeSource() *LocalVolumeSourceApplyConfiguration { + return &LocalVolumeSourceApplyConfiguration{} +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *LocalVolumeSourceApplyConfiguration) WithPath(value string) *LocalVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *LocalVolumeSourceApplyConfiguration) WithFSType(value string) *LocalVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/modifyvolumestatus.go b/pkg/generated/applyconfigurations/core/v1/modifyvolumestatus.go new file mode 100644 index 00000000000..d80bd32283e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/modifyvolumestatus.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ModifyVolumeStatusApplyConfiguration represents an declarative configuration of the ModifyVolumeStatus type for use +// with apply. +type ModifyVolumeStatusApplyConfiguration struct { + TargetVolumeAttributesClassName *string `json:"targetVolumeAttributesClassName,omitempty"` + Status *v1.PersistentVolumeClaimModifyVolumeStatus `json:"status,omitempty"` +} + +// ModifyVolumeStatusApplyConfiguration constructs an declarative configuration of the ModifyVolumeStatus type for use with +// apply. +func ModifyVolumeStatus() *ModifyVolumeStatusApplyConfiguration { + return &ModifyVolumeStatusApplyConfiguration{} +} + +// WithTargetVolumeAttributesClassName sets the TargetVolumeAttributesClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetVolumeAttributesClassName field is set to the value of the last call. +func (b *ModifyVolumeStatusApplyConfiguration) WithTargetVolumeAttributesClassName(value string) *ModifyVolumeStatusApplyConfiguration { + b.TargetVolumeAttributesClassName = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ModifyVolumeStatusApplyConfiguration) WithStatus(value v1.PersistentVolumeClaimModifyVolumeStatus) *ModifyVolumeStatusApplyConfiguration { + b.Status = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/namespace.go b/pkg/generated/applyconfigurations/core/v1/namespace.go new file mode 100644 index 00000000000..6248d2ef272 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/namespace.go @@ -0,0 +1,245 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// NamespaceApplyConfiguration represents an declarative configuration of the Namespace type for use +// with apply. +type NamespaceApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *NamespaceSpecApplyConfiguration `json:"spec,omitempty"` + Status *NamespaceStatusApplyConfiguration `json:"status,omitempty"` +} + +// Namespace constructs an declarative configuration of the Namespace type for use with +// apply. +func Namespace(name string) *NamespaceApplyConfiguration { + b := &NamespaceApplyConfiguration{} + b.WithName(name) + b.WithKind("Namespace") + b.WithAPIVersion("v1") + return b +} + +// ExtractNamespace extracts the applied configuration owned by fieldManager from +// namespace. If no managedFields are found in namespace for fieldManager, a +// NamespaceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// namespace must be a unmodified Namespace API object that was retrieved from the Kubernetes API. +// ExtractNamespace provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractNamespace(namespace *apicorev1.Namespace, fieldManager string) (*NamespaceApplyConfiguration, error) { + return extractNamespace(namespace, fieldManager, "") +} + +// ExtractNamespaceStatus is the same as ExtractNamespace except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNamespaceStatus(namespace *apicorev1.Namespace, fieldManager string) (*NamespaceApplyConfiguration, error) { + return extractNamespace(namespace, fieldManager, "status") +} + +func extractNamespace(namespace *apicorev1.Namespace, fieldManager string, subresource string) (*NamespaceApplyConfiguration, error) { + b := &NamespaceApplyConfiguration{} + err := managedfields.ExtractInto(namespace, internal.Parser().Type("io.k8s.api.core.v1.Namespace"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(namespace.Name) + + b.WithKind("Namespace") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithKind(value string) *NamespaceApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithAPIVersion(value string) *NamespaceApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithName(value string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithGenerateName(value string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithNamespace(value string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithUID(value types.UID) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithResourceVersion(value string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithGeneration(value int64) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *NamespaceApplyConfiguration) WithLabels(entries map[string]string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *NamespaceApplyConfiguration) WithAnnotations(entries map[string]string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *NamespaceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *NamespaceApplyConfiguration) WithFinalizers(values ...string) *NamespaceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *NamespaceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithSpec(value *NamespaceSpecApplyConfiguration) *NamespaceApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *NamespaceApplyConfiguration) WithStatus(value *NamespaceStatusApplyConfiguration) *NamespaceApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/namespacecondition.go b/pkg/generated/applyconfigurations/core/v1/namespacecondition.go new file mode 100644 index 00000000000..2a8ce7963f3 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/namespacecondition.go @@ -0,0 +1,69 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NamespaceConditionApplyConfiguration represents an declarative configuration of the NamespaceCondition type for use +// with apply. +type NamespaceConditionApplyConfiguration struct { + Type *v1.NamespaceConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NamespaceConditionApplyConfiguration constructs an declarative configuration of the NamespaceCondition type for use with +// apply. +func NamespaceCondition() *NamespaceConditionApplyConfiguration { + return &NamespaceConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *NamespaceConditionApplyConfiguration) WithType(value v1.NamespaceConditionType) *NamespaceConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *NamespaceConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *NamespaceConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *NamespaceConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *NamespaceConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *NamespaceConditionApplyConfiguration) WithReason(value string) *NamespaceConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *NamespaceConditionApplyConfiguration) WithMessage(value string) *NamespaceConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/namespacespec.go b/pkg/generated/applyconfigurations/core/v1/namespacespec.go new file mode 100644 index 00000000000..77923e604aa --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/namespacespec.go @@ -0,0 +1,34 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// NamespaceSpecApplyConfiguration represents an declarative configuration of the NamespaceSpec type for use +// with apply. +type NamespaceSpecApplyConfiguration struct { + Finalizers []v1.FinalizerName `json:"finalizers,omitempty"` +} + +// NamespaceSpecApplyConfiguration constructs an declarative configuration of the NamespaceSpec type for use with +// apply. +func NamespaceSpec() *NamespaceSpecApplyConfiguration { + return &NamespaceSpecApplyConfiguration{} +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *NamespaceSpecApplyConfiguration) WithFinalizers(values ...v1.FinalizerName) *NamespaceSpecApplyConfiguration { + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/namespacestatus.go b/pkg/generated/applyconfigurations/core/v1/namespacestatus.go new file mode 100644 index 00000000000..8bce703f957 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/namespacestatus.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// NamespaceStatusApplyConfiguration represents an declarative configuration of the NamespaceStatus type for use +// with apply. +type NamespaceStatusApplyConfiguration struct { + Phase *v1.NamespacePhase `json:"phase,omitempty"` + Conditions []NamespaceConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// NamespaceStatusApplyConfiguration constructs an declarative configuration of the NamespaceStatus type for use with +// apply. +func NamespaceStatus() *NamespaceStatusApplyConfiguration { + return &NamespaceStatusApplyConfiguration{} +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *NamespaceStatusApplyConfiguration) WithPhase(value v1.NamespacePhase) *NamespaceStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *NamespaceStatusApplyConfiguration) WithConditions(values ...*NamespaceConditionApplyConfiguration) *NamespaceStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nfsvolumesource.go b/pkg/generated/applyconfigurations/core/v1/nfsvolumesource.go new file mode 100644 index 00000000000..c105a5b073c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nfsvolumesource.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NFSVolumeSourceApplyConfiguration represents an declarative configuration of the NFSVolumeSource type for use +// with apply. +type NFSVolumeSourceApplyConfiguration struct { + Server *string `json:"server,omitempty"` + Path *string `json:"path,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// NFSVolumeSourceApplyConfiguration constructs an declarative configuration of the NFSVolumeSource type for use with +// apply. +func NFSVolumeSource() *NFSVolumeSourceApplyConfiguration { + return &NFSVolumeSourceApplyConfiguration{} +} + +// WithServer sets the Server field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Server field is set to the value of the last call. +func (b *NFSVolumeSourceApplyConfiguration) WithServer(value string) *NFSVolumeSourceApplyConfiguration { + b.Server = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *NFSVolumeSourceApplyConfiguration) WithPath(value string) *NFSVolumeSourceApplyConfiguration { + b.Path = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *NFSVolumeSourceApplyConfiguration) WithReadOnly(value bool) *NFSVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/node.go b/pkg/generated/applyconfigurations/core/v1/node.go new file mode 100644 index 00000000000..106cb35df06 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/node.go @@ -0,0 +1,245 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// NodeApplyConfiguration represents an declarative configuration of the Node type for use +// with apply. +type NodeApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *NodeSpecApplyConfiguration `json:"spec,omitempty"` + Status *NodeStatusApplyConfiguration `json:"status,omitempty"` +} + +// Node constructs an declarative configuration of the Node type for use with +// apply. +func Node(name string) *NodeApplyConfiguration { + b := &NodeApplyConfiguration{} + b.WithName(name) + b.WithKind("Node") + b.WithAPIVersion("v1") + return b +} + +// ExtractNode extracts the applied configuration owned by fieldManager from +// node. If no managedFields are found in node for fieldManager, a +// NodeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// node must be a unmodified Node API object that was retrieved from the Kubernetes API. +// ExtractNode provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractNode(node *apicorev1.Node, fieldManager string) (*NodeApplyConfiguration, error) { + return extractNode(node, fieldManager, "") +} + +// ExtractNodeStatus is the same as ExtractNode except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractNodeStatus(node *apicorev1.Node, fieldManager string) (*NodeApplyConfiguration, error) { + return extractNode(node, fieldManager, "status") +} + +func extractNode(node *apicorev1.Node, fieldManager string, subresource string) (*NodeApplyConfiguration, error) { + b := &NodeApplyConfiguration{} + err := managedfields.ExtractInto(node, internal.Parser().Type("io.k8s.api.core.v1.Node"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(node.Name) + + b.WithKind("Node") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithKind(value string) *NodeApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithAPIVersion(value string) *NodeApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithName(value string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithGenerateName(value string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithNamespace(value string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithUID(value types.UID) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithResourceVersion(value string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithGeneration(value int64) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *NodeApplyConfiguration) WithLabels(entries map[string]string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *NodeApplyConfiguration) WithAnnotations(entries map[string]string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *NodeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *NodeApplyConfiguration) WithFinalizers(values ...string) *NodeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *NodeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithSpec(value *NodeSpecApplyConfiguration) *NodeApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *NodeApplyConfiguration) WithStatus(value *NodeStatusApplyConfiguration) *NodeApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeaddress.go b/pkg/generated/applyconfigurations/core/v1/nodeaddress.go new file mode 100644 index 00000000000..7e1c1541eb7 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeaddress.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// NodeAddressApplyConfiguration represents an declarative configuration of the NodeAddress type for use +// with apply. +type NodeAddressApplyConfiguration struct { + Type *v1.NodeAddressType `json:"type,omitempty"` + Address *string `json:"address,omitempty"` +} + +// NodeAddressApplyConfiguration constructs an declarative configuration of the NodeAddress type for use with +// apply. +func NodeAddress() *NodeAddressApplyConfiguration { + return &NodeAddressApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *NodeAddressApplyConfiguration) WithType(value v1.NodeAddressType) *NodeAddressApplyConfiguration { + b.Type = &value + return b +} + +// WithAddress sets the Address field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Address field is set to the value of the last call. +func (b *NodeAddressApplyConfiguration) WithAddress(value string) *NodeAddressApplyConfiguration { + b.Address = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeaffinity.go b/pkg/generated/applyconfigurations/core/v1/nodeaffinity.go new file mode 100644 index 00000000000..5a9b8b054c5 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeaffinity.go @@ -0,0 +1,42 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeAffinityApplyConfiguration represents an declarative configuration of the NodeAffinity type for use +// with apply. +type NodeAffinityApplyConfiguration struct { + RequiredDuringSchedulingIgnoredDuringExecution *NodeSelectorApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` + PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +// NodeAffinityApplyConfiguration constructs an declarative configuration of the NodeAffinity type for use with +// apply. +func NodeAffinity() *NodeAffinityApplyConfiguration { + return &NodeAffinityApplyConfiguration{} +} + +// WithRequiredDuringSchedulingIgnoredDuringExecution sets the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RequiredDuringSchedulingIgnoredDuringExecution field is set to the value of the last call. +func (b *NodeAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(value *NodeSelectorApplyConfiguration) *NodeAffinityApplyConfiguration { + b.RequiredDuringSchedulingIgnoredDuringExecution = value + return b +} + +// WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field. +func (b *NodeAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...*PreferredSchedulingTermApplyConfiguration) *NodeAffinityApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPreferredDuringSchedulingIgnoredDuringExecution") + } + b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodecondition.go b/pkg/generated/applyconfigurations/core/v1/nodecondition.go new file mode 100644 index 00000000000..4c1b18beb3c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodecondition.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// NodeConditionApplyConfiguration represents an declarative configuration of the NodeCondition type for use +// with apply. +type NodeConditionApplyConfiguration struct { + Type *v1.NodeConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastHeartbeatTime *metav1.Time `json:"lastHeartbeatTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// NodeConditionApplyConfiguration constructs an declarative configuration of the NodeCondition type for use with +// apply. +func NodeCondition() *NodeConditionApplyConfiguration { + return &NodeConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *NodeConditionApplyConfiguration) WithType(value v1.NodeConditionType) *NodeConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *NodeConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *NodeConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastHeartbeatTime sets the LastHeartbeatTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastHeartbeatTime field is set to the value of the last call. +func (b *NodeConditionApplyConfiguration) WithLastHeartbeatTime(value metav1.Time) *NodeConditionApplyConfiguration { + b.LastHeartbeatTime = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *NodeConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *NodeConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *NodeConditionApplyConfiguration) WithReason(value string) *NodeConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *NodeConditionApplyConfiguration) WithMessage(value string) *NodeConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeconfigsource.go b/pkg/generated/applyconfigurations/core/v1/nodeconfigsource.go new file mode 100644 index 00000000000..2a6c1d4e72c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeconfigsource.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeConfigSourceApplyConfiguration represents an declarative configuration of the NodeConfigSource type for use +// with apply. +type NodeConfigSourceApplyConfiguration struct { + ConfigMap *ConfigMapNodeConfigSourceApplyConfiguration `json:"configMap,omitempty"` +} + +// NodeConfigSourceApplyConfiguration constructs an declarative configuration of the NodeConfigSource type for use with +// apply. +func NodeConfigSource() *NodeConfigSourceApplyConfiguration { + return &NodeConfigSourceApplyConfiguration{} +} + +// WithConfigMap sets the ConfigMap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMap field is set to the value of the last call. +func (b *NodeConfigSourceApplyConfiguration) WithConfigMap(value *ConfigMapNodeConfigSourceApplyConfiguration) *NodeConfigSourceApplyConfiguration { + b.ConfigMap = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeconfigstatus.go b/pkg/generated/applyconfigurations/core/v1/nodeconfigstatus.go new file mode 100644 index 00000000000..c97f9262a31 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeconfigstatus.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeConfigStatusApplyConfiguration represents an declarative configuration of the NodeConfigStatus type for use +// with apply. +type NodeConfigStatusApplyConfiguration struct { + Assigned *NodeConfigSourceApplyConfiguration `json:"assigned,omitempty"` + Active *NodeConfigSourceApplyConfiguration `json:"active,omitempty"` + LastKnownGood *NodeConfigSourceApplyConfiguration `json:"lastKnownGood,omitempty"` + Error *string `json:"error,omitempty"` +} + +// NodeConfigStatusApplyConfiguration constructs an declarative configuration of the NodeConfigStatus type for use with +// apply. +func NodeConfigStatus() *NodeConfigStatusApplyConfiguration { + return &NodeConfigStatusApplyConfiguration{} +} + +// WithAssigned sets the Assigned field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Assigned field is set to the value of the last call. +func (b *NodeConfigStatusApplyConfiguration) WithAssigned(value *NodeConfigSourceApplyConfiguration) *NodeConfigStatusApplyConfiguration { + b.Assigned = value + return b +} + +// WithActive sets the Active field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Active field is set to the value of the last call. +func (b *NodeConfigStatusApplyConfiguration) WithActive(value *NodeConfigSourceApplyConfiguration) *NodeConfigStatusApplyConfiguration { + b.Active = value + return b +} + +// WithLastKnownGood sets the LastKnownGood field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastKnownGood field is set to the value of the last call. +func (b *NodeConfigStatusApplyConfiguration) WithLastKnownGood(value *NodeConfigSourceApplyConfiguration) *NodeConfigStatusApplyConfiguration { + b.LastKnownGood = value + return b +} + +// WithError sets the Error field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Error field is set to the value of the last call. +func (b *NodeConfigStatusApplyConfiguration) WithError(value string) *NodeConfigStatusApplyConfiguration { + b.Error = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodedaemonendpoints.go b/pkg/generated/applyconfigurations/core/v1/nodedaemonendpoints.go new file mode 100644 index 00000000000..f7994609955 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodedaemonendpoints.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeDaemonEndpointsApplyConfiguration represents an declarative configuration of the NodeDaemonEndpoints type for use +// with apply. +type NodeDaemonEndpointsApplyConfiguration struct { + KubeletEndpoint *DaemonEndpointApplyConfiguration `json:"kubeletEndpoint,omitempty"` +} + +// NodeDaemonEndpointsApplyConfiguration constructs an declarative configuration of the NodeDaemonEndpoints type for use with +// apply. +func NodeDaemonEndpoints() *NodeDaemonEndpointsApplyConfiguration { + return &NodeDaemonEndpointsApplyConfiguration{} +} + +// WithKubeletEndpoint sets the KubeletEndpoint field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeletEndpoint field is set to the value of the last call. +func (b *NodeDaemonEndpointsApplyConfiguration) WithKubeletEndpoint(value *DaemonEndpointApplyConfiguration) *NodeDaemonEndpointsApplyConfiguration { + b.KubeletEndpoint = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/noderuntimehandler.go b/pkg/generated/applyconfigurations/core/v1/noderuntimehandler.go new file mode 100644 index 00000000000..0334ffc895e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/noderuntimehandler.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeRuntimeHandlerApplyConfiguration represents an declarative configuration of the NodeRuntimeHandler type for use +// with apply. +type NodeRuntimeHandlerApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Features *NodeRuntimeHandlerFeaturesApplyConfiguration `json:"features,omitempty"` +} + +// NodeRuntimeHandlerApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandler type for use with +// apply. +func NodeRuntimeHandler() *NodeRuntimeHandlerApplyConfiguration { + return &NodeRuntimeHandlerApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *NodeRuntimeHandlerApplyConfiguration) WithName(value string) *NodeRuntimeHandlerApplyConfiguration { + b.Name = &value + return b +} + +// WithFeatures sets the Features field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Features field is set to the value of the last call. +func (b *NodeRuntimeHandlerApplyConfiguration) WithFeatures(value *NodeRuntimeHandlerFeaturesApplyConfiguration) *NodeRuntimeHandlerApplyConfiguration { + b.Features = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/noderuntimehandlerfeatures.go b/pkg/generated/applyconfigurations/core/v1/noderuntimehandlerfeatures.go new file mode 100644 index 00000000000..7ed53ec21a2 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/noderuntimehandlerfeatures.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeRuntimeHandlerFeaturesApplyConfiguration represents an declarative configuration of the NodeRuntimeHandlerFeatures type for use +// with apply. +type NodeRuntimeHandlerFeaturesApplyConfiguration struct { + RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty"` +} + +// NodeRuntimeHandlerFeaturesApplyConfiguration constructs an declarative configuration of the NodeRuntimeHandlerFeatures type for use with +// apply. +func NodeRuntimeHandlerFeatures() *NodeRuntimeHandlerFeaturesApplyConfiguration { + return &NodeRuntimeHandlerFeaturesApplyConfiguration{} +} + +// WithRecursiveReadOnlyMounts sets the RecursiveReadOnlyMounts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RecursiveReadOnlyMounts field is set to the value of the last call. +func (b *NodeRuntimeHandlerFeaturesApplyConfiguration) WithRecursiveReadOnlyMounts(value bool) *NodeRuntimeHandlerFeaturesApplyConfiguration { + b.RecursiveReadOnlyMounts = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeselector.go b/pkg/generated/applyconfigurations/core/v1/nodeselector.go new file mode 100644 index 00000000000..a62eaeabec6 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeselector.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeSelectorApplyConfiguration represents an declarative configuration of the NodeSelector type for use +// with apply. +type NodeSelectorApplyConfiguration struct { + NodeSelectorTerms []NodeSelectorTermApplyConfiguration `json:"nodeSelectorTerms,omitempty"` +} + +// NodeSelectorApplyConfiguration constructs an declarative configuration of the NodeSelector type for use with +// apply. +func NodeSelector() *NodeSelectorApplyConfiguration { + return &NodeSelectorApplyConfiguration{} +} + +// WithNodeSelectorTerms adds the given value to the NodeSelectorTerms field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NodeSelectorTerms field. +func (b *NodeSelectorApplyConfiguration) WithNodeSelectorTerms(values ...*NodeSelectorTermApplyConfiguration) *NodeSelectorApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithNodeSelectorTerms") + } + b.NodeSelectorTerms = append(b.NodeSelectorTerms, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeselectorrequirement.go b/pkg/generated/applyconfigurations/core/v1/nodeselectorrequirement.go new file mode 100644 index 00000000000..60d026c499f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeselectorrequirement.go @@ -0,0 +1,52 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// NodeSelectorRequirementApplyConfiguration represents an declarative configuration of the NodeSelectorRequirement type for use +// with apply. +type NodeSelectorRequirementApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *v1.NodeSelectorOperator `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` +} + +// NodeSelectorRequirementApplyConfiguration constructs an declarative configuration of the NodeSelectorRequirement type for use with +// apply. +func NodeSelectorRequirement() *NodeSelectorRequirementApplyConfiguration { + return &NodeSelectorRequirementApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *NodeSelectorRequirementApplyConfiguration) WithKey(value string) *NodeSelectorRequirementApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *NodeSelectorRequirementApplyConfiguration) WithOperator(value v1.NodeSelectorOperator) *NodeSelectorRequirementApplyConfiguration { + b.Operator = &value + return b +} + +// WithValues adds the given value to the Values field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Values field. +func (b *NodeSelectorRequirementApplyConfiguration) WithValues(values ...string) *NodeSelectorRequirementApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodeselectorterm.go b/pkg/generated/applyconfigurations/core/v1/nodeselectorterm.go new file mode 100644 index 00000000000..381d7e53d9d --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodeselectorterm.go @@ -0,0 +1,47 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeSelectorTermApplyConfiguration represents an declarative configuration of the NodeSelectorTerm type for use +// with apply. +type NodeSelectorTermApplyConfiguration struct { + MatchExpressions []NodeSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` + MatchFields []NodeSelectorRequirementApplyConfiguration `json:"matchFields,omitempty"` +} + +// NodeSelectorTermApplyConfiguration constructs an declarative configuration of the NodeSelectorTerm type for use with +// apply. +func NodeSelectorTerm() *NodeSelectorTermApplyConfiguration { + return &NodeSelectorTermApplyConfiguration{} +} + +// WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchExpressions field. +func (b *NodeSelectorTermApplyConfiguration) WithMatchExpressions(values ...*NodeSelectorRequirementApplyConfiguration) *NodeSelectorTermApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchExpressions") + } + b.MatchExpressions = append(b.MatchExpressions, *values[i]) + } + return b +} + +// WithMatchFields adds the given value to the MatchFields field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchFields field. +func (b *NodeSelectorTermApplyConfiguration) WithMatchFields(values ...*NodeSelectorRequirementApplyConfiguration) *NodeSelectorTermApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchFields") + } + b.MatchFields = append(b.MatchFields, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodespec.go b/pkg/generated/applyconfigurations/core/v1/nodespec.go new file mode 100644 index 00000000000..5fbca53cc87 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodespec.go @@ -0,0 +1,89 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeSpecApplyConfiguration represents an declarative configuration of the NodeSpec type for use +// with apply. +type NodeSpecApplyConfiguration struct { + PodCIDR *string `json:"podCIDR,omitempty"` + PodCIDRs []string `json:"podCIDRs,omitempty"` + ProviderID *string `json:"providerID,omitempty"` + Unschedulable *bool `json:"unschedulable,omitempty"` + Taints []TaintApplyConfiguration `json:"taints,omitempty"` + ConfigSource *NodeConfigSourceApplyConfiguration `json:"configSource,omitempty"` + DoNotUseExternalID *string `json:"externalID,omitempty"` +} + +// NodeSpecApplyConfiguration constructs an declarative configuration of the NodeSpec type for use with +// apply. +func NodeSpec() *NodeSpecApplyConfiguration { + return &NodeSpecApplyConfiguration{} +} + +// WithPodCIDR sets the PodCIDR field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodCIDR field is set to the value of the last call. +func (b *NodeSpecApplyConfiguration) WithPodCIDR(value string) *NodeSpecApplyConfiguration { + b.PodCIDR = &value + return b +} + +// WithPodCIDRs adds the given value to the PodCIDRs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodCIDRs field. +func (b *NodeSpecApplyConfiguration) WithPodCIDRs(values ...string) *NodeSpecApplyConfiguration { + for i := range values { + b.PodCIDRs = append(b.PodCIDRs, values[i]) + } + return b +} + +// WithProviderID sets the ProviderID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProviderID field is set to the value of the last call. +func (b *NodeSpecApplyConfiguration) WithProviderID(value string) *NodeSpecApplyConfiguration { + b.ProviderID = &value + return b +} + +// WithUnschedulable sets the Unschedulable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Unschedulable field is set to the value of the last call. +func (b *NodeSpecApplyConfiguration) WithUnschedulable(value bool) *NodeSpecApplyConfiguration { + b.Unschedulable = &value + return b +} + +// WithTaints adds the given value to the Taints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Taints field. +func (b *NodeSpecApplyConfiguration) WithTaints(values ...*TaintApplyConfiguration) *NodeSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTaints") + } + b.Taints = append(b.Taints, *values[i]) + } + return b +} + +// WithConfigSource sets the ConfigSource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigSource field is set to the value of the last call. +func (b *NodeSpecApplyConfiguration) WithConfigSource(value *NodeConfigSourceApplyConfiguration) *NodeSpecApplyConfiguration { + b.ConfigSource = value + return b +} + +// WithDoNotUseExternalID sets the DoNotUseExternalID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DoNotUseExternalID field is set to the value of the last call. +func (b *NodeSpecApplyConfiguration) WithDoNotUseExternalID(value string) *NodeSpecApplyConfiguration { + b.DoNotUseExternalID = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodestatus.go b/pkg/generated/applyconfigurations/core/v1/nodestatus.go new file mode 100644 index 00000000000..fcd8048ea5b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodestatus.go @@ -0,0 +1,158 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// NodeStatusApplyConfiguration represents an declarative configuration of the NodeStatus type for use +// with apply. +type NodeStatusApplyConfiguration struct { + Capacity *v1.ResourceList `json:"capacity,omitempty"` + Allocatable *v1.ResourceList `json:"allocatable,omitempty"` + Phase *v1.NodePhase `json:"phase,omitempty"` + Conditions []NodeConditionApplyConfiguration `json:"conditions,omitempty"` + Addresses []NodeAddressApplyConfiguration `json:"addresses,omitempty"` + DaemonEndpoints *NodeDaemonEndpointsApplyConfiguration `json:"daemonEndpoints,omitempty"` + NodeInfo *NodeSystemInfoApplyConfiguration `json:"nodeInfo,omitempty"` + Images []ContainerImageApplyConfiguration `json:"images,omitempty"` + VolumesInUse []v1.UniqueVolumeName `json:"volumesInUse,omitempty"` + VolumesAttached []AttachedVolumeApplyConfiguration `json:"volumesAttached,omitempty"` + Config *NodeConfigStatusApplyConfiguration `json:"config,omitempty"` + RuntimeHandlers []NodeRuntimeHandlerApplyConfiguration `json:"runtimeHandlers,omitempty"` +} + +// NodeStatusApplyConfiguration constructs an declarative configuration of the NodeStatus type for use with +// apply. +func NodeStatus() *NodeStatusApplyConfiguration { + return &NodeStatusApplyConfiguration{} +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithCapacity(value v1.ResourceList) *NodeStatusApplyConfiguration { + b.Capacity = &value + return b +} + +// WithAllocatable sets the Allocatable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Allocatable field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithAllocatable(value v1.ResourceList) *NodeStatusApplyConfiguration { + b.Allocatable = &value + return b +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithPhase(value v1.NodePhase) *NodeStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *NodeStatusApplyConfiguration) WithConditions(values ...*NodeConditionApplyConfiguration) *NodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithAddresses adds the given value to the Addresses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Addresses field. +func (b *NodeStatusApplyConfiguration) WithAddresses(values ...*NodeAddressApplyConfiguration) *NodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithAddresses") + } + b.Addresses = append(b.Addresses, *values[i]) + } + return b +} + +// WithDaemonEndpoints sets the DaemonEndpoints field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DaemonEndpoints field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithDaemonEndpoints(value *NodeDaemonEndpointsApplyConfiguration) *NodeStatusApplyConfiguration { + b.DaemonEndpoints = value + return b +} + +// WithNodeInfo sets the NodeInfo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeInfo field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithNodeInfo(value *NodeSystemInfoApplyConfiguration) *NodeStatusApplyConfiguration { + b.NodeInfo = value + return b +} + +// WithImages adds the given value to the Images field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Images field. +func (b *NodeStatusApplyConfiguration) WithImages(values ...*ContainerImageApplyConfiguration) *NodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithImages") + } + b.Images = append(b.Images, *values[i]) + } + return b +} + +// WithVolumesInUse adds the given value to the VolumesInUse field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumesInUse field. +func (b *NodeStatusApplyConfiguration) WithVolumesInUse(values ...v1.UniqueVolumeName) *NodeStatusApplyConfiguration { + for i := range values { + b.VolumesInUse = append(b.VolumesInUse, values[i]) + } + return b +} + +// WithVolumesAttached adds the given value to the VolumesAttached field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the VolumesAttached field. +func (b *NodeStatusApplyConfiguration) WithVolumesAttached(values ...*AttachedVolumeApplyConfiguration) *NodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumesAttached") + } + b.VolumesAttached = append(b.VolumesAttached, *values[i]) + } + return b +} + +// WithConfig sets the Config field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Config field is set to the value of the last call. +func (b *NodeStatusApplyConfiguration) WithConfig(value *NodeConfigStatusApplyConfiguration) *NodeStatusApplyConfiguration { + b.Config = value + return b +} + +// WithRuntimeHandlers adds the given value to the RuntimeHandlers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RuntimeHandlers field. +func (b *NodeStatusApplyConfiguration) WithRuntimeHandlers(values ...*NodeRuntimeHandlerApplyConfiguration) *NodeStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRuntimeHandlers") + } + b.RuntimeHandlers = append(b.RuntimeHandlers, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/nodesysteminfo.go b/pkg/generated/applyconfigurations/core/v1/nodesysteminfo.go new file mode 100644 index 00000000000..7e09614bc63 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/nodesysteminfo.go @@ -0,0 +1,109 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NodeSystemInfoApplyConfiguration represents an declarative configuration of the NodeSystemInfo type for use +// with apply. +type NodeSystemInfoApplyConfiguration struct { + MachineID *string `json:"machineID,omitempty"` + SystemUUID *string `json:"systemUUID,omitempty"` + BootID *string `json:"bootID,omitempty"` + KernelVersion *string `json:"kernelVersion,omitempty"` + OSImage *string `json:"osImage,omitempty"` + ContainerRuntimeVersion *string `json:"containerRuntimeVersion,omitempty"` + KubeletVersion *string `json:"kubeletVersion,omitempty"` + KubeProxyVersion *string `json:"kubeProxyVersion,omitempty"` + OperatingSystem *string `json:"operatingSystem,omitempty"` + Architecture *string `json:"architecture,omitempty"` +} + +// NodeSystemInfoApplyConfiguration constructs an declarative configuration of the NodeSystemInfo type for use with +// apply. +func NodeSystemInfo() *NodeSystemInfoApplyConfiguration { + return &NodeSystemInfoApplyConfiguration{} +} + +// WithMachineID sets the MachineID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MachineID field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithMachineID(value string) *NodeSystemInfoApplyConfiguration { + b.MachineID = &value + return b +} + +// WithSystemUUID sets the SystemUUID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SystemUUID field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithSystemUUID(value string) *NodeSystemInfoApplyConfiguration { + b.SystemUUID = &value + return b +} + +// WithBootID sets the BootID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BootID field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithBootID(value string) *NodeSystemInfoApplyConfiguration { + b.BootID = &value + return b +} + +// WithKernelVersion sets the KernelVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KernelVersion field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithKernelVersion(value string) *NodeSystemInfoApplyConfiguration { + b.KernelVersion = &value + return b +} + +// WithOSImage sets the OSImage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OSImage field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithOSImage(value string) *NodeSystemInfoApplyConfiguration { + b.OSImage = &value + return b +} + +// WithContainerRuntimeVersion sets the ContainerRuntimeVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerRuntimeVersion field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithContainerRuntimeVersion(value string) *NodeSystemInfoApplyConfiguration { + b.ContainerRuntimeVersion = &value + return b +} + +// WithKubeletVersion sets the KubeletVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeletVersion field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithKubeletVersion(value string) *NodeSystemInfoApplyConfiguration { + b.KubeletVersion = &value + return b +} + +// WithKubeProxyVersion sets the KubeProxyVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the KubeProxyVersion field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithKubeProxyVersion(value string) *NodeSystemInfoApplyConfiguration { + b.KubeProxyVersion = &value + return b +} + +// WithOperatingSystem sets the OperatingSystem field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OperatingSystem field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithOperatingSystem(value string) *NodeSystemInfoApplyConfiguration { + b.OperatingSystem = &value + return b +} + +// WithArchitecture sets the Architecture field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Architecture field is set to the value of the last call. +func (b *NodeSystemInfoApplyConfiguration) WithArchitecture(value string) *NodeSystemInfoApplyConfiguration { + b.Architecture = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/objectfieldselector.go b/pkg/generated/applyconfigurations/core/v1/objectfieldselector.go new file mode 100644 index 00000000000..86c87c14de8 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/objectfieldselector.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ObjectFieldSelectorApplyConfiguration represents an declarative configuration of the ObjectFieldSelector type for use +// with apply. +type ObjectFieldSelectorApplyConfiguration struct { + APIVersion *string `json:"apiVersion,omitempty"` + FieldPath *string `json:"fieldPath,omitempty"` +} + +// ObjectFieldSelectorApplyConfiguration constructs an declarative configuration of the ObjectFieldSelector type for use with +// apply. +func ObjectFieldSelector() *ObjectFieldSelectorApplyConfiguration { + return &ObjectFieldSelectorApplyConfiguration{} +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ObjectFieldSelectorApplyConfiguration) WithAPIVersion(value string) *ObjectFieldSelectorApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithFieldPath sets the FieldPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldPath field is set to the value of the last call. +func (b *ObjectFieldSelectorApplyConfiguration) WithFieldPath(value string) *ObjectFieldSelectorApplyConfiguration { + b.FieldPath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/objectreference.go b/pkg/generated/applyconfigurations/core/v1/objectreference.go new file mode 100644 index 00000000000..86bc70bf652 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/objectreference.go @@ -0,0 +1,86 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// ObjectReferenceApplyConfiguration represents an declarative configuration of the ObjectReference type for use +// with apply. +type ObjectReferenceApplyConfiguration struct { + Kind *string `json:"kind,omitempty"` + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` + UID *types.UID `json:"uid,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` + ResourceVersion *string `json:"resourceVersion,omitempty"` + FieldPath *string `json:"fieldPath,omitempty"` +} + +// ObjectReferenceApplyConfiguration constructs an declarative configuration of the ObjectReference type for use with +// apply. +func ObjectReference() *ObjectReferenceApplyConfiguration { + return &ObjectReferenceApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithKind(value string) *ObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithNamespace(value string) *ObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithName(value string) *ObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithUID(value types.UID) *ObjectReferenceApplyConfiguration { + b.UID = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithAPIVersion(value string) *ObjectReferenceApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithResourceVersion(value string) *ObjectReferenceApplyConfiguration { + b.ResourceVersion = &value + return b +} + +// WithFieldPath sets the FieldPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldPath field is set to the value of the last call. +func (b *ObjectReferenceApplyConfiguration) WithFieldPath(value string) *ObjectReferenceApplyConfiguration { + b.FieldPath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolume.go b/pkg/generated/applyconfigurations/core/v1/persistentvolume.go new file mode 100644 index 00000000000..02a187b4dfa --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolume.go @@ -0,0 +1,245 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// PersistentVolumeApplyConfiguration represents an declarative configuration of the PersistentVolume type for use +// with apply. +type PersistentVolumeApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PersistentVolumeSpecApplyConfiguration `json:"spec,omitempty"` + Status *PersistentVolumeStatusApplyConfiguration `json:"status,omitempty"` +} + +// PersistentVolume constructs an declarative configuration of the PersistentVolume type for use with +// apply. +func PersistentVolume(name string) *PersistentVolumeApplyConfiguration { + b := &PersistentVolumeApplyConfiguration{} + b.WithName(name) + b.WithKind("PersistentVolume") + b.WithAPIVersion("v1") + return b +} + +// ExtractPersistentVolume extracts the applied configuration owned by fieldManager from +// persistentVolume. If no managedFields are found in persistentVolume for fieldManager, a +// PersistentVolumeApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// persistentVolume must be a unmodified PersistentVolume API object that was retrieved from the Kubernetes API. +// ExtractPersistentVolume provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPersistentVolume(persistentVolume *apicorev1.PersistentVolume, fieldManager string) (*PersistentVolumeApplyConfiguration, error) { + return extractPersistentVolume(persistentVolume, fieldManager, "") +} + +// ExtractPersistentVolumeStatus is the same as ExtractPersistentVolume except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPersistentVolumeStatus(persistentVolume *apicorev1.PersistentVolume, fieldManager string) (*PersistentVolumeApplyConfiguration, error) { + return extractPersistentVolume(persistentVolume, fieldManager, "status") +} + +func extractPersistentVolume(persistentVolume *apicorev1.PersistentVolume, fieldManager string, subresource string) (*PersistentVolumeApplyConfiguration, error) { + b := &PersistentVolumeApplyConfiguration{} + err := managedfields.ExtractInto(persistentVolume, internal.Parser().Type("io.k8s.api.core.v1.PersistentVolume"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(persistentVolume.Name) + + b.WithKind("PersistentVolume") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithKind(value string) *PersistentVolumeApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithAPIVersion(value string) *PersistentVolumeApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithName(value string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithGenerateName(value string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithNamespace(value string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithUID(value types.UID) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithResourceVersion(value string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithGeneration(value int64) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PersistentVolumeApplyConfiguration) WithLabels(entries map[string]string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PersistentVolumeApplyConfiguration) WithAnnotations(entries map[string]string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PersistentVolumeApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PersistentVolumeApplyConfiguration) WithFinalizers(values ...string) *PersistentVolumeApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PersistentVolumeApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithSpec(value *PersistentVolumeSpecApplyConfiguration) *PersistentVolumeApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PersistentVolumeApplyConfiguration) WithStatus(value *PersistentVolumeStatusApplyConfiguration) *PersistentVolumeApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaim.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaim.go new file mode 100644 index 00000000000..54315ee144f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaim.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// PersistentVolumeClaimApplyConfiguration represents an declarative configuration of the PersistentVolumeClaim type for use +// with apply. +type PersistentVolumeClaimApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PersistentVolumeClaimSpecApplyConfiguration `json:"spec,omitempty"` + Status *PersistentVolumeClaimStatusApplyConfiguration `json:"status,omitempty"` +} + +// PersistentVolumeClaim constructs an declarative configuration of the PersistentVolumeClaim type for use with +// apply. +func PersistentVolumeClaim(name, namespace string) *PersistentVolumeClaimApplyConfiguration { + b := &PersistentVolumeClaimApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PersistentVolumeClaim") + b.WithAPIVersion("v1") + return b +} + +// ExtractPersistentVolumeClaim extracts the applied configuration owned by fieldManager from +// persistentVolumeClaim. If no managedFields are found in persistentVolumeClaim for fieldManager, a +// PersistentVolumeClaimApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// persistentVolumeClaim must be a unmodified PersistentVolumeClaim API object that was retrieved from the Kubernetes API. +// ExtractPersistentVolumeClaim provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPersistentVolumeClaim(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string) (*PersistentVolumeClaimApplyConfiguration, error) { + return extractPersistentVolumeClaim(persistentVolumeClaim, fieldManager, "") +} + +// ExtractPersistentVolumeClaimStatus is the same as ExtractPersistentVolumeClaim except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPersistentVolumeClaimStatus(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string) (*PersistentVolumeClaimApplyConfiguration, error) { + return extractPersistentVolumeClaim(persistentVolumeClaim, fieldManager, "status") +} + +func extractPersistentVolumeClaim(persistentVolumeClaim *apicorev1.PersistentVolumeClaim, fieldManager string, subresource string) (*PersistentVolumeClaimApplyConfiguration, error) { + b := &PersistentVolumeClaimApplyConfiguration{} + err := managedfields.ExtractInto(persistentVolumeClaim, internal.Parser().Type("io.k8s.api.core.v1.PersistentVolumeClaim"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(persistentVolumeClaim.Name) + b.WithNamespace(persistentVolumeClaim.Namespace) + + b.WithKind("PersistentVolumeClaim") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithKind(value string) *PersistentVolumeClaimApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithAPIVersion(value string) *PersistentVolumeClaimApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithName(value string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithGenerateName(value string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithNamespace(value string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithUID(value types.UID) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithResourceVersion(value string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithGeneration(value int64) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PersistentVolumeClaimApplyConfiguration) WithLabels(entries map[string]string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PersistentVolumeClaimApplyConfiguration) WithAnnotations(entries map[string]string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PersistentVolumeClaimApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PersistentVolumeClaimApplyConfiguration) WithFinalizers(values ...string) *PersistentVolumeClaimApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PersistentVolumeClaimApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithSpec(value *PersistentVolumeClaimSpecApplyConfiguration) *PersistentVolumeClaimApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PersistentVolumeClaimApplyConfiguration) WithStatus(value *PersistentVolumeClaimStatusApplyConfiguration) *PersistentVolumeClaimApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimcondition.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimcondition.go new file mode 100644 index 00000000000..0c14ef6e8e4 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimcondition.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PersistentVolumeClaimConditionApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimCondition type for use +// with apply. +type PersistentVolumeClaimConditionApplyConfiguration struct { + Type *v1.PersistentVolumeClaimConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// PersistentVolumeClaimConditionApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimCondition type for use with +// apply. +func PersistentVolumeClaimCondition() *PersistentVolumeClaimConditionApplyConfiguration { + return &PersistentVolumeClaimConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PersistentVolumeClaimConditionApplyConfiguration) WithType(value v1.PersistentVolumeClaimConditionType) *PersistentVolumeClaimConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PersistentVolumeClaimConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PersistentVolumeClaimConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastProbeTime sets the LastProbeTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastProbeTime field is set to the value of the last call. +func (b *PersistentVolumeClaimConditionApplyConfiguration) WithLastProbeTime(value metav1.Time) *PersistentVolumeClaimConditionApplyConfiguration { + b.LastProbeTime = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *PersistentVolumeClaimConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PersistentVolumeClaimConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *PersistentVolumeClaimConditionApplyConfiguration) WithReason(value string) *PersistentVolumeClaimConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PersistentVolumeClaimConditionApplyConfiguration) WithMessage(value string) *PersistentVolumeClaimConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimspec.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimspec.go new file mode 100644 index 00000000000..b487a2df393 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimspec.go @@ -0,0 +1,107 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + v1 "k8s.io/api/core/v1" +) + +// PersistentVolumeClaimSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimSpec type for use +// with apply. +type PersistentVolumeClaimSpecApplyConfiguration struct { + AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` + Selector *metav1.LabelSelectorApplyConfiguration `json:"selector,omitempty"` + Resources *VolumeResourceRequirementsApplyConfiguration `json:"resources,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` + DataSource *TypedLocalObjectReferenceApplyConfiguration `json:"dataSource,omitempty"` + DataSourceRef *TypedObjectReferenceApplyConfiguration `json:"dataSourceRef,omitempty"` + VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` +} + +// PersistentVolumeClaimSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimSpec type for use with +// apply. +func PersistentVolumeClaimSpec() *PersistentVolumeClaimSpecApplyConfiguration { + return &PersistentVolumeClaimSpecApplyConfiguration{} +} + +// WithAccessModes adds the given value to the AccessModes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AccessModes field. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeClaimSpecApplyConfiguration { + for i := range values { + b.AccessModes = append(b.AccessModes, values[i]) + } + return b +} + +// WithSelector sets the Selector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Selector field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithSelector(value *metav1.LabelSelectorApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { + b.Selector = value + return b +} + +// WithResources sets the Resources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resources field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithResources(value *VolumeResourceRequirementsApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { + b.Resources = value + return b +} + +// WithVolumeName sets the VolumeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeName field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeName(value string) *PersistentVolumeClaimSpecApplyConfiguration { + b.VolumeName = &value + return b +} + +// WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageClassName field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration { + b.StorageClassName = &value + return b +} + +// WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeMode field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *PersistentVolumeClaimSpecApplyConfiguration { + b.VolumeMode = &value + return b +} + +// WithDataSource sets the DataSource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DataSource field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSource(value *TypedLocalObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { + b.DataSource = value + return b +} + +// WithDataSourceRef sets the DataSourceRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DataSourceRef field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithDataSourceRef(value *TypedObjectReferenceApplyConfiguration) *PersistentVolumeClaimSpecApplyConfiguration { + b.DataSourceRef = value + return b +} + +// WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. +func (b *PersistentVolumeClaimSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeClaimSpecApplyConfiguration { + b.VolumeAttributesClassName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimstatus.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimstatus.go new file mode 100644 index 00000000000..c1f1ed8454d --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimstatus.go @@ -0,0 +1,108 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PersistentVolumeClaimStatusApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimStatus type for use +// with apply. +type PersistentVolumeClaimStatusApplyConfiguration struct { + Phase *v1.PersistentVolumeClaimPhase `json:"phase,omitempty"` + AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` + Capacity *v1.ResourceList `json:"capacity,omitempty"` + Conditions []PersistentVolumeClaimConditionApplyConfiguration `json:"conditions,omitempty"` + AllocatedResources *v1.ResourceList `json:"allocatedResources,omitempty"` + AllocatedResourceStatuses map[v1.ResourceName]v1.ClaimResourceStatus `json:"allocatedResourceStatuses,omitempty"` + CurrentVolumeAttributesClassName *string `json:"currentVolumeAttributesClassName,omitempty"` + ModifyVolumeStatus *ModifyVolumeStatusApplyConfiguration `json:"modifyVolumeStatus,omitempty"` +} + +// PersistentVolumeClaimStatusApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimStatus type for use with +// apply. +func PersistentVolumeClaimStatus() *PersistentVolumeClaimStatusApplyConfiguration { + return &PersistentVolumeClaimStatusApplyConfiguration{} +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithPhase(value v1.PersistentVolumeClaimPhase) *PersistentVolumeClaimStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithAccessModes adds the given value to the AccessModes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AccessModes field. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeClaimStatusApplyConfiguration { + for i := range values { + b.AccessModes = append(b.AccessModes, values[i]) + } + return b +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCapacity(value v1.ResourceList) *PersistentVolumeClaimStatusApplyConfiguration { + b.Capacity = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithConditions(values ...*PersistentVolumeClaimConditionApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithAllocatedResources sets the AllocatedResources field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocatedResources field is set to the value of the last call. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResources(value v1.ResourceList) *PersistentVolumeClaimStatusApplyConfiguration { + b.AllocatedResources = &value + return b +} + +// WithAllocatedResourceStatuses puts the entries into the AllocatedResourceStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the AllocatedResourceStatuses field, +// overwriting an existing map entries in AllocatedResourceStatuses field with the same key. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithAllocatedResourceStatuses(entries map[v1.ResourceName]v1.ClaimResourceStatus) *PersistentVolumeClaimStatusApplyConfiguration { + if b.AllocatedResourceStatuses == nil && len(entries) > 0 { + b.AllocatedResourceStatuses = make(map[v1.ResourceName]v1.ClaimResourceStatus, len(entries)) + } + for k, v := range entries { + b.AllocatedResourceStatuses[k] = v + } + return b +} + +// WithCurrentVolumeAttributesClassName sets the CurrentVolumeAttributesClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CurrentVolumeAttributesClassName field is set to the value of the last call. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithCurrentVolumeAttributesClassName(value string) *PersistentVolumeClaimStatusApplyConfiguration { + b.CurrentVolumeAttributesClassName = &value + return b +} + +// WithModifyVolumeStatus sets the ModifyVolumeStatus field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ModifyVolumeStatus field is set to the value of the last call. +func (b *PersistentVolumeClaimStatusApplyConfiguration) WithModifyVolumeStatus(value *ModifyVolumeStatusApplyConfiguration) *PersistentVolumeClaimStatusApplyConfiguration { + b.ModifyVolumeStatus = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go new file mode 100644 index 00000000000..d5973a4da8e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimtemplate.go @@ -0,0 +1,177 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// PersistentVolumeClaimTemplateApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimTemplate type for use +// with apply. +type PersistentVolumeClaimTemplateApplyConfiguration struct { + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PersistentVolumeClaimSpecApplyConfiguration `json:"spec,omitempty"` +} + +// PersistentVolumeClaimTemplateApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimTemplate type for use with +// apply. +func PersistentVolumeClaimTemplate() *PersistentVolumeClaimTemplateApplyConfiguration { + return &PersistentVolumeClaimTemplateApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithName(value string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithGenerateName(value string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithNamespace(value string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithUID(value types.UID) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithResourceVersion(value string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithGeneration(value int64) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithLabels(entries map[string]string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithFinalizers(values ...string) *PersistentVolumeClaimTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PersistentVolumeClaimTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PersistentVolumeClaimTemplateApplyConfiguration) WithSpec(value *PersistentVolumeClaimSpecApplyConfiguration) *PersistentVolumeClaimTemplateApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go new file mode 100644 index 00000000000..582c22c2505 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumeclaimvolumesource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PersistentVolumeClaimVolumeSourceApplyConfiguration represents an declarative configuration of the PersistentVolumeClaimVolumeSource type for use +// with apply. +type PersistentVolumeClaimVolumeSourceApplyConfiguration struct { + ClaimName *string `json:"claimName,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// PersistentVolumeClaimVolumeSourceApplyConfiguration constructs an declarative configuration of the PersistentVolumeClaimVolumeSource type for use with +// apply. +func PersistentVolumeClaimVolumeSource() *PersistentVolumeClaimVolumeSourceApplyConfiguration { + return &PersistentVolumeClaimVolumeSourceApplyConfiguration{} +} + +// WithClaimName sets the ClaimName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClaimName field is set to the value of the last call. +func (b *PersistentVolumeClaimVolumeSourceApplyConfiguration) WithClaimName(value string) *PersistentVolumeClaimVolumeSourceApplyConfiguration { + b.ClaimName = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *PersistentVolumeClaimVolumeSourceApplyConfiguration) WithReadOnly(value bool) *PersistentVolumeClaimVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumesource.go new file mode 100644 index 00000000000..f71f9318e02 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumesource.go @@ -0,0 +1,217 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PersistentVolumeSourceApplyConfiguration represents an declarative configuration of the PersistentVolumeSource type for use +// with apply. +type PersistentVolumeSourceApplyConfiguration struct { + GCEPersistentDisk *GCEPersistentDiskVolumeSourceApplyConfiguration `json:"gcePersistentDisk,omitempty"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSourceApplyConfiguration `json:"awsElasticBlockStore,omitempty"` + HostPath *HostPathVolumeSourceApplyConfiguration `json:"hostPath,omitempty"` + Glusterfs *GlusterfsPersistentVolumeSourceApplyConfiguration `json:"glusterfs,omitempty"` + NFS *NFSVolumeSourceApplyConfiguration `json:"nfs,omitempty"` + RBD *RBDPersistentVolumeSourceApplyConfiguration `json:"rbd,omitempty"` + ISCSI *ISCSIPersistentVolumeSourceApplyConfiguration `json:"iscsi,omitempty"` + Cinder *CinderPersistentVolumeSourceApplyConfiguration `json:"cinder,omitempty"` + CephFS *CephFSPersistentVolumeSourceApplyConfiguration `json:"cephfs,omitempty"` + FC *FCVolumeSourceApplyConfiguration `json:"fc,omitempty"` + Flocker *FlockerVolumeSourceApplyConfiguration `json:"flocker,omitempty"` + FlexVolume *FlexPersistentVolumeSourceApplyConfiguration `json:"flexVolume,omitempty"` + AzureFile *AzureFilePersistentVolumeSourceApplyConfiguration `json:"azureFile,omitempty"` + VsphereVolume *VsphereVirtualDiskVolumeSourceApplyConfiguration `json:"vsphereVolume,omitempty"` + Quobyte *QuobyteVolumeSourceApplyConfiguration `json:"quobyte,omitempty"` + AzureDisk *AzureDiskVolumeSourceApplyConfiguration `json:"azureDisk,omitempty"` + PhotonPersistentDisk *PhotonPersistentDiskVolumeSourceApplyConfiguration `json:"photonPersistentDisk,omitempty"` + PortworxVolume *PortworxVolumeSourceApplyConfiguration `json:"portworxVolume,omitempty"` + ScaleIO *ScaleIOPersistentVolumeSourceApplyConfiguration `json:"scaleIO,omitempty"` + Local *LocalVolumeSourceApplyConfiguration `json:"local,omitempty"` + StorageOS *StorageOSPersistentVolumeSourceApplyConfiguration `json:"storageos,omitempty"` + CSI *CSIPersistentVolumeSourceApplyConfiguration `json:"csi,omitempty"` +} + +// PersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the PersistentVolumeSource type for use with +// apply. +func PersistentVolumeSource() *PersistentVolumeSourceApplyConfiguration { + return &PersistentVolumeSourceApplyConfiguration{} +} + +// WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GCEPersistentDisk field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.GCEPersistentDisk = value + return b +} + +// WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.AWSElasticBlockStore = value + return b +} + +// WithHostPath sets the HostPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPath field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.HostPath = value + return b +} + +// WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Glusterfs field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithGlusterfs(value *GlusterfsPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.Glusterfs = value + return b +} + +// WithNFS sets the NFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NFS field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.NFS = value + return b +} + +// WithRBD sets the RBD field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBD field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithRBD(value *RBDPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.RBD = value + return b +} + +// WithISCSI sets the ISCSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ISCSI field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithISCSI(value *ISCSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.ISCSI = value + return b +} + +// WithCinder sets the Cinder field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cinder field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithCinder(value *CinderPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.Cinder = value + return b +} + +// WithCephFS sets the CephFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CephFS field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithCephFS(value *CephFSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.CephFS = value + return b +} + +// WithFC sets the FC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FC field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.FC = value + return b +} + +// WithFlocker sets the Flocker field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Flocker field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.Flocker = value + return b +} + +// WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FlexVolume field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithFlexVolume(value *FlexPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.FlexVolume = value + return b +} + +// WithAzureFile sets the AzureFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureFile field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithAzureFile(value *AzureFilePersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.AzureFile = value + return b +} + +// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VsphereVolume field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.VsphereVolume = value + return b +} + +// WithQuobyte sets the Quobyte field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Quobyte field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.Quobyte = value + return b +} + +// WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureDisk field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.AzureDisk = value + return b +} + +// WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.PhotonPersistentDisk = value + return b +} + +// WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortworxVolume field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.PortworxVolume = value + return b +} + +// WithScaleIO sets the ScaleIO field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScaleIO field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithScaleIO(value *ScaleIOPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.ScaleIO = value + return b +} + +// WithLocal sets the Local field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Local field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithLocal(value *LocalVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.Local = value + return b +} + +// WithStorageOS sets the StorageOS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageOS field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithStorageOS(value *StorageOSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.StorageOS = value + return b +} + +// WithCSI sets the CSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CSI field is set to the value of the last call. +func (b *PersistentVolumeSourceApplyConfiguration) WithCSI(value *CSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSourceApplyConfiguration { + b.CSI = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumespec.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumespec.go new file mode 100644 index 00000000000..970090adcd0 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumespec.go @@ -0,0 +1,285 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PersistentVolumeSpecApplyConfiguration represents an declarative configuration of the PersistentVolumeSpec type for use +// with apply. +type PersistentVolumeSpecApplyConfiguration struct { + Capacity *v1.ResourceList `json:"capacity,omitempty"` + PersistentVolumeSourceApplyConfiguration `json:",inline"` + AccessModes []v1.PersistentVolumeAccessMode `json:"accessModes,omitempty"` + ClaimRef *ObjectReferenceApplyConfiguration `json:"claimRef,omitempty"` + PersistentVolumeReclaimPolicy *v1.PersistentVolumeReclaimPolicy `json:"persistentVolumeReclaimPolicy,omitempty"` + StorageClassName *string `json:"storageClassName,omitempty"` + MountOptions []string `json:"mountOptions,omitempty"` + VolumeMode *v1.PersistentVolumeMode `json:"volumeMode,omitempty"` + NodeAffinity *VolumeNodeAffinityApplyConfiguration `json:"nodeAffinity,omitempty"` + VolumeAttributesClassName *string `json:"volumeAttributesClassName,omitempty"` +} + +// PersistentVolumeSpecApplyConfiguration constructs an declarative configuration of the PersistentVolumeSpec type for use with +// apply. +func PersistentVolumeSpec() *PersistentVolumeSpecApplyConfiguration { + return &PersistentVolumeSpecApplyConfiguration{} +} + +// WithCapacity sets the Capacity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capacity field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithCapacity(value v1.ResourceList) *PersistentVolumeSpecApplyConfiguration { + b.Capacity = &value + return b +} + +// WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GCEPersistentDisk field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.GCEPersistentDisk = value + return b +} + +// WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.AWSElasticBlockStore = value + return b +} + +// WithHostPath sets the HostPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPath field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.HostPath = value + return b +} + +// WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Glusterfs field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithGlusterfs(value *GlusterfsPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.Glusterfs = value + return b +} + +// WithNFS sets the NFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NFS field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.NFS = value + return b +} + +// WithRBD sets the RBD field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBD field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithRBD(value *RBDPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.RBD = value + return b +} + +// WithISCSI sets the ISCSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ISCSI field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithISCSI(value *ISCSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.ISCSI = value + return b +} + +// WithCinder sets the Cinder field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cinder field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithCinder(value *CinderPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.Cinder = value + return b +} + +// WithCephFS sets the CephFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CephFS field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithCephFS(value *CephFSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.CephFS = value + return b +} + +// WithFC sets the FC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FC field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.FC = value + return b +} + +// WithFlocker sets the Flocker field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Flocker field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.Flocker = value + return b +} + +// WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FlexVolume field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithFlexVolume(value *FlexPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.FlexVolume = value + return b +} + +// WithAzureFile sets the AzureFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureFile field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithAzureFile(value *AzureFilePersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.AzureFile = value + return b +} + +// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VsphereVolume field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.VsphereVolume = value + return b +} + +// WithQuobyte sets the Quobyte field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Quobyte field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.Quobyte = value + return b +} + +// WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureDisk field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.AzureDisk = value + return b +} + +// WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.PhotonPersistentDisk = value + return b +} + +// WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortworxVolume field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.PortworxVolume = value + return b +} + +// WithScaleIO sets the ScaleIO field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScaleIO field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithScaleIO(value *ScaleIOPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.ScaleIO = value + return b +} + +// WithLocal sets the Local field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Local field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithLocal(value *LocalVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.Local = value + return b +} + +// WithStorageOS sets the StorageOS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageOS field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithStorageOS(value *StorageOSPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.StorageOS = value + return b +} + +// WithCSI sets the CSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CSI field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithCSI(value *CSIPersistentVolumeSourceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.CSI = value + return b +} + +// WithAccessModes adds the given value to the AccessModes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the AccessModes field. +func (b *PersistentVolumeSpecApplyConfiguration) WithAccessModes(values ...v1.PersistentVolumeAccessMode) *PersistentVolumeSpecApplyConfiguration { + for i := range values { + b.AccessModes = append(b.AccessModes, values[i]) + } + return b +} + +// WithClaimRef sets the ClaimRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClaimRef field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithClaimRef(value *ObjectReferenceApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.ClaimRef = value + return b +} + +// WithPersistentVolumeReclaimPolicy sets the PersistentVolumeReclaimPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PersistentVolumeReclaimPolicy field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithPersistentVolumeReclaimPolicy(value v1.PersistentVolumeReclaimPolicy) *PersistentVolumeSpecApplyConfiguration { + b.PersistentVolumeReclaimPolicy = &value + return b +} + +// WithStorageClassName sets the StorageClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageClassName field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithStorageClassName(value string) *PersistentVolumeSpecApplyConfiguration { + b.StorageClassName = &value + return b +} + +// WithMountOptions adds the given value to the MountOptions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MountOptions field. +func (b *PersistentVolumeSpecApplyConfiguration) WithMountOptions(values ...string) *PersistentVolumeSpecApplyConfiguration { + for i := range values { + b.MountOptions = append(b.MountOptions, values[i]) + } + return b +} + +// WithVolumeMode sets the VolumeMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeMode field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeMode(value v1.PersistentVolumeMode) *PersistentVolumeSpecApplyConfiguration { + b.VolumeMode = &value + return b +} + +// WithNodeAffinity sets the NodeAffinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeAffinity field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithNodeAffinity(value *VolumeNodeAffinityApplyConfiguration) *PersistentVolumeSpecApplyConfiguration { + b.NodeAffinity = value + return b +} + +// WithVolumeAttributesClassName sets the VolumeAttributesClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeAttributesClassName field is set to the value of the last call. +func (b *PersistentVolumeSpecApplyConfiguration) WithVolumeAttributesClassName(value string) *PersistentVolumeSpecApplyConfiguration { + b.VolumeAttributesClassName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/persistentvolumestatus.go b/pkg/generated/applyconfigurations/core/v1/persistentvolumestatus.go new file mode 100644 index 00000000000..acebc605b58 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/persistentvolumestatus.go @@ -0,0 +1,60 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PersistentVolumeStatusApplyConfiguration represents an declarative configuration of the PersistentVolumeStatus type for use +// with apply. +type PersistentVolumeStatusApplyConfiguration struct { + Phase *v1.PersistentVolumePhase `json:"phase,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + LastPhaseTransitionTime *metav1.Time `json:"lastPhaseTransitionTime,omitempty"` +} + +// PersistentVolumeStatusApplyConfiguration constructs an declarative configuration of the PersistentVolumeStatus type for use with +// apply. +func PersistentVolumeStatus() *PersistentVolumeStatusApplyConfiguration { + return &PersistentVolumeStatusApplyConfiguration{} +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *PersistentVolumeStatusApplyConfiguration) WithPhase(value v1.PersistentVolumePhase) *PersistentVolumeStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PersistentVolumeStatusApplyConfiguration) WithMessage(value string) *PersistentVolumeStatusApplyConfiguration { + b.Message = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *PersistentVolumeStatusApplyConfiguration) WithReason(value string) *PersistentVolumeStatusApplyConfiguration { + b.Reason = &value + return b +} + +// WithLastPhaseTransitionTime sets the LastPhaseTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastPhaseTransitionTime field is set to the value of the last call. +func (b *PersistentVolumeStatusApplyConfiguration) WithLastPhaseTransitionTime(value metav1.Time) *PersistentVolumeStatusApplyConfiguration { + b.LastPhaseTransitionTime = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go b/pkg/generated/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go new file mode 100644 index 00000000000..e1b0997db73 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/photonpersistentdiskvolumesource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PhotonPersistentDiskVolumeSourceApplyConfiguration represents an declarative configuration of the PhotonPersistentDiskVolumeSource type for use +// with apply. +type PhotonPersistentDiskVolumeSourceApplyConfiguration struct { + PdID *string `json:"pdID,omitempty"` + FSType *string `json:"fsType,omitempty"` +} + +// PhotonPersistentDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the PhotonPersistentDiskVolumeSource type for use with +// apply. +func PhotonPersistentDiskVolumeSource() *PhotonPersistentDiskVolumeSourceApplyConfiguration { + return &PhotonPersistentDiskVolumeSourceApplyConfiguration{} +} + +// WithPdID sets the PdID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PdID field is set to the value of the last call. +func (b *PhotonPersistentDiskVolumeSourceApplyConfiguration) WithPdID(value string) *PhotonPersistentDiskVolumeSourceApplyConfiguration { + b.PdID = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *PhotonPersistentDiskVolumeSourceApplyConfiguration) WithFSType(value string) *PhotonPersistentDiskVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/pod.go b/pkg/generated/applyconfigurations/core/v1/pod.go new file mode 100644 index 00000000000..2c32c35bad1 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/pod.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// PodApplyConfiguration represents an declarative configuration of the Pod type for use +// with apply. +type PodApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PodSpecApplyConfiguration `json:"spec,omitempty"` + Status *PodStatusApplyConfiguration `json:"status,omitempty"` +} + +// Pod constructs an declarative configuration of the Pod type for use with +// apply. +func Pod(name, namespace string) *PodApplyConfiguration { + b := &PodApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Pod") + b.WithAPIVersion("v1") + return b +} + +// ExtractPod extracts the applied configuration owned by fieldManager from +// pod. If no managedFields are found in pod for fieldManager, a +// PodApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// pod must be a unmodified Pod API object that was retrieved from the Kubernetes API. +// ExtractPod provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPod(pod *apicorev1.Pod, fieldManager string) (*PodApplyConfiguration, error) { + return extractPod(pod, fieldManager, "") +} + +// ExtractPodStatus is the same as ExtractPod except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodStatus(pod *apicorev1.Pod, fieldManager string) (*PodApplyConfiguration, error) { + return extractPod(pod, fieldManager, "status") +} + +func extractPod(pod *apicorev1.Pod, fieldManager string, subresource string) (*PodApplyConfiguration, error) { + b := &PodApplyConfiguration{} + err := managedfields.ExtractInto(pod, internal.Parser().Type("io.k8s.api.core.v1.Pod"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(pod.Name) + b.WithNamespace(pod.Namespace) + + b.WithKind("Pod") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PodApplyConfiguration) WithKind(value string) *PodApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PodApplyConfiguration) WithAPIVersion(value string) *PodApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodApplyConfiguration) WithName(value string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodApplyConfiguration) WithGenerateName(value string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodApplyConfiguration) WithNamespace(value string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodApplyConfiguration) WithUID(value types.UID) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodApplyConfiguration) WithResourceVersion(value string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodApplyConfiguration) WithGeneration(value int64) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodApplyConfiguration) WithLabels(entries map[string]string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodApplyConfiguration) WithAnnotations(entries map[string]string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodApplyConfiguration) WithFinalizers(values ...string) *PodApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PodApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodApplyConfiguration) WithSpec(value *PodSpecApplyConfiguration) *PodApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PodApplyConfiguration) WithStatus(value *PodStatusApplyConfiguration) *PodApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podaffinity.go b/pkg/generated/applyconfigurations/core/v1/podaffinity.go new file mode 100644 index 00000000000..455b6c36235 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podaffinity.go @@ -0,0 +1,47 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodAffinityApplyConfiguration represents an declarative configuration of the PodAffinity type for use +// with apply. +type PodAffinityApplyConfiguration struct { + RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` + PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +// PodAffinityApplyConfiguration constructs an declarative configuration of the PodAffinity type for use with +// apply. +func PodAffinity() *PodAffinityApplyConfiguration { + return &PodAffinityApplyConfiguration{} +} + +// WithRequiredDuringSchedulingIgnoredDuringExecution adds the given value to the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RequiredDuringSchedulingIgnoredDuringExecution field. +func (b *PodAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(values ...*PodAffinityTermApplyConfiguration) *PodAffinityApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequiredDuringSchedulingIgnoredDuringExecution") + } + b.RequiredDuringSchedulingIgnoredDuringExecution = append(b.RequiredDuringSchedulingIgnoredDuringExecution, *values[i]) + } + return b +} + +// WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field. +func (b *PodAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...*WeightedPodAffinityTermApplyConfiguration) *PodAffinityApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPreferredDuringSchedulingIgnoredDuringExecution") + } + b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podaffinityterm.go b/pkg/generated/applyconfigurations/core/v1/podaffinityterm.go new file mode 100644 index 00000000000..69279ba8ebe --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podaffinityterm.go @@ -0,0 +1,83 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" +) + +// PodAffinityTermApplyConfiguration represents an declarative configuration of the PodAffinityTerm type for use +// with apply. +type PodAffinityTermApplyConfiguration struct { + LabelSelector *v1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` + TopologyKey *string `json:"topologyKey,omitempty"` + NamespaceSelector *v1.LabelSelectorApplyConfiguration `json:"namespaceSelector,omitempty"` + MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` + MismatchLabelKeys []string `json:"mismatchLabelKeys,omitempty"` +} + +// PodAffinityTermApplyConfiguration constructs an declarative configuration of the PodAffinityTerm type for use with +// apply. +func PodAffinityTerm() *PodAffinityTermApplyConfiguration { + return &PodAffinityTermApplyConfiguration{} +} + +// WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelSelector field is set to the value of the last call. +func (b *PodAffinityTermApplyConfiguration) WithLabelSelector(value *v1.LabelSelectorApplyConfiguration) *PodAffinityTermApplyConfiguration { + b.LabelSelector = value + return b +} + +// WithNamespaces adds the given value to the Namespaces field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Namespaces field. +func (b *PodAffinityTermApplyConfiguration) WithNamespaces(values ...string) *PodAffinityTermApplyConfiguration { + for i := range values { + b.Namespaces = append(b.Namespaces, values[i]) + } + return b +} + +// WithTopologyKey sets the TopologyKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TopologyKey field is set to the value of the last call. +func (b *PodAffinityTermApplyConfiguration) WithTopologyKey(value string) *PodAffinityTermApplyConfiguration { + b.TopologyKey = &value + return b +} + +// WithNamespaceSelector sets the NamespaceSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NamespaceSelector field is set to the value of the last call. +func (b *PodAffinityTermApplyConfiguration) WithNamespaceSelector(value *v1.LabelSelectorApplyConfiguration) *PodAffinityTermApplyConfiguration { + b.NamespaceSelector = value + return b +} + +// WithMatchLabelKeys adds the given value to the MatchLabelKeys field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchLabelKeys field. +func (b *PodAffinityTermApplyConfiguration) WithMatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { + for i := range values { + b.MatchLabelKeys = append(b.MatchLabelKeys, values[i]) + } + return b +} + +// WithMismatchLabelKeys adds the given value to the MismatchLabelKeys field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MismatchLabelKeys field. +func (b *PodAffinityTermApplyConfiguration) WithMismatchLabelKeys(values ...string) *PodAffinityTermApplyConfiguration { + for i := range values { + b.MismatchLabelKeys = append(b.MismatchLabelKeys, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podantiaffinity.go b/pkg/generated/applyconfigurations/core/v1/podantiaffinity.go new file mode 100644 index 00000000000..e40b007fa53 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podantiaffinity.go @@ -0,0 +1,47 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodAntiAffinityApplyConfiguration represents an declarative configuration of the PodAntiAffinity type for use +// with apply. +type PodAntiAffinityApplyConfiguration struct { + RequiredDuringSchedulingIgnoredDuringExecution []PodAffinityTermApplyConfiguration `json:"requiredDuringSchedulingIgnoredDuringExecution,omitempty"` + PreferredDuringSchedulingIgnoredDuringExecution []WeightedPodAffinityTermApplyConfiguration `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty"` +} + +// PodAntiAffinityApplyConfiguration constructs an declarative configuration of the PodAntiAffinity type for use with +// apply. +func PodAntiAffinity() *PodAntiAffinityApplyConfiguration { + return &PodAntiAffinityApplyConfiguration{} +} + +// WithRequiredDuringSchedulingIgnoredDuringExecution adds the given value to the RequiredDuringSchedulingIgnoredDuringExecution field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the RequiredDuringSchedulingIgnoredDuringExecution field. +func (b *PodAntiAffinityApplyConfiguration) WithRequiredDuringSchedulingIgnoredDuringExecution(values ...*PodAffinityTermApplyConfiguration) *PodAntiAffinityApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRequiredDuringSchedulingIgnoredDuringExecution") + } + b.RequiredDuringSchedulingIgnoredDuringExecution = append(b.RequiredDuringSchedulingIgnoredDuringExecution, *values[i]) + } + return b +} + +// WithPreferredDuringSchedulingIgnoredDuringExecution adds the given value to the PreferredDuringSchedulingIgnoredDuringExecution field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PreferredDuringSchedulingIgnoredDuringExecution field. +func (b *PodAntiAffinityApplyConfiguration) WithPreferredDuringSchedulingIgnoredDuringExecution(values ...*WeightedPodAffinityTermApplyConfiguration) *PodAntiAffinityApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPreferredDuringSchedulingIgnoredDuringExecution") + } + b.PreferredDuringSchedulingIgnoredDuringExecution = append(b.PreferredDuringSchedulingIgnoredDuringExecution, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podcondition.go b/pkg/generated/applyconfigurations/core/v1/podcondition.go new file mode 100644 index 00000000000..fe2a7972351 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podcondition.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PodConditionApplyConfiguration represents an declarative configuration of the PodCondition type for use +// with apply. +type PodConditionApplyConfiguration struct { + Type *v1.PodConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastProbeTime *metav1.Time `json:"lastProbeTime,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// PodConditionApplyConfiguration constructs an declarative configuration of the PodCondition type for use with +// apply. +func PodCondition() *PodConditionApplyConfiguration { + return &PodConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithType(value v1.PodConditionType) *PodConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PodConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastProbeTime sets the LastProbeTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastProbeTime field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithLastProbeTime(value metav1.Time) *PodConditionApplyConfiguration { + b.LastProbeTime = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PodConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithReason(value string) *PodConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PodConditionApplyConfiguration) WithMessage(value string) *PodConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/poddnsconfig.go b/pkg/generated/applyconfigurations/core/v1/poddnsconfig.go new file mode 100644 index 00000000000..58d22f8cc6b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/poddnsconfig.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodDNSConfigApplyConfiguration represents an declarative configuration of the PodDNSConfig type for use +// with apply. +type PodDNSConfigApplyConfiguration struct { + Nameservers []string `json:"nameservers,omitempty"` + Searches []string `json:"searches,omitempty"` + Options []PodDNSConfigOptionApplyConfiguration `json:"options,omitempty"` +} + +// PodDNSConfigApplyConfiguration constructs an declarative configuration of the PodDNSConfig type for use with +// apply. +func PodDNSConfig() *PodDNSConfigApplyConfiguration { + return &PodDNSConfigApplyConfiguration{} +} + +// WithNameservers adds the given value to the Nameservers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Nameservers field. +func (b *PodDNSConfigApplyConfiguration) WithNameservers(values ...string) *PodDNSConfigApplyConfiguration { + for i := range values { + b.Nameservers = append(b.Nameservers, values[i]) + } + return b +} + +// WithSearches adds the given value to the Searches field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Searches field. +func (b *PodDNSConfigApplyConfiguration) WithSearches(values ...string) *PodDNSConfigApplyConfiguration { + for i := range values { + b.Searches = append(b.Searches, values[i]) + } + return b +} + +// WithOptions adds the given value to the Options field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Options field. +func (b *PodDNSConfigApplyConfiguration) WithOptions(values ...*PodDNSConfigOptionApplyConfiguration) *PodDNSConfigApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOptions") + } + b.Options = append(b.Options, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/poddnsconfigoption.go b/pkg/generated/applyconfigurations/core/v1/poddnsconfigoption.go new file mode 100644 index 00000000000..ec6d0f40bec --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/poddnsconfigoption.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodDNSConfigOptionApplyConfiguration represents an declarative configuration of the PodDNSConfigOption type for use +// with apply. +type PodDNSConfigOptionApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// PodDNSConfigOptionApplyConfiguration constructs an declarative configuration of the PodDNSConfigOption type for use with +// apply. +func PodDNSConfigOption() *PodDNSConfigOptionApplyConfiguration { + return &PodDNSConfigOptionApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodDNSConfigOptionApplyConfiguration) WithName(value string) *PodDNSConfigOptionApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *PodDNSConfigOptionApplyConfiguration) WithValue(value string) *PodDNSConfigOptionApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podip.go b/pkg/generated/applyconfigurations/core/v1/podip.go new file mode 100644 index 00000000000..1ec691ac486 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podip.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodIPApplyConfiguration represents an declarative configuration of the PodIP type for use +// with apply. +type PodIPApplyConfiguration struct { + IP *string `json:"ip,omitempty"` +} + +// PodIPApplyConfiguration constructs an declarative configuration of the PodIP type for use with +// apply. +func PodIP() *PodIPApplyConfiguration { + return &PodIPApplyConfiguration{} +} + +// WithIP sets the IP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IP field is set to the value of the last call. +func (b *PodIPApplyConfiguration) WithIP(value string) *PodIPApplyConfiguration { + b.IP = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podos.go b/pkg/generated/applyconfigurations/core/v1/podos.go new file mode 100644 index 00000000000..bbc100259b7 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podos.go @@ -0,0 +1,32 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PodOSApplyConfiguration represents an declarative configuration of the PodOS type for use +// with apply. +type PodOSApplyConfiguration struct { + Name *v1.OSName `json:"name,omitempty"` +} + +// PodOSApplyConfiguration constructs an declarative configuration of the PodOS type for use with +// apply. +func PodOS() *PodOSApplyConfiguration { + return &PodOSApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodOSApplyConfiguration) WithName(value v1.OSName) *PodOSApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podreadinessgate.go b/pkg/generated/applyconfigurations/core/v1/podreadinessgate.go new file mode 100644 index 00000000000..686548197f8 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podreadinessgate.go @@ -0,0 +1,32 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PodReadinessGateApplyConfiguration represents an declarative configuration of the PodReadinessGate type for use +// with apply. +type PodReadinessGateApplyConfiguration struct { + ConditionType *v1.PodConditionType `json:"conditionType,omitempty"` +} + +// PodReadinessGateApplyConfiguration constructs an declarative configuration of the PodReadinessGate type for use with +// apply. +func PodReadinessGate() *PodReadinessGateApplyConfiguration { + return &PodReadinessGateApplyConfiguration{} +} + +// WithConditionType sets the ConditionType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConditionType field is set to the value of the last call. +func (b *PodReadinessGateApplyConfiguration) WithConditionType(value v1.PodConditionType) *PodReadinessGateApplyConfiguration { + b.ConditionType = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podresourceclaim.go b/pkg/generated/applyconfigurations/core/v1/podresourceclaim.go new file mode 100644 index 00000000000..a266bf8578e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podresourceclaim.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodResourceClaimApplyConfiguration represents an declarative configuration of the PodResourceClaim type for use +// with apply. +type PodResourceClaimApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Source *ClaimSourceApplyConfiguration `json:"source,omitempty"` +} + +// PodResourceClaimApplyConfiguration constructs an declarative configuration of the PodResourceClaim type for use with +// apply. +func PodResourceClaim() *PodResourceClaimApplyConfiguration { + return &PodResourceClaimApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodResourceClaimApplyConfiguration) WithName(value string) *PodResourceClaimApplyConfiguration { + b.Name = &value + return b +} + +// WithSource sets the Source field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Source field is set to the value of the last call. +func (b *PodResourceClaimApplyConfiguration) WithSource(value *ClaimSourceApplyConfiguration) *PodResourceClaimApplyConfiguration { + b.Source = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podresourceclaimstatus.go b/pkg/generated/applyconfigurations/core/v1/podresourceclaimstatus.go new file mode 100644 index 00000000000..56a249c21e2 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podresourceclaimstatus.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodResourceClaimStatusApplyConfiguration represents an declarative configuration of the PodResourceClaimStatus type for use +// with apply. +type PodResourceClaimStatusApplyConfiguration struct { + Name *string `json:"name,omitempty"` + ResourceClaimName *string `json:"resourceClaimName,omitempty"` +} + +// PodResourceClaimStatusApplyConfiguration constructs an declarative configuration of the PodResourceClaimStatus type for use with +// apply. +func PodResourceClaimStatus() *PodResourceClaimStatusApplyConfiguration { + return &PodResourceClaimStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodResourceClaimStatusApplyConfiguration) WithName(value string) *PodResourceClaimStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithResourceClaimName sets the ResourceClaimName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceClaimName field is set to the value of the last call. +func (b *PodResourceClaimStatusApplyConfiguration) WithResourceClaimName(value string) *PodResourceClaimStatusApplyConfiguration { + b.ResourceClaimName = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podschedulinggate.go b/pkg/generated/applyconfigurations/core/v1/podschedulinggate.go new file mode 100644 index 00000000000..42c8961906d --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podschedulinggate.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PodSchedulingGateApplyConfiguration represents an declarative configuration of the PodSchedulingGate type for use +// with apply. +type PodSchedulingGateApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// PodSchedulingGateApplyConfiguration constructs an declarative configuration of the PodSchedulingGate type for use with +// apply. +func PodSchedulingGate() *PodSchedulingGateApplyConfiguration { + return &PodSchedulingGateApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodSchedulingGateApplyConfiguration) WithName(value string) *PodSchedulingGateApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podsecuritycontext.go b/pkg/generated/applyconfigurations/core/v1/podsecuritycontext.go new file mode 100644 index 00000000000..f800efe03d0 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podsecuritycontext.go @@ -0,0 +1,129 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// PodSecurityContextApplyConfiguration represents an declarative configuration of the PodSecurityContext type for use +// with apply. +type PodSecurityContextApplyConfiguration struct { + SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` + WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` + RunAsUser *int64 `json:"runAsUser,omitempty"` + RunAsGroup *int64 `json:"runAsGroup,omitempty"` + RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` + SupplementalGroups []int64 `json:"supplementalGroups,omitempty"` + FSGroup *int64 `json:"fsGroup,omitempty"` + Sysctls []SysctlApplyConfiguration `json:"sysctls,omitempty"` + FSGroupChangePolicy *corev1.PodFSGroupChangePolicy `json:"fsGroupChangePolicy,omitempty"` + SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` + AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` +} + +// PodSecurityContextApplyConfiguration constructs an declarative configuration of the PodSecurityContext type for use with +// apply. +func PodSecurityContext() *PodSecurityContextApplyConfiguration { + return &PodSecurityContextApplyConfiguration{} +} + +// WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SELinuxOptions field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { + b.SELinuxOptions = value + return b +} + +// WithWindowsOptions sets the WindowsOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WindowsOptions field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *PodSecurityContextApplyConfiguration { + b.WindowsOptions = value + return b +} + +// WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsUser field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithRunAsUser(value int64) *PodSecurityContextApplyConfiguration { + b.RunAsUser = &value + return b +} + +// WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsGroup field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithRunAsGroup(value int64) *PodSecurityContextApplyConfiguration { + b.RunAsGroup = &value + return b +} + +// WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsNonRoot field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *PodSecurityContextApplyConfiguration { + b.RunAsNonRoot = &value + return b +} + +// WithSupplementalGroups adds the given value to the SupplementalGroups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SupplementalGroups field. +func (b *PodSecurityContextApplyConfiguration) WithSupplementalGroups(values ...int64) *PodSecurityContextApplyConfiguration { + for i := range values { + b.SupplementalGroups = append(b.SupplementalGroups, values[i]) + } + return b +} + +// WithFSGroup sets the FSGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSGroup field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithFSGroup(value int64) *PodSecurityContextApplyConfiguration { + b.FSGroup = &value + return b +} + +// WithSysctls adds the given value to the Sysctls field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Sysctls field. +func (b *PodSecurityContextApplyConfiguration) WithSysctls(values ...*SysctlApplyConfiguration) *PodSecurityContextApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSysctls") + } + b.Sysctls = append(b.Sysctls, *values[i]) + } + return b +} + +// WithFSGroupChangePolicy sets the FSGroupChangePolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSGroupChangePolicy field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithFSGroupChangePolicy(value corev1.PodFSGroupChangePolicy) *PodSecurityContextApplyConfiguration { + b.FSGroupChangePolicy = &value + return b +} + +// WithSeccompProfile sets the SeccompProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SeccompProfile field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { + b.SeccompProfile = value + return b +} + +// WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AppArmorProfile field is set to the value of the last call. +func (b *PodSecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *PodSecurityContextApplyConfiguration { + b.AppArmorProfile = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podspec.go b/pkg/generated/applyconfigurations/core/v1/podspec.go new file mode 100644 index 00000000000..5f3f3fd3c6f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podspec.go @@ -0,0 +1,435 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// PodSpecApplyConfiguration represents an declarative configuration of the PodSpec type for use +// with apply. +type PodSpecApplyConfiguration struct { + Volumes []VolumeApplyConfiguration `json:"volumes,omitempty"` + InitContainers []ContainerApplyConfiguration `json:"initContainers,omitempty"` + Containers []ContainerApplyConfiguration `json:"containers,omitempty"` + EphemeralContainers []EphemeralContainerApplyConfiguration `json:"ephemeralContainers,omitempty"` + RestartPolicy *corev1.RestartPolicy `json:"restartPolicy,omitempty"` + TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` + ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"` + DNSPolicy *corev1.DNSPolicy `json:"dnsPolicy,omitempty"` + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + ServiceAccountName *string `json:"serviceAccountName,omitempty"` + DeprecatedServiceAccount *string `json:"serviceAccount,omitempty"` + AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` + NodeName *string `json:"nodeName,omitempty"` + HostNetwork *bool `json:"hostNetwork,omitempty"` + HostPID *bool `json:"hostPID,omitempty"` + HostIPC *bool `json:"hostIPC,omitempty"` + ShareProcessNamespace *bool `json:"shareProcessNamespace,omitempty"` + SecurityContext *PodSecurityContextApplyConfiguration `json:"securityContext,omitempty"` + ImagePullSecrets []LocalObjectReferenceApplyConfiguration `json:"imagePullSecrets,omitempty"` + Hostname *string `json:"hostname,omitempty"` + Subdomain *string `json:"subdomain,omitempty"` + Affinity *AffinityApplyConfiguration `json:"affinity,omitempty"` + SchedulerName *string `json:"schedulerName,omitempty"` + Tolerations []TolerationApplyConfiguration `json:"tolerations,omitempty"` + HostAliases []HostAliasApplyConfiguration `json:"hostAliases,omitempty"` + PriorityClassName *string `json:"priorityClassName,omitempty"` + Priority *int32 `json:"priority,omitempty"` + DNSConfig *PodDNSConfigApplyConfiguration `json:"dnsConfig,omitempty"` + ReadinessGates []PodReadinessGateApplyConfiguration `json:"readinessGates,omitempty"` + RuntimeClassName *string `json:"runtimeClassName,omitempty"` + EnableServiceLinks *bool `json:"enableServiceLinks,omitempty"` + PreemptionPolicy *corev1.PreemptionPolicy `json:"preemptionPolicy,omitempty"` + Overhead *corev1.ResourceList `json:"overhead,omitempty"` + TopologySpreadConstraints []TopologySpreadConstraintApplyConfiguration `json:"topologySpreadConstraints,omitempty"` + SetHostnameAsFQDN *bool `json:"setHostnameAsFQDN,omitempty"` + OS *PodOSApplyConfiguration `json:"os,omitempty"` + HostUsers *bool `json:"hostUsers,omitempty"` + SchedulingGates []PodSchedulingGateApplyConfiguration `json:"schedulingGates,omitempty"` + ResourceClaims []PodResourceClaimApplyConfiguration `json:"resourceClaims,omitempty"` +} + +// PodSpecApplyConfiguration constructs an declarative configuration of the PodSpec type for use with +// apply. +func PodSpec() *PodSpecApplyConfiguration { + return &PodSpecApplyConfiguration{} +} + +// WithVolumes adds the given value to the Volumes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Volumes field. +func (b *PodSpecApplyConfiguration) WithVolumes(values ...*VolumeApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithVolumes") + } + b.Volumes = append(b.Volumes, *values[i]) + } + return b +} + +// WithInitContainers adds the given value to the InitContainers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InitContainers field. +func (b *PodSpecApplyConfiguration) WithInitContainers(values ...*ContainerApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithInitContainers") + } + b.InitContainers = append(b.InitContainers, *values[i]) + } + return b +} + +// WithContainers adds the given value to the Containers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Containers field. +func (b *PodSpecApplyConfiguration) WithContainers(values ...*ContainerApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithContainers") + } + b.Containers = append(b.Containers, *values[i]) + } + return b +} + +// WithEphemeralContainers adds the given value to the EphemeralContainers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EphemeralContainers field. +func (b *PodSpecApplyConfiguration) WithEphemeralContainers(values ...*EphemeralContainerApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEphemeralContainers") + } + b.EphemeralContainers = append(b.EphemeralContainers, *values[i]) + } + return b +} + +// WithRestartPolicy sets the RestartPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RestartPolicy field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithRestartPolicy(value corev1.RestartPolicy) *PodSpecApplyConfiguration { + b.RestartPolicy = &value + return b +} + +// WithTerminationGracePeriodSeconds sets the TerminationGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationGracePeriodSeconds field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithTerminationGracePeriodSeconds(value int64) *PodSpecApplyConfiguration { + b.TerminationGracePeriodSeconds = &value + return b +} + +// WithActiveDeadlineSeconds sets the ActiveDeadlineSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ActiveDeadlineSeconds field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithActiveDeadlineSeconds(value int64) *PodSpecApplyConfiguration { + b.ActiveDeadlineSeconds = &value + return b +} + +// WithDNSPolicy sets the DNSPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DNSPolicy field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithDNSPolicy(value corev1.DNSPolicy) *PodSpecApplyConfiguration { + b.DNSPolicy = &value + return b +} + +// WithNodeSelector puts the entries into the NodeSelector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the NodeSelector field, +// overwriting an existing map entries in NodeSelector field with the same key. +func (b *PodSpecApplyConfiguration) WithNodeSelector(entries map[string]string) *PodSpecApplyConfiguration { + if b.NodeSelector == nil && len(entries) > 0 { + b.NodeSelector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.NodeSelector[k] = v + } + return b +} + +// WithServiceAccountName sets the ServiceAccountName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountName field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithServiceAccountName(value string) *PodSpecApplyConfiguration { + b.ServiceAccountName = &value + return b +} + +// WithDeprecatedServiceAccount sets the DeprecatedServiceAccount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeprecatedServiceAccount field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithDeprecatedServiceAccount(value string) *PodSpecApplyConfiguration { + b.DeprecatedServiceAccount = &value + return b +} + +// WithAutomountServiceAccountToken sets the AutomountServiceAccountToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AutomountServiceAccountToken field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithAutomountServiceAccountToken(value bool) *PodSpecApplyConfiguration { + b.AutomountServiceAccountToken = &value + return b +} + +// WithNodeName sets the NodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeName field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithNodeName(value string) *PodSpecApplyConfiguration { + b.NodeName = &value + return b +} + +// WithHostNetwork sets the HostNetwork field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostNetwork field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithHostNetwork(value bool) *PodSpecApplyConfiguration { + b.HostNetwork = &value + return b +} + +// WithHostPID sets the HostPID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPID field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithHostPID(value bool) *PodSpecApplyConfiguration { + b.HostPID = &value + return b +} + +// WithHostIPC sets the HostIPC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostIPC field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithHostIPC(value bool) *PodSpecApplyConfiguration { + b.HostIPC = &value + return b +} + +// WithShareProcessNamespace sets the ShareProcessNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ShareProcessNamespace field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithShareProcessNamespace(value bool) *PodSpecApplyConfiguration { + b.ShareProcessNamespace = &value + return b +} + +// WithSecurityContext sets the SecurityContext field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecurityContext field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithSecurityContext(value *PodSecurityContextApplyConfiguration) *PodSpecApplyConfiguration { + b.SecurityContext = value + return b +} + +// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. +func (b *PodSpecApplyConfiguration) WithImagePullSecrets(values ...*LocalObjectReferenceApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithImagePullSecrets") + } + b.ImagePullSecrets = append(b.ImagePullSecrets, *values[i]) + } + return b +} + +// WithHostname sets the Hostname field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hostname field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithHostname(value string) *PodSpecApplyConfiguration { + b.Hostname = &value + return b +} + +// WithSubdomain sets the Subdomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subdomain field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithSubdomain(value string) *PodSpecApplyConfiguration { + b.Subdomain = &value + return b +} + +// WithAffinity sets the Affinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Affinity field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithAffinity(value *AffinityApplyConfiguration) *PodSpecApplyConfiguration { + b.Affinity = value + return b +} + +// WithSchedulerName sets the SchedulerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SchedulerName field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithSchedulerName(value string) *PodSpecApplyConfiguration { + b.SchedulerName = &value + return b +} + +// WithTolerations adds the given value to the Tolerations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Tolerations field. +func (b *PodSpecApplyConfiguration) WithTolerations(values ...*TolerationApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTolerations") + } + b.Tolerations = append(b.Tolerations, *values[i]) + } + return b +} + +// WithHostAliases adds the given value to the HostAliases field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HostAliases field. +func (b *PodSpecApplyConfiguration) WithHostAliases(values ...*HostAliasApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostAliases") + } + b.HostAliases = append(b.HostAliases, *values[i]) + } + return b +} + +// WithPriorityClassName sets the PriorityClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityClassName field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithPriorityClassName(value string) *PodSpecApplyConfiguration { + b.PriorityClassName = &value + return b +} + +// WithPriority sets the Priority field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Priority field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithPriority(value int32) *PodSpecApplyConfiguration { + b.Priority = &value + return b +} + +// WithDNSConfig sets the DNSConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DNSConfig field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithDNSConfig(value *PodDNSConfigApplyConfiguration) *PodSpecApplyConfiguration { + b.DNSConfig = value + return b +} + +// WithReadinessGates adds the given value to the ReadinessGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ReadinessGates field. +func (b *PodSpecApplyConfiguration) WithReadinessGates(values ...*PodReadinessGateApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithReadinessGates") + } + b.ReadinessGates = append(b.ReadinessGates, *values[i]) + } + return b +} + +// WithRuntimeClassName sets the RuntimeClassName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RuntimeClassName field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithRuntimeClassName(value string) *PodSpecApplyConfiguration { + b.RuntimeClassName = &value + return b +} + +// WithEnableServiceLinks sets the EnableServiceLinks field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EnableServiceLinks field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithEnableServiceLinks(value bool) *PodSpecApplyConfiguration { + b.EnableServiceLinks = &value + return b +} + +// WithPreemptionPolicy sets the PreemptionPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PreemptionPolicy field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithPreemptionPolicy(value corev1.PreemptionPolicy) *PodSpecApplyConfiguration { + b.PreemptionPolicy = &value + return b +} + +// WithOverhead sets the Overhead field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Overhead field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithOverhead(value corev1.ResourceList) *PodSpecApplyConfiguration { + b.Overhead = &value + return b +} + +// WithTopologySpreadConstraints adds the given value to the TopologySpreadConstraints field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the TopologySpreadConstraints field. +func (b *PodSpecApplyConfiguration) WithTopologySpreadConstraints(values ...*TopologySpreadConstraintApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithTopologySpreadConstraints") + } + b.TopologySpreadConstraints = append(b.TopologySpreadConstraints, *values[i]) + } + return b +} + +// WithSetHostnameAsFQDN sets the SetHostnameAsFQDN field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SetHostnameAsFQDN field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithSetHostnameAsFQDN(value bool) *PodSpecApplyConfiguration { + b.SetHostnameAsFQDN = &value + return b +} + +// WithOS sets the OS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OS field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithOS(value *PodOSApplyConfiguration) *PodSpecApplyConfiguration { + b.OS = value + return b +} + +// WithHostUsers sets the HostUsers field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostUsers field is set to the value of the last call. +func (b *PodSpecApplyConfiguration) WithHostUsers(value bool) *PodSpecApplyConfiguration { + b.HostUsers = &value + return b +} + +// WithSchedulingGates adds the given value to the SchedulingGates field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the SchedulingGates field. +func (b *PodSpecApplyConfiguration) WithSchedulingGates(values ...*PodSchedulingGateApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSchedulingGates") + } + b.SchedulingGates = append(b.SchedulingGates, *values[i]) + } + return b +} + +// WithResourceClaims adds the given value to the ResourceClaims field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceClaims field. +func (b *PodSpecApplyConfiguration) WithResourceClaims(values ...*PodResourceClaimApplyConfiguration) *PodSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceClaims") + } + b.ResourceClaims = append(b.ResourceClaims, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podstatus.go b/pkg/generated/applyconfigurations/core/v1/podstatus.go new file mode 100644 index 00000000000..3120c419370 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podstatus.go @@ -0,0 +1,203 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PodStatusApplyConfiguration represents an declarative configuration of the PodStatus type for use +// with apply. +type PodStatusApplyConfiguration struct { + Phase *v1.PodPhase `json:"phase,omitempty"` + Conditions []PodConditionApplyConfiguration `json:"conditions,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + NominatedNodeName *string `json:"nominatedNodeName,omitempty"` + HostIP *string `json:"hostIP,omitempty"` + HostIPs []HostIPApplyConfiguration `json:"hostIPs,omitempty"` + PodIP *string `json:"podIP,omitempty"` + PodIPs []PodIPApplyConfiguration `json:"podIPs,omitempty"` + StartTime *metav1.Time `json:"startTime,omitempty"` + InitContainerStatuses []ContainerStatusApplyConfiguration `json:"initContainerStatuses,omitempty"` + ContainerStatuses []ContainerStatusApplyConfiguration `json:"containerStatuses,omitempty"` + QOSClass *v1.PodQOSClass `json:"qosClass,omitempty"` + EphemeralContainerStatuses []ContainerStatusApplyConfiguration `json:"ephemeralContainerStatuses,omitempty"` + Resize *v1.PodResizeStatus `json:"resize,omitempty"` + ResourceClaimStatuses []PodResourceClaimStatusApplyConfiguration `json:"resourceClaimStatuses,omitempty"` +} + +// PodStatusApplyConfiguration constructs an declarative configuration of the PodStatus type for use with +// apply. +func PodStatus() *PodStatusApplyConfiguration { + return &PodStatusApplyConfiguration{} +} + +// WithPhase sets the Phase field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Phase field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithPhase(value v1.PodPhase) *PodStatusApplyConfiguration { + b.Phase = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PodStatusApplyConfiguration) WithConditions(values ...*PodConditionApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithMessage(value string) *PodStatusApplyConfiguration { + b.Message = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithReason(value string) *PodStatusApplyConfiguration { + b.Reason = &value + return b +} + +// WithNominatedNodeName sets the NominatedNodeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NominatedNodeName field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithNominatedNodeName(value string) *PodStatusApplyConfiguration { + b.NominatedNodeName = &value + return b +} + +// WithHostIP sets the HostIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostIP field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithHostIP(value string) *PodStatusApplyConfiguration { + b.HostIP = &value + return b +} + +// WithHostIPs adds the given value to the HostIPs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the HostIPs field. +func (b *PodStatusApplyConfiguration) WithHostIPs(values ...*HostIPApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithHostIPs") + } + b.HostIPs = append(b.HostIPs, *values[i]) + } + return b +} + +// WithPodIP sets the PodIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodIP field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithPodIP(value string) *PodStatusApplyConfiguration { + b.PodIP = &value + return b +} + +// WithPodIPs adds the given value to the PodIPs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the PodIPs field. +func (b *PodStatusApplyConfiguration) WithPodIPs(values ...*PodIPApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPodIPs") + } + b.PodIPs = append(b.PodIPs, *values[i]) + } + return b +} + +// WithStartTime sets the StartTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StartTime field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithStartTime(value metav1.Time) *PodStatusApplyConfiguration { + b.StartTime = &value + return b +} + +// WithInitContainerStatuses adds the given value to the InitContainerStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the InitContainerStatuses field. +func (b *PodStatusApplyConfiguration) WithInitContainerStatuses(values ...*ContainerStatusApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithInitContainerStatuses") + } + b.InitContainerStatuses = append(b.InitContainerStatuses, *values[i]) + } + return b +} + +// WithContainerStatuses adds the given value to the ContainerStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ContainerStatuses field. +func (b *PodStatusApplyConfiguration) WithContainerStatuses(values ...*ContainerStatusApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithContainerStatuses") + } + b.ContainerStatuses = append(b.ContainerStatuses, *values[i]) + } + return b +} + +// WithQOSClass sets the QOSClass field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the QOSClass field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithQOSClass(value v1.PodQOSClass) *PodStatusApplyConfiguration { + b.QOSClass = &value + return b +} + +// WithEphemeralContainerStatuses adds the given value to the EphemeralContainerStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the EphemeralContainerStatuses field. +func (b *PodStatusApplyConfiguration) WithEphemeralContainerStatuses(values ...*ContainerStatusApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithEphemeralContainerStatuses") + } + b.EphemeralContainerStatuses = append(b.EphemeralContainerStatuses, *values[i]) + } + return b +} + +// WithResize sets the Resize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resize field is set to the value of the last call. +func (b *PodStatusApplyConfiguration) WithResize(value v1.PodResizeStatus) *PodStatusApplyConfiguration { + b.Resize = &value + return b +} + +// WithResourceClaimStatuses adds the given value to the ResourceClaimStatuses field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceClaimStatuses field. +func (b *PodStatusApplyConfiguration) WithResourceClaimStatuses(values ...*PodResourceClaimStatusApplyConfiguration) *PodStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceClaimStatuses") + } + b.ResourceClaimStatuses = append(b.ResourceClaimStatuses, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podtemplate.go b/pkg/generated/applyconfigurations/core/v1/podtemplate.go new file mode 100644 index 00000000000..1bd3603a36b --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podtemplate.go @@ -0,0 +1,238 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// PodTemplateApplyConfiguration represents an declarative configuration of the PodTemplate type for use +// with apply. +type PodTemplateApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` +} + +// PodTemplate constructs an declarative configuration of the PodTemplate type for use with +// apply. +func PodTemplate(name, namespace string) *PodTemplateApplyConfiguration { + b := &PodTemplateApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("PodTemplate") + b.WithAPIVersion("v1") + return b +} + +// ExtractPodTemplate extracts the applied configuration owned by fieldManager from +// podTemplate. If no managedFields are found in podTemplate for fieldManager, a +// PodTemplateApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// podTemplate must be a unmodified PodTemplate API object that was retrieved from the Kubernetes API. +// ExtractPodTemplate provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPodTemplate(podTemplate *apicorev1.PodTemplate, fieldManager string) (*PodTemplateApplyConfiguration, error) { + return extractPodTemplate(podTemplate, fieldManager, "") +} + +// ExtractPodTemplateStatus is the same as ExtractPodTemplate except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPodTemplateStatus(podTemplate *apicorev1.PodTemplate, fieldManager string) (*PodTemplateApplyConfiguration, error) { + return extractPodTemplate(podTemplate, fieldManager, "status") +} + +func extractPodTemplate(podTemplate *apicorev1.PodTemplate, fieldManager string, subresource string) (*PodTemplateApplyConfiguration, error) { + b := &PodTemplateApplyConfiguration{} + err := managedfields.ExtractInto(podTemplate, internal.Parser().Type("io.k8s.api.core.v1.PodTemplate"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(podTemplate.Name) + b.WithNamespace(podTemplate.Namespace) + + b.WithKind("PodTemplate") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithKind(value string) *PodTemplateApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithAPIVersion(value string) *PodTemplateApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithName(value string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithGenerateName(value string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithNamespace(value string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithUID(value types.UID) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithResourceVersion(value string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithGeneration(value int64) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodTemplateApplyConfiguration) WithLabels(entries map[string]string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodTemplateApplyConfiguration) WithAnnotations(entries map[string]string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodTemplateApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodTemplateApplyConfiguration) WithFinalizers(values ...string) *PodTemplateApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PodTemplateApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *PodTemplateApplyConfiguration) WithTemplate(value *PodTemplateSpecApplyConfiguration) *PodTemplateApplyConfiguration { + b.Template = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/podtemplatespec.go b/pkg/generated/applyconfigurations/core/v1/podtemplatespec.go new file mode 100644 index 00000000000..2cd1d052a06 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/podtemplatespec.go @@ -0,0 +1,177 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// PodTemplateSpecApplyConfiguration represents an declarative configuration of the PodTemplateSpec type for use +// with apply. +type PodTemplateSpecApplyConfiguration struct { + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PodSpecApplyConfiguration `json:"spec,omitempty"` +} + +// PodTemplateSpecApplyConfiguration constructs an declarative configuration of the PodTemplateSpec type for use with +// apply. +func PodTemplateSpec() *PodTemplateSpecApplyConfiguration { + return &PodTemplateSpecApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithName(value string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithGenerateName(value string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithNamespace(value string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithUID(value types.UID) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithResourceVersion(value string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithGeneration(value int64) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PodTemplateSpecApplyConfiguration) WithLabels(entries map[string]string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PodTemplateSpecApplyConfiguration) WithAnnotations(entries map[string]string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PodTemplateSpecApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PodTemplateSpecApplyConfiguration) WithFinalizers(values ...string) *PodTemplateSpecApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PodTemplateSpecApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PodTemplateSpecApplyConfiguration) WithSpec(value *PodSpecApplyConfiguration) *PodTemplateSpecApplyConfiguration { + b.Spec = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/portstatus.go b/pkg/generated/applyconfigurations/core/v1/portstatus.go new file mode 100644 index 00000000000..70304391f5f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/portstatus.go @@ -0,0 +1,50 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// PortStatusApplyConfiguration represents an declarative configuration of the PortStatus type for use +// with apply. +type PortStatusApplyConfiguration struct { + Port *int32 `json:"port,omitempty"` + Protocol *v1.Protocol `json:"protocol,omitempty"` + Error *string `json:"error,omitempty"` +} + +// PortStatusApplyConfiguration constructs an declarative configuration of the PortStatus type for use with +// apply. +func PortStatus() *PortStatusApplyConfiguration { + return &PortStatusApplyConfiguration{} +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *PortStatusApplyConfiguration) WithPort(value int32) *PortStatusApplyConfiguration { + b.Port = &value + return b +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *PortStatusApplyConfiguration) WithProtocol(value v1.Protocol) *PortStatusApplyConfiguration { + b.Protocol = &value + return b +} + +// WithError sets the Error field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Error field is set to the value of the last call. +func (b *PortStatusApplyConfiguration) WithError(value string) *PortStatusApplyConfiguration { + b.Error = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/portworxvolumesource.go b/pkg/generated/applyconfigurations/core/v1/portworxvolumesource.go new file mode 100644 index 00000000000..e1df4b3b747 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/portworxvolumesource.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PortworxVolumeSourceApplyConfiguration represents an declarative configuration of the PortworxVolumeSource type for use +// with apply. +type PortworxVolumeSourceApplyConfiguration struct { + VolumeID *string `json:"volumeID,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// PortworxVolumeSourceApplyConfiguration constructs an declarative configuration of the PortworxVolumeSource type for use with +// apply. +func PortworxVolumeSource() *PortworxVolumeSourceApplyConfiguration { + return &PortworxVolumeSourceApplyConfiguration{} +} + +// WithVolumeID sets the VolumeID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeID field is set to the value of the last call. +func (b *PortworxVolumeSourceApplyConfiguration) WithVolumeID(value string) *PortworxVolumeSourceApplyConfiguration { + b.VolumeID = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *PortworxVolumeSourceApplyConfiguration) WithFSType(value string) *PortworxVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *PortworxVolumeSourceApplyConfiguration) WithReadOnly(value bool) *PortworxVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/preferredschedulingterm.go b/pkg/generated/applyconfigurations/core/v1/preferredschedulingterm.go new file mode 100644 index 00000000000..8dbf99fb0e4 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/preferredschedulingterm.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PreferredSchedulingTermApplyConfiguration represents an declarative configuration of the PreferredSchedulingTerm type for use +// with apply. +type PreferredSchedulingTermApplyConfiguration struct { + Weight *int32 `json:"weight,omitempty"` + Preference *NodeSelectorTermApplyConfiguration `json:"preference,omitempty"` +} + +// PreferredSchedulingTermApplyConfiguration constructs an declarative configuration of the PreferredSchedulingTerm type for use with +// apply. +func PreferredSchedulingTerm() *PreferredSchedulingTermApplyConfiguration { + return &PreferredSchedulingTermApplyConfiguration{} +} + +// WithWeight sets the Weight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Weight field is set to the value of the last call. +func (b *PreferredSchedulingTermApplyConfiguration) WithWeight(value int32) *PreferredSchedulingTermApplyConfiguration { + b.Weight = &value + return b +} + +// WithPreference sets the Preference field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Preference field is set to the value of the last call. +func (b *PreferredSchedulingTermApplyConfiguration) WithPreference(value *NodeSelectorTermApplyConfiguration) *PreferredSchedulingTermApplyConfiguration { + b.Preference = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/probe.go b/pkg/generated/applyconfigurations/core/v1/probe.go new file mode 100644 index 00000000000..eed7785ca57 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/probe.go @@ -0,0 +1,106 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ProbeApplyConfiguration represents an declarative configuration of the Probe type for use +// with apply. +type ProbeApplyConfiguration struct { + ProbeHandlerApplyConfiguration `json:",inline"` + InitialDelaySeconds *int32 `json:"initialDelaySeconds,omitempty"` + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` + PeriodSeconds *int32 `json:"periodSeconds,omitempty"` + SuccessThreshold *int32 `json:"successThreshold,omitempty"` + FailureThreshold *int32 `json:"failureThreshold,omitempty"` + TerminationGracePeriodSeconds *int64 `json:"terminationGracePeriodSeconds,omitempty"` +} + +// ProbeApplyConfiguration constructs an declarative configuration of the Probe type for use with +// apply. +func Probe() *ProbeApplyConfiguration { + return &ProbeApplyConfiguration{} +} + +// WithExec sets the Exec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Exec field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *ProbeApplyConfiguration { + b.Exec = value + return b +} + +// WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPGet field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *ProbeApplyConfiguration { + b.HTTPGet = value + return b +} + +// WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TCPSocket field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *ProbeApplyConfiguration { + b.TCPSocket = value + return b +} + +// WithGRPC sets the GRPC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GRPC field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithGRPC(value *GRPCActionApplyConfiguration) *ProbeApplyConfiguration { + b.GRPC = value + return b +} + +// WithInitialDelaySeconds sets the InitialDelaySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InitialDelaySeconds field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithInitialDelaySeconds(value int32) *ProbeApplyConfiguration { + b.InitialDelaySeconds = &value + return b +} + +// WithTimeoutSeconds sets the TimeoutSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeoutSeconds field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithTimeoutSeconds(value int32) *ProbeApplyConfiguration { + b.TimeoutSeconds = &value + return b +} + +// WithPeriodSeconds sets the PeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PeriodSeconds field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithPeriodSeconds(value int32) *ProbeApplyConfiguration { + b.PeriodSeconds = &value + return b +} + +// WithSuccessThreshold sets the SuccessThreshold field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SuccessThreshold field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithSuccessThreshold(value int32) *ProbeApplyConfiguration { + b.SuccessThreshold = &value + return b +} + +// WithFailureThreshold sets the FailureThreshold field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FailureThreshold field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithFailureThreshold(value int32) *ProbeApplyConfiguration { + b.FailureThreshold = &value + return b +} + +// WithTerminationGracePeriodSeconds sets the TerminationGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TerminationGracePeriodSeconds field is set to the value of the last call. +func (b *ProbeApplyConfiguration) WithTerminationGracePeriodSeconds(value int64) *ProbeApplyConfiguration { + b.TerminationGracePeriodSeconds = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/probehandler.go b/pkg/generated/applyconfigurations/core/v1/probehandler.go new file mode 100644 index 00000000000..ded64c2ec14 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/probehandler.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ProbeHandlerApplyConfiguration represents an declarative configuration of the ProbeHandler type for use +// with apply. +type ProbeHandlerApplyConfiguration struct { + Exec *ExecActionApplyConfiguration `json:"exec,omitempty"` + HTTPGet *HTTPGetActionApplyConfiguration `json:"httpGet,omitempty"` + TCPSocket *TCPSocketActionApplyConfiguration `json:"tcpSocket,omitempty"` + GRPC *GRPCActionApplyConfiguration `json:"grpc,omitempty"` +} + +// ProbeHandlerApplyConfiguration constructs an declarative configuration of the ProbeHandler type for use with +// apply. +func ProbeHandler() *ProbeHandlerApplyConfiguration { + return &ProbeHandlerApplyConfiguration{} +} + +// WithExec sets the Exec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Exec field is set to the value of the last call. +func (b *ProbeHandlerApplyConfiguration) WithExec(value *ExecActionApplyConfiguration) *ProbeHandlerApplyConfiguration { + b.Exec = value + return b +} + +// WithHTTPGet sets the HTTPGet field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HTTPGet field is set to the value of the last call. +func (b *ProbeHandlerApplyConfiguration) WithHTTPGet(value *HTTPGetActionApplyConfiguration) *ProbeHandlerApplyConfiguration { + b.HTTPGet = value + return b +} + +// WithTCPSocket sets the TCPSocket field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TCPSocket field is set to the value of the last call. +func (b *ProbeHandlerApplyConfiguration) WithTCPSocket(value *TCPSocketActionApplyConfiguration) *ProbeHandlerApplyConfiguration { + b.TCPSocket = value + return b +} + +// WithGRPC sets the GRPC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GRPC field is set to the value of the last call. +func (b *ProbeHandlerApplyConfiguration) WithGRPC(value *GRPCActionApplyConfiguration) *ProbeHandlerApplyConfiguration { + b.GRPC = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/projectedvolumesource.go b/pkg/generated/applyconfigurations/core/v1/projectedvolumesource.go new file mode 100644 index 00000000000..76d29c80a24 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/projectedvolumesource.go @@ -0,0 +1,42 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ProjectedVolumeSourceApplyConfiguration represents an declarative configuration of the ProjectedVolumeSource type for use +// with apply. +type ProjectedVolumeSourceApplyConfiguration struct { + Sources []VolumeProjectionApplyConfiguration `json:"sources,omitempty"` + DefaultMode *int32 `json:"defaultMode,omitempty"` +} + +// ProjectedVolumeSourceApplyConfiguration constructs an declarative configuration of the ProjectedVolumeSource type for use with +// apply. +func ProjectedVolumeSource() *ProjectedVolumeSourceApplyConfiguration { + return &ProjectedVolumeSourceApplyConfiguration{} +} + +// WithSources adds the given value to the Sources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Sources field. +func (b *ProjectedVolumeSourceApplyConfiguration) WithSources(values ...*VolumeProjectionApplyConfiguration) *ProjectedVolumeSourceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSources") + } + b.Sources = append(b.Sources, *values[i]) + } + return b +} + +// WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultMode field is set to the value of the last call. +func (b *ProjectedVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *ProjectedVolumeSourceApplyConfiguration { + b.DefaultMode = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/quobytevolumesource.go b/pkg/generated/applyconfigurations/core/v1/quobytevolumesource.go new file mode 100644 index 00000000000..adca3fad626 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/quobytevolumesource.go @@ -0,0 +1,73 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// QuobyteVolumeSourceApplyConfiguration represents an declarative configuration of the QuobyteVolumeSource type for use +// with apply. +type QuobyteVolumeSourceApplyConfiguration struct { + Registry *string `json:"registry,omitempty"` + Volume *string `json:"volume,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + User *string `json:"user,omitempty"` + Group *string `json:"group,omitempty"` + Tenant *string `json:"tenant,omitempty"` +} + +// QuobyteVolumeSourceApplyConfiguration constructs an declarative configuration of the QuobyteVolumeSource type for use with +// apply. +func QuobyteVolumeSource() *QuobyteVolumeSourceApplyConfiguration { + return &QuobyteVolumeSourceApplyConfiguration{} +} + +// WithRegistry sets the Registry field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Registry field is set to the value of the last call. +func (b *QuobyteVolumeSourceApplyConfiguration) WithRegistry(value string) *QuobyteVolumeSourceApplyConfiguration { + b.Registry = &value + return b +} + +// WithVolume sets the Volume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Volume field is set to the value of the last call. +func (b *QuobyteVolumeSourceApplyConfiguration) WithVolume(value string) *QuobyteVolumeSourceApplyConfiguration { + b.Volume = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *QuobyteVolumeSourceApplyConfiguration) WithReadOnly(value bool) *QuobyteVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *QuobyteVolumeSourceApplyConfiguration) WithUser(value string) *QuobyteVolumeSourceApplyConfiguration { + b.User = &value + return b +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *QuobyteVolumeSourceApplyConfiguration) WithGroup(value string) *QuobyteVolumeSourceApplyConfiguration { + b.Group = &value + return b +} + +// WithTenant sets the Tenant field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Tenant field is set to the value of the last call. +func (b *QuobyteVolumeSourceApplyConfiguration) WithTenant(value string) *QuobyteVolumeSourceApplyConfiguration { + b.Tenant = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/rbdpersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/rbdpersistentvolumesource.go new file mode 100644 index 00000000000..9a0540ba5bd --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/rbdpersistentvolumesource.go @@ -0,0 +1,93 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// RBDPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the RBDPersistentVolumeSource type for use +// with apply. +type RBDPersistentVolumeSourceApplyConfiguration struct { + CephMonitors []string `json:"monitors,omitempty"` + RBDImage *string `json:"image,omitempty"` + FSType *string `json:"fsType,omitempty"` + RBDPool *string `json:"pool,omitempty"` + RadosUser *string `json:"user,omitempty"` + Keyring *string `json:"keyring,omitempty"` + SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// RBDPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the RBDPersistentVolumeSource type for use with +// apply. +func RBDPersistentVolumeSource() *RBDPersistentVolumeSourceApplyConfiguration { + return &RBDPersistentVolumeSourceApplyConfiguration{} +} + +// WithCephMonitors adds the given value to the CephMonitors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CephMonitors field. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithCephMonitors(values ...string) *RBDPersistentVolumeSourceApplyConfiguration { + for i := range values { + b.CephMonitors = append(b.CephMonitors, values[i]) + } + return b +} + +// WithRBDImage sets the RBDImage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBDImage field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithRBDImage(value string) *RBDPersistentVolumeSourceApplyConfiguration { + b.RBDImage = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *RBDPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithRBDPool sets the RBDPool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBDPool field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithRBDPool(value string) *RBDPersistentVolumeSourceApplyConfiguration { + b.RBDPool = &value + return b +} + +// WithRadosUser sets the RadosUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RadosUser field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithRadosUser(value string) *RBDPersistentVolumeSourceApplyConfiguration { + b.RadosUser = &value + return b +} + +// WithKeyring sets the Keyring field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Keyring field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithKeyring(value string) *RBDPersistentVolumeSourceApplyConfiguration { + b.Keyring = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *RBDPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *RBDPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *RBDPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/rbdvolumesource.go b/pkg/generated/applyconfigurations/core/v1/rbdvolumesource.go new file mode 100644 index 00000000000..e63153b678c --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/rbdvolumesource.go @@ -0,0 +1,93 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// RBDVolumeSourceApplyConfiguration represents an declarative configuration of the RBDVolumeSource type for use +// with apply. +type RBDVolumeSourceApplyConfiguration struct { + CephMonitors []string `json:"monitors,omitempty"` + RBDImage *string `json:"image,omitempty"` + FSType *string `json:"fsType,omitempty"` + RBDPool *string `json:"pool,omitempty"` + RadosUser *string `json:"user,omitempty"` + Keyring *string `json:"keyring,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// RBDVolumeSourceApplyConfiguration constructs an declarative configuration of the RBDVolumeSource type for use with +// apply. +func RBDVolumeSource() *RBDVolumeSourceApplyConfiguration { + return &RBDVolumeSourceApplyConfiguration{} +} + +// WithCephMonitors adds the given value to the CephMonitors field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the CephMonitors field. +func (b *RBDVolumeSourceApplyConfiguration) WithCephMonitors(values ...string) *RBDVolumeSourceApplyConfiguration { + for i := range values { + b.CephMonitors = append(b.CephMonitors, values[i]) + } + return b +} + +// WithRBDImage sets the RBDImage field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBDImage field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithRBDImage(value string) *RBDVolumeSourceApplyConfiguration { + b.RBDImage = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithFSType(value string) *RBDVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithRBDPool sets the RBDPool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBDPool field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithRBDPool(value string) *RBDVolumeSourceApplyConfiguration { + b.RBDPool = &value + return b +} + +// WithRadosUser sets the RadosUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RadosUser field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithRadosUser(value string) *RBDVolumeSourceApplyConfiguration { + b.RadosUser = &value + return b +} + +// WithKeyring sets the Keyring field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Keyring field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithKeyring(value string) *RBDVolumeSourceApplyConfiguration { + b.Keyring = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *RBDVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *RBDVolumeSourceApplyConfiguration) WithReadOnly(value bool) *RBDVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/replicationcontroller.go b/pkg/generated/applyconfigurations/core/v1/replicationcontroller.go new file mode 100644 index 00000000000..c9741299180 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/replicationcontroller.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ReplicationControllerApplyConfiguration represents an declarative configuration of the ReplicationController type for use +// with apply. +type ReplicationControllerApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ReplicationControllerSpecApplyConfiguration `json:"spec,omitempty"` + Status *ReplicationControllerStatusApplyConfiguration `json:"status,omitempty"` +} + +// ReplicationController constructs an declarative configuration of the ReplicationController type for use with +// apply. +func ReplicationController(name, namespace string) *ReplicationControllerApplyConfiguration { + b := &ReplicationControllerApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ReplicationController") + b.WithAPIVersion("v1") + return b +} + +// ExtractReplicationController extracts the applied configuration owned by fieldManager from +// replicationController. If no managedFields are found in replicationController for fieldManager, a +// ReplicationControllerApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// replicationController must be a unmodified ReplicationController API object that was retrieved from the Kubernetes API. +// ExtractReplicationController provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractReplicationController(replicationController *apicorev1.ReplicationController, fieldManager string) (*ReplicationControllerApplyConfiguration, error) { + return extractReplicationController(replicationController, fieldManager, "") +} + +// ExtractReplicationControllerStatus is the same as ExtractReplicationController except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractReplicationControllerStatus(replicationController *apicorev1.ReplicationController, fieldManager string) (*ReplicationControllerApplyConfiguration, error) { + return extractReplicationController(replicationController, fieldManager, "status") +} + +func extractReplicationController(replicationController *apicorev1.ReplicationController, fieldManager string, subresource string) (*ReplicationControllerApplyConfiguration, error) { + b := &ReplicationControllerApplyConfiguration{} + err := managedfields.ExtractInto(replicationController, internal.Parser().Type("io.k8s.api.core.v1.ReplicationController"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(replicationController.Name) + b.WithNamespace(replicationController.Namespace) + + b.WithKind("ReplicationController") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithKind(value string) *ReplicationControllerApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithAPIVersion(value string) *ReplicationControllerApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithName(value string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithGenerateName(value string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithNamespace(value string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithUID(value types.UID) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithResourceVersion(value string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithGeneration(value int64) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ReplicationControllerApplyConfiguration) WithLabels(entries map[string]string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ReplicationControllerApplyConfiguration) WithAnnotations(entries map[string]string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ReplicationControllerApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ReplicationControllerApplyConfiguration) WithFinalizers(values ...string) *ReplicationControllerApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ReplicationControllerApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithSpec(value *ReplicationControllerSpecApplyConfiguration) *ReplicationControllerApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ReplicationControllerApplyConfiguration) WithStatus(value *ReplicationControllerStatusApplyConfiguration) *ReplicationControllerApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/replicationcontrollercondition.go b/pkg/generated/applyconfigurations/core/v1/replicationcontrollercondition.go new file mode 100644 index 00000000000..5e78ae2cc07 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/replicationcontrollercondition.go @@ -0,0 +1,69 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ReplicationControllerConditionApplyConfiguration represents an declarative configuration of the ReplicationControllerCondition type for use +// with apply. +type ReplicationControllerConditionApplyConfiguration struct { + Type *v1.ReplicationControllerConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ReplicationControllerConditionApplyConfiguration constructs an declarative configuration of the ReplicationControllerCondition type for use with +// apply. +func ReplicationControllerCondition() *ReplicationControllerConditionApplyConfiguration { + return &ReplicationControllerConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ReplicationControllerConditionApplyConfiguration) WithType(value v1.ReplicationControllerConditionType) *ReplicationControllerConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ReplicationControllerConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ReplicationControllerConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *ReplicationControllerConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *ReplicationControllerConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ReplicationControllerConditionApplyConfiguration) WithReason(value string) *ReplicationControllerConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ReplicationControllerConditionApplyConfiguration) WithMessage(value string) *ReplicationControllerConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/replicationcontrollerspec.go b/pkg/generated/applyconfigurations/core/v1/replicationcontrollerspec.go new file mode 100644 index 00000000000..03e38709efd --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/replicationcontrollerspec.go @@ -0,0 +1,61 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ReplicationControllerSpecApplyConfiguration represents an declarative configuration of the ReplicationControllerSpec type for use +// with apply. +type ReplicationControllerSpecApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + Selector map[string]string `json:"selector,omitempty"` + Template *PodTemplateSpecApplyConfiguration `json:"template,omitempty"` +} + +// ReplicationControllerSpecApplyConfiguration constructs an declarative configuration of the ReplicationControllerSpec type for use with +// apply. +func ReplicationControllerSpec() *ReplicationControllerSpecApplyConfiguration { + return &ReplicationControllerSpecApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ReplicationControllerSpecApplyConfiguration) WithReplicas(value int32) *ReplicationControllerSpecApplyConfiguration { + b.Replicas = &value + return b +} + +// WithMinReadySeconds sets the MinReadySeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinReadySeconds field is set to the value of the last call. +func (b *ReplicationControllerSpecApplyConfiguration) WithMinReadySeconds(value int32) *ReplicationControllerSpecApplyConfiguration { + b.MinReadySeconds = &value + return b +} + +// WithSelector puts the entries into the Selector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Selector field, +// overwriting an existing map entries in Selector field with the same key. +func (b *ReplicationControllerSpecApplyConfiguration) WithSelector(entries map[string]string) *ReplicationControllerSpecApplyConfiguration { + if b.Selector == nil && len(entries) > 0 { + b.Selector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Selector[k] = v + } + return b +} + +// WithTemplate sets the Template field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Template field is set to the value of the last call. +func (b *ReplicationControllerSpecApplyConfiguration) WithTemplate(value *PodTemplateSpecApplyConfiguration) *ReplicationControllerSpecApplyConfiguration { + b.Template = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/replicationcontrollerstatus.go b/pkg/generated/applyconfigurations/core/v1/replicationcontrollerstatus.go new file mode 100644 index 00000000000..89823bb3b47 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/replicationcontrollerstatus.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ReplicationControllerStatusApplyConfiguration represents an declarative configuration of the ReplicationControllerStatus type for use +// with apply. +type ReplicationControllerStatusApplyConfiguration struct { + Replicas *int32 `json:"replicas,omitempty"` + FullyLabeledReplicas *int32 `json:"fullyLabeledReplicas,omitempty"` + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + Conditions []ReplicationControllerConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ReplicationControllerStatusApplyConfiguration constructs an declarative configuration of the ReplicationControllerStatus type for use with +// apply. +func ReplicationControllerStatus() *ReplicationControllerStatusApplyConfiguration { + return &ReplicationControllerStatusApplyConfiguration{} +} + +// WithReplicas sets the Replicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Replicas field is set to the value of the last call. +func (b *ReplicationControllerStatusApplyConfiguration) WithReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { + b.Replicas = &value + return b +} + +// WithFullyLabeledReplicas sets the FullyLabeledReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FullyLabeledReplicas field is set to the value of the last call. +func (b *ReplicationControllerStatusApplyConfiguration) WithFullyLabeledReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { + b.FullyLabeledReplicas = &value + return b +} + +// WithReadyReplicas sets the ReadyReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadyReplicas field is set to the value of the last call. +func (b *ReplicationControllerStatusApplyConfiguration) WithReadyReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { + b.ReadyReplicas = &value + return b +} + +// WithAvailableReplicas sets the AvailableReplicas field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AvailableReplicas field is set to the value of the last call. +func (b *ReplicationControllerStatusApplyConfiguration) WithAvailableReplicas(value int32) *ReplicationControllerStatusApplyConfiguration { + b.AvailableReplicas = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ReplicationControllerStatusApplyConfiguration) WithObservedGeneration(value int64) *ReplicationControllerStatusApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ReplicationControllerStatusApplyConfiguration) WithConditions(values ...*ReplicationControllerConditionApplyConfiguration) *ReplicationControllerStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/resourceclaim.go b/pkg/generated/applyconfigurations/core/v1/resourceclaim.go new file mode 100644 index 00000000000..828a61e325f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/resourceclaim.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ResourceClaimApplyConfiguration represents an declarative configuration of the ResourceClaim type for use +// with apply. +type ResourceClaimApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// ResourceClaimApplyConfiguration constructs an declarative configuration of the ResourceClaim type for use with +// apply. +func ResourceClaim() *ResourceClaimApplyConfiguration { + return &ResourceClaimApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceClaimApplyConfiguration) WithName(value string) *ResourceClaimApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/resourcefieldselector.go b/pkg/generated/applyconfigurations/core/v1/resourcefieldselector.go new file mode 100644 index 00000000000..79eba7fd18d --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/resourcefieldselector.go @@ -0,0 +1,50 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + resource "k8s.io/apimachinery/pkg/api/resource" +) + +// ResourceFieldSelectorApplyConfiguration represents an declarative configuration of the ResourceFieldSelector type for use +// with apply. +type ResourceFieldSelectorApplyConfiguration struct { + ContainerName *string `json:"containerName,omitempty"` + Resource *string `json:"resource,omitempty"` + Divisor *resource.Quantity `json:"divisor,omitempty"` +} + +// ResourceFieldSelectorApplyConfiguration constructs an declarative configuration of the ResourceFieldSelector type for use with +// apply. +func ResourceFieldSelector() *ResourceFieldSelectorApplyConfiguration { + return &ResourceFieldSelectorApplyConfiguration{} +} + +// WithContainerName sets the ContainerName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ContainerName field is set to the value of the last call. +func (b *ResourceFieldSelectorApplyConfiguration) WithContainerName(value string) *ResourceFieldSelectorApplyConfiguration { + b.ContainerName = &value + return b +} + +// WithResource sets the Resource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Resource field is set to the value of the last call. +func (b *ResourceFieldSelectorApplyConfiguration) WithResource(value string) *ResourceFieldSelectorApplyConfiguration { + b.Resource = &value + return b +} + +// WithDivisor sets the Divisor field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Divisor field is set to the value of the last call. +func (b *ResourceFieldSelectorApplyConfiguration) WithDivisor(value resource.Quantity) *ResourceFieldSelectorApplyConfiguration { + b.Divisor = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/resourcequota.go b/pkg/generated/applyconfigurations/core/v1/resourcequota.go new file mode 100644 index 00000000000..6a887e44b42 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/resourcequota.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ResourceQuotaApplyConfiguration represents an declarative configuration of the ResourceQuota type for use +// with apply. +type ResourceQuotaApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ResourceQuotaSpecApplyConfiguration `json:"spec,omitempty"` + Status *ResourceQuotaStatusApplyConfiguration `json:"status,omitempty"` +} + +// ResourceQuota constructs an declarative configuration of the ResourceQuota type for use with +// apply. +func ResourceQuota(name, namespace string) *ResourceQuotaApplyConfiguration { + b := &ResourceQuotaApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ResourceQuota") + b.WithAPIVersion("v1") + return b +} + +// ExtractResourceQuota extracts the applied configuration owned by fieldManager from +// resourceQuota. If no managedFields are found in resourceQuota for fieldManager, a +// ResourceQuotaApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// resourceQuota must be a unmodified ResourceQuota API object that was retrieved from the Kubernetes API. +// ExtractResourceQuota provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractResourceQuota(resourceQuota *apicorev1.ResourceQuota, fieldManager string) (*ResourceQuotaApplyConfiguration, error) { + return extractResourceQuota(resourceQuota, fieldManager, "") +} + +// ExtractResourceQuotaStatus is the same as ExtractResourceQuota except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractResourceQuotaStatus(resourceQuota *apicorev1.ResourceQuota, fieldManager string) (*ResourceQuotaApplyConfiguration, error) { + return extractResourceQuota(resourceQuota, fieldManager, "status") +} + +func extractResourceQuota(resourceQuota *apicorev1.ResourceQuota, fieldManager string, subresource string) (*ResourceQuotaApplyConfiguration, error) { + b := &ResourceQuotaApplyConfiguration{} + err := managedfields.ExtractInto(resourceQuota, internal.Parser().Type("io.k8s.api.core.v1.ResourceQuota"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(resourceQuota.Name) + b.WithNamespace(resourceQuota.Namespace) + + b.WithKind("ResourceQuota") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithKind(value string) *ResourceQuotaApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithAPIVersion(value string) *ResourceQuotaApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithName(value string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithGenerateName(value string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithNamespace(value string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithUID(value types.UID) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithResourceVersion(value string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithGeneration(value int64) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ResourceQuotaApplyConfiguration) WithLabels(entries map[string]string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ResourceQuotaApplyConfiguration) WithAnnotations(entries map[string]string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ResourceQuotaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ResourceQuotaApplyConfiguration) WithFinalizers(values ...string) *ResourceQuotaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ResourceQuotaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithSpec(value *ResourceQuotaSpecApplyConfiguration) *ResourceQuotaApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ResourceQuotaApplyConfiguration) WithStatus(value *ResourceQuotaStatusApplyConfiguration) *ResourceQuotaApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/resourcequotaspec.go b/pkg/generated/applyconfigurations/core/v1/resourcequotaspec.go new file mode 100644 index 00000000000..addf13d5804 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/resourcequotaspec.go @@ -0,0 +1,52 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ResourceQuotaSpecApplyConfiguration represents an declarative configuration of the ResourceQuotaSpec type for use +// with apply. +type ResourceQuotaSpecApplyConfiguration struct { + Hard *v1.ResourceList `json:"hard,omitempty"` + Scopes []v1.ResourceQuotaScope `json:"scopes,omitempty"` + ScopeSelector *ScopeSelectorApplyConfiguration `json:"scopeSelector,omitempty"` +} + +// ResourceQuotaSpecApplyConfiguration constructs an declarative configuration of the ResourceQuotaSpec type for use with +// apply. +func ResourceQuotaSpec() *ResourceQuotaSpecApplyConfiguration { + return &ResourceQuotaSpecApplyConfiguration{} +} + +// WithHard sets the Hard field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hard field is set to the value of the last call. +func (b *ResourceQuotaSpecApplyConfiguration) WithHard(value v1.ResourceList) *ResourceQuotaSpecApplyConfiguration { + b.Hard = &value + return b +} + +// WithScopes adds the given value to the Scopes field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Scopes field. +func (b *ResourceQuotaSpecApplyConfiguration) WithScopes(values ...v1.ResourceQuotaScope) *ResourceQuotaSpecApplyConfiguration { + for i := range values { + b.Scopes = append(b.Scopes, values[i]) + } + return b +} + +// WithScopeSelector sets the ScopeSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScopeSelector field is set to the value of the last call. +func (b *ResourceQuotaSpecApplyConfiguration) WithScopeSelector(value *ScopeSelectorApplyConfiguration) *ResourceQuotaSpecApplyConfiguration { + b.ScopeSelector = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/resourcequotastatus.go b/pkg/generated/applyconfigurations/core/v1/resourcequotastatus.go new file mode 100644 index 00000000000..0750d70224f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/resourcequotastatus.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ResourceQuotaStatusApplyConfiguration represents an declarative configuration of the ResourceQuotaStatus type for use +// with apply. +type ResourceQuotaStatusApplyConfiguration struct { + Hard *v1.ResourceList `json:"hard,omitempty"` + Used *v1.ResourceList `json:"used,omitempty"` +} + +// ResourceQuotaStatusApplyConfiguration constructs an declarative configuration of the ResourceQuotaStatus type for use with +// apply. +func ResourceQuotaStatus() *ResourceQuotaStatusApplyConfiguration { + return &ResourceQuotaStatusApplyConfiguration{} +} + +// WithHard sets the Hard field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Hard field is set to the value of the last call. +func (b *ResourceQuotaStatusApplyConfiguration) WithHard(value v1.ResourceList) *ResourceQuotaStatusApplyConfiguration { + b.Hard = &value + return b +} + +// WithUsed sets the Used field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Used field is set to the value of the last call. +func (b *ResourceQuotaStatusApplyConfiguration) WithUsed(value v1.ResourceList) *ResourceQuotaStatusApplyConfiguration { + b.Used = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/resourcerequirements.go b/pkg/generated/applyconfigurations/core/v1/resourcerequirements.go new file mode 100644 index 00000000000..4af722b86c4 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/resourcerequirements.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ResourceRequirementsApplyConfiguration represents an declarative configuration of the ResourceRequirements type for use +// with apply. +type ResourceRequirementsApplyConfiguration struct { + Limits *v1.ResourceList `json:"limits,omitempty"` + Requests *v1.ResourceList `json:"requests,omitempty"` + Claims []ResourceClaimApplyConfiguration `json:"claims,omitempty"` +} + +// ResourceRequirementsApplyConfiguration constructs an declarative configuration of the ResourceRequirements type for use with +// apply. +func ResourceRequirements() *ResourceRequirementsApplyConfiguration { + return &ResourceRequirementsApplyConfiguration{} +} + +// WithLimits sets the Limits field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Limits field is set to the value of the last call. +func (b *ResourceRequirementsApplyConfiguration) WithLimits(value v1.ResourceList) *ResourceRequirementsApplyConfiguration { + b.Limits = &value + return b +} + +// WithRequests sets the Requests field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Requests field is set to the value of the last call. +func (b *ResourceRequirementsApplyConfiguration) WithRequests(value v1.ResourceList) *ResourceRequirementsApplyConfiguration { + b.Requests = &value + return b +} + +// WithClaims adds the given value to the Claims field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Claims field. +func (b *ResourceRequirementsApplyConfiguration) WithClaims(values ...*ResourceClaimApplyConfiguration) *ResourceRequirementsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithClaims") + } + b.Claims = append(b.Claims, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/scaleiopersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/scaleiopersistentvolumesource.go new file mode 100644 index 00000000000..2ab0a98c8e7 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/scaleiopersistentvolumesource.go @@ -0,0 +1,109 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScaleIOPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the ScaleIOPersistentVolumeSource type for use +// with apply. +type ScaleIOPersistentVolumeSourceApplyConfiguration struct { + Gateway *string `json:"gateway,omitempty"` + System *string `json:"system,omitempty"` + SecretRef *SecretReferenceApplyConfiguration `json:"secretRef,omitempty"` + SSLEnabled *bool `json:"sslEnabled,omitempty"` + ProtectionDomain *string `json:"protectionDomain,omitempty"` + StoragePool *string `json:"storagePool,omitempty"` + StorageMode *string `json:"storageMode,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// ScaleIOPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the ScaleIOPersistentVolumeSource type for use with +// apply. +func ScaleIOPersistentVolumeSource() *ScaleIOPersistentVolumeSourceApplyConfiguration { + return &ScaleIOPersistentVolumeSourceApplyConfiguration{} +} + +// WithGateway sets the Gateway field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Gateway field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithGateway(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.Gateway = &value + return b +} + +// WithSystem sets the System field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the System field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithSystem(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.System = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *SecretReferenceApplyConfiguration) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithSSLEnabled sets the SSLEnabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SSLEnabled field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithSSLEnabled(value bool) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.SSLEnabled = &value + return b +} + +// WithProtectionDomain sets the ProtectionDomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProtectionDomain field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithProtectionDomain(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.ProtectionDomain = &value + return b +} + +// WithStoragePool sets the StoragePool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StoragePool field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithStoragePool(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.StoragePool = &value + return b +} + +// WithStorageMode sets the StorageMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageMode field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithStorageMode(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.StorageMode = &value + return b +} + +// WithVolumeName sets the VolumeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeName field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithVolumeName(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.VolumeName = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *ScaleIOPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ScaleIOPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/scaleiovolumesource.go b/pkg/generated/applyconfigurations/core/v1/scaleiovolumesource.go new file mode 100644 index 00000000000..c29f2c8aa18 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/scaleiovolumesource.go @@ -0,0 +1,109 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScaleIOVolumeSourceApplyConfiguration represents an declarative configuration of the ScaleIOVolumeSource type for use +// with apply. +type ScaleIOVolumeSourceApplyConfiguration struct { + Gateway *string `json:"gateway,omitempty"` + System *string `json:"system,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` + SSLEnabled *bool `json:"sslEnabled,omitempty"` + ProtectionDomain *string `json:"protectionDomain,omitempty"` + StoragePool *string `json:"storagePool,omitempty"` + StorageMode *string `json:"storageMode,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` +} + +// ScaleIOVolumeSourceApplyConfiguration constructs an declarative configuration of the ScaleIOVolumeSource type for use with +// apply. +func ScaleIOVolumeSource() *ScaleIOVolumeSourceApplyConfiguration { + return &ScaleIOVolumeSourceApplyConfiguration{} +} + +// WithGateway sets the Gateway field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Gateway field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithGateway(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.Gateway = &value + return b +} + +// WithSystem sets the System field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the System field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithSystem(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.System = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *ScaleIOVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} + +// WithSSLEnabled sets the SSLEnabled field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SSLEnabled field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithSSLEnabled(value bool) *ScaleIOVolumeSourceApplyConfiguration { + b.SSLEnabled = &value + return b +} + +// WithProtectionDomain sets the ProtectionDomain field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProtectionDomain field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithProtectionDomain(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.ProtectionDomain = &value + return b +} + +// WithStoragePool sets the StoragePool field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StoragePool field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithStoragePool(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.StoragePool = &value + return b +} + +// WithStorageMode sets the StorageMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageMode field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithStorageMode(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.StorageMode = &value + return b +} + +// WithVolumeName sets the VolumeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeName field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithVolumeName(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.VolumeName = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithFSType(value string) *ScaleIOVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *ScaleIOVolumeSourceApplyConfiguration) WithReadOnly(value bool) *ScaleIOVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/scopedresourceselectorrequirement.go b/pkg/generated/applyconfigurations/core/v1/scopedresourceselectorrequirement.go new file mode 100644 index 00000000000..9f34413366a --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/scopedresourceselectorrequirement.go @@ -0,0 +1,52 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// ScopedResourceSelectorRequirementApplyConfiguration represents an declarative configuration of the ScopedResourceSelectorRequirement type for use +// with apply. +type ScopedResourceSelectorRequirementApplyConfiguration struct { + ScopeName *v1.ResourceQuotaScope `json:"scopeName,omitempty"` + Operator *v1.ScopeSelectorOperator `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` +} + +// ScopedResourceSelectorRequirementApplyConfiguration constructs an declarative configuration of the ScopedResourceSelectorRequirement type for use with +// apply. +func ScopedResourceSelectorRequirement() *ScopedResourceSelectorRequirementApplyConfiguration { + return &ScopedResourceSelectorRequirementApplyConfiguration{} +} + +// WithScopeName sets the ScopeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScopeName field is set to the value of the last call. +func (b *ScopedResourceSelectorRequirementApplyConfiguration) WithScopeName(value v1.ResourceQuotaScope) *ScopedResourceSelectorRequirementApplyConfiguration { + b.ScopeName = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *ScopedResourceSelectorRequirementApplyConfiguration) WithOperator(value v1.ScopeSelectorOperator) *ScopedResourceSelectorRequirementApplyConfiguration { + b.Operator = &value + return b +} + +// WithValues adds the given value to the Values field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Values field. +func (b *ScopedResourceSelectorRequirementApplyConfiguration) WithValues(values ...string) *ScopedResourceSelectorRequirementApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/scopeselector.go b/pkg/generated/applyconfigurations/core/v1/scopeselector.go new file mode 100644 index 00000000000..c8a46662da7 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/scopeselector.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ScopeSelectorApplyConfiguration represents an declarative configuration of the ScopeSelector type for use +// with apply. +type ScopeSelectorApplyConfiguration struct { + MatchExpressions []ScopedResourceSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` +} + +// ScopeSelectorApplyConfiguration constructs an declarative configuration of the ScopeSelector type for use with +// apply. +func ScopeSelector() *ScopeSelectorApplyConfiguration { + return &ScopeSelectorApplyConfiguration{} +} + +// WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchExpressions field. +func (b *ScopeSelectorApplyConfiguration) WithMatchExpressions(values ...*ScopedResourceSelectorRequirementApplyConfiguration) *ScopeSelectorApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchExpressions") + } + b.MatchExpressions = append(b.MatchExpressions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/seccompprofile.go b/pkg/generated/applyconfigurations/core/v1/seccompprofile.go new file mode 100644 index 00000000000..1e3af8f7c71 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/seccompprofile.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// SeccompProfileApplyConfiguration represents an declarative configuration of the SeccompProfile type for use +// with apply. +type SeccompProfileApplyConfiguration struct { + Type *v1.SeccompProfileType `json:"type,omitempty"` + LocalhostProfile *string `json:"localhostProfile,omitempty"` +} + +// SeccompProfileApplyConfiguration constructs an declarative configuration of the SeccompProfile type for use with +// apply. +func SeccompProfile() *SeccompProfileApplyConfiguration { + return &SeccompProfileApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SeccompProfileApplyConfiguration) WithType(value v1.SeccompProfileType) *SeccompProfileApplyConfiguration { + b.Type = &value + return b +} + +// WithLocalhostProfile sets the LocalhostProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LocalhostProfile field is set to the value of the last call. +func (b *SeccompProfileApplyConfiguration) WithLocalhostProfile(value string) *SeccompProfileApplyConfiguration { + b.LocalhostProfile = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/secret.go b/pkg/generated/applyconfigurations/core/v1/secret.go new file mode 100644 index 00000000000..628f8254457 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/secret.go @@ -0,0 +1,277 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// SecretApplyConfiguration represents an declarative configuration of the Secret type for use +// with apply. +type SecretApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Immutable *bool `json:"immutable,omitempty"` + Data map[string][]byte `json:"data,omitempty"` + StringData map[string]string `json:"stringData,omitempty"` + Type *corev1.SecretType `json:"type,omitempty"` +} + +// Secret constructs an declarative configuration of the Secret type for use with +// apply. +func Secret(name, namespace string) *SecretApplyConfiguration { + b := &SecretApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Secret") + b.WithAPIVersion("v1") + return b +} + +// ExtractSecret extracts the applied configuration owned by fieldManager from +// secret. If no managedFields are found in secret for fieldManager, a +// SecretApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// secret must be a unmodified Secret API object that was retrieved from the Kubernetes API. +// ExtractSecret provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractSecret(secret *corev1.Secret, fieldManager string) (*SecretApplyConfiguration, error) { + return extractSecret(secret, fieldManager, "") +} + +// ExtractSecretStatus is the same as ExtractSecret except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractSecretStatus(secret *corev1.Secret, fieldManager string) (*SecretApplyConfiguration, error) { + return extractSecret(secret, fieldManager, "status") +} + +func extractSecret(secret *corev1.Secret, fieldManager string, subresource string) (*SecretApplyConfiguration, error) { + b := &SecretApplyConfiguration{} + err := managedfields.ExtractInto(secret, internal.Parser().Type("io.k8s.api.core.v1.Secret"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(secret.Name) + b.WithNamespace(secret.Namespace) + + b.WithKind("Secret") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithKind(value string) *SecretApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithAPIVersion(value string) *SecretApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithName(value string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithGenerateName(value string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithNamespace(value string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithUID(value types.UID) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithResourceVersion(value string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithGeneration(value int64) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithCreationTimestamp(value metav1.Time) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *SecretApplyConfiguration) WithLabels(entries map[string]string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *SecretApplyConfiguration) WithAnnotations(entries map[string]string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *SecretApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *SecretApplyConfiguration) WithFinalizers(values ...string) *SecretApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *SecretApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithImmutable sets the Immutable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Immutable field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithImmutable(value bool) *SecretApplyConfiguration { + b.Immutable = &value + return b +} + +// WithData puts the entries into the Data field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Data field, +// overwriting an existing map entries in Data field with the same key. +func (b *SecretApplyConfiguration) WithData(entries map[string][]byte) *SecretApplyConfiguration { + if b.Data == nil && len(entries) > 0 { + b.Data = make(map[string][]byte, len(entries)) + } + for k, v := range entries { + b.Data[k] = v + } + return b +} + +// WithStringData puts the entries into the StringData field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the StringData field, +// overwriting an existing map entries in StringData field with the same key. +func (b *SecretApplyConfiguration) WithStringData(entries map[string]string) *SecretApplyConfiguration { + if b.StringData == nil && len(entries) > 0 { + b.StringData = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.StringData[k] = v + } + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SecretApplyConfiguration) WithType(value corev1.SecretType) *SecretApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/secretenvsource.go b/pkg/generated/applyconfigurations/core/v1/secretenvsource.go new file mode 100644 index 00000000000..84b9665b87f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/secretenvsource.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SecretEnvSourceApplyConfiguration represents an declarative configuration of the SecretEnvSource type for use +// with apply. +type SecretEnvSourceApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Optional *bool `json:"optional,omitempty"` +} + +// SecretEnvSourceApplyConfiguration constructs an declarative configuration of the SecretEnvSource type for use with +// apply. +func SecretEnvSource() *SecretEnvSourceApplyConfiguration { + return &SecretEnvSourceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretEnvSourceApplyConfiguration) WithName(value string) *SecretEnvSourceApplyConfiguration { + b.Name = &value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *SecretEnvSourceApplyConfiguration) WithOptional(value bool) *SecretEnvSourceApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/secretkeyselector.go b/pkg/generated/applyconfigurations/core/v1/secretkeyselector.go new file mode 100644 index 00000000000..ada10da7ebe --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/secretkeyselector.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SecretKeySelectorApplyConfiguration represents an declarative configuration of the SecretKeySelector type for use +// with apply. +type SecretKeySelectorApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Key *string `json:"key,omitempty"` + Optional *bool `json:"optional,omitempty"` +} + +// SecretKeySelectorApplyConfiguration constructs an declarative configuration of the SecretKeySelector type for use with +// apply. +func SecretKeySelector() *SecretKeySelectorApplyConfiguration { + return &SecretKeySelectorApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretKeySelectorApplyConfiguration) WithName(value string) *SecretKeySelectorApplyConfiguration { + b.Name = &value + return b +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *SecretKeySelectorApplyConfiguration) WithKey(value string) *SecretKeySelectorApplyConfiguration { + b.Key = &value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *SecretKeySelectorApplyConfiguration) WithOptional(value bool) *SecretKeySelectorApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/secretprojection.go b/pkg/generated/applyconfigurations/core/v1/secretprojection.go new file mode 100644 index 00000000000..8ff1e568587 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/secretprojection.go @@ -0,0 +1,51 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SecretProjectionApplyConfiguration represents an declarative configuration of the SecretProjection type for use +// with apply. +type SecretProjectionApplyConfiguration struct { + LocalObjectReferenceApplyConfiguration `json:",inline"` + Items []KeyToPathApplyConfiguration `json:"items,omitempty"` + Optional *bool `json:"optional,omitempty"` +} + +// SecretProjectionApplyConfiguration constructs an declarative configuration of the SecretProjection type for use with +// apply. +func SecretProjection() *SecretProjectionApplyConfiguration { + return &SecretProjectionApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretProjectionApplyConfiguration) WithName(value string) *SecretProjectionApplyConfiguration { + b.Name = &value + return b +} + +// WithItems adds the given value to the Items field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Items field. +func (b *SecretProjectionApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *SecretProjectionApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithItems") + } + b.Items = append(b.Items, *values[i]) + } + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *SecretProjectionApplyConfiguration) WithOptional(value bool) *SecretProjectionApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/secretreference.go b/pkg/generated/applyconfigurations/core/v1/secretreference.go new file mode 100644 index 00000000000..693105765f4 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/secretreference.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SecretReferenceApplyConfiguration represents an declarative configuration of the SecretReference type for use +// with apply. +type SecretReferenceApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// SecretReferenceApplyConfiguration constructs an declarative configuration of the SecretReference type for use with +// apply. +func SecretReference() *SecretReferenceApplyConfiguration { + return &SecretReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SecretReferenceApplyConfiguration) WithName(value string) *SecretReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *SecretReferenceApplyConfiguration) WithNamespace(value string) *SecretReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/secretvolumesource.go b/pkg/generated/applyconfigurations/core/v1/secretvolumesource.go new file mode 100644 index 00000000000..48ac13c4987 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/secretvolumesource.go @@ -0,0 +1,60 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SecretVolumeSourceApplyConfiguration represents an declarative configuration of the SecretVolumeSource type for use +// with apply. +type SecretVolumeSourceApplyConfiguration struct { + SecretName *string `json:"secretName,omitempty"` + Items []KeyToPathApplyConfiguration `json:"items,omitempty"` + DefaultMode *int32 `json:"defaultMode,omitempty"` + Optional *bool `json:"optional,omitempty"` +} + +// SecretVolumeSourceApplyConfiguration constructs an declarative configuration of the SecretVolumeSource type for use with +// apply. +func SecretVolumeSource() *SecretVolumeSourceApplyConfiguration { + return &SecretVolumeSourceApplyConfiguration{} +} + +// WithSecretName sets the SecretName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretName field is set to the value of the last call. +func (b *SecretVolumeSourceApplyConfiguration) WithSecretName(value string) *SecretVolumeSourceApplyConfiguration { + b.SecretName = &value + return b +} + +// WithItems adds the given value to the Items field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Items field. +func (b *SecretVolumeSourceApplyConfiguration) WithItems(values ...*KeyToPathApplyConfiguration) *SecretVolumeSourceApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithItems") + } + b.Items = append(b.Items, *values[i]) + } + return b +} + +// WithDefaultMode sets the DefaultMode field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DefaultMode field is set to the value of the last call. +func (b *SecretVolumeSourceApplyConfiguration) WithDefaultMode(value int32) *SecretVolumeSourceApplyConfiguration { + b.DefaultMode = &value + return b +} + +// WithOptional sets the Optional field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Optional field is set to the value of the last call. +func (b *SecretVolumeSourceApplyConfiguration) WithOptional(value bool) *SecretVolumeSourceApplyConfiguration { + b.Optional = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/securitycontext.go b/pkg/generated/applyconfigurations/core/v1/securitycontext.go new file mode 100644 index 00000000000..24618f57eaa --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/securitycontext.go @@ -0,0 +1,131 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// SecurityContextApplyConfiguration represents an declarative configuration of the SecurityContext type for use +// with apply. +type SecurityContextApplyConfiguration struct { + Capabilities *CapabilitiesApplyConfiguration `json:"capabilities,omitempty"` + Privileged *bool `json:"privileged,omitempty"` + SELinuxOptions *SELinuxOptionsApplyConfiguration `json:"seLinuxOptions,omitempty"` + WindowsOptions *WindowsSecurityContextOptionsApplyConfiguration `json:"windowsOptions,omitempty"` + RunAsUser *int64 `json:"runAsUser,omitempty"` + RunAsGroup *int64 `json:"runAsGroup,omitempty"` + RunAsNonRoot *bool `json:"runAsNonRoot,omitempty"` + ReadOnlyRootFilesystem *bool `json:"readOnlyRootFilesystem,omitempty"` + AllowPrivilegeEscalation *bool `json:"allowPrivilegeEscalation,omitempty"` + ProcMount *corev1.ProcMountType `json:"procMount,omitempty"` + SeccompProfile *SeccompProfileApplyConfiguration `json:"seccompProfile,omitempty"` + AppArmorProfile *AppArmorProfileApplyConfiguration `json:"appArmorProfile,omitempty"` +} + +// SecurityContextApplyConfiguration constructs an declarative configuration of the SecurityContext type for use with +// apply. +func SecurityContext() *SecurityContextApplyConfiguration { + return &SecurityContextApplyConfiguration{} +} + +// WithCapabilities sets the Capabilities field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Capabilities field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithCapabilities(value *CapabilitiesApplyConfiguration) *SecurityContextApplyConfiguration { + b.Capabilities = value + return b +} + +// WithPrivileged sets the Privileged field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Privileged field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithPrivileged(value bool) *SecurityContextApplyConfiguration { + b.Privileged = &value + return b +} + +// WithSELinuxOptions sets the SELinuxOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SELinuxOptions field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithSELinuxOptions(value *SELinuxOptionsApplyConfiguration) *SecurityContextApplyConfiguration { + b.SELinuxOptions = value + return b +} + +// WithWindowsOptions sets the WindowsOptions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WindowsOptions field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithWindowsOptions(value *WindowsSecurityContextOptionsApplyConfiguration) *SecurityContextApplyConfiguration { + b.WindowsOptions = value + return b +} + +// WithRunAsUser sets the RunAsUser field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsUser field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithRunAsUser(value int64) *SecurityContextApplyConfiguration { + b.RunAsUser = &value + return b +} + +// WithRunAsGroup sets the RunAsGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsGroup field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithRunAsGroup(value int64) *SecurityContextApplyConfiguration { + b.RunAsGroup = &value + return b +} + +// WithRunAsNonRoot sets the RunAsNonRoot field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsNonRoot field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithRunAsNonRoot(value bool) *SecurityContextApplyConfiguration { + b.RunAsNonRoot = &value + return b +} + +// WithReadOnlyRootFilesystem sets the ReadOnlyRootFilesystem field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnlyRootFilesystem field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithReadOnlyRootFilesystem(value bool) *SecurityContextApplyConfiguration { + b.ReadOnlyRootFilesystem = &value + return b +} + +// WithAllowPrivilegeEscalation sets the AllowPrivilegeEscalation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllowPrivilegeEscalation field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithAllowPrivilegeEscalation(value bool) *SecurityContextApplyConfiguration { + b.AllowPrivilegeEscalation = &value + return b +} + +// WithProcMount sets the ProcMount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ProcMount field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithProcMount(value corev1.ProcMountType) *SecurityContextApplyConfiguration { + b.ProcMount = &value + return b +} + +// WithSeccompProfile sets the SeccompProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SeccompProfile field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithSeccompProfile(value *SeccompProfileApplyConfiguration) *SecurityContextApplyConfiguration { + b.SeccompProfile = value + return b +} + +// WithAppArmorProfile sets the AppArmorProfile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AppArmorProfile field is set to the value of the last call. +func (b *SecurityContextApplyConfiguration) WithAppArmorProfile(value *AppArmorProfileApplyConfiguration) *SecurityContextApplyConfiguration { + b.AppArmorProfile = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/selinuxoptions.go b/pkg/generated/applyconfigurations/core/v1/selinuxoptions.go new file mode 100644 index 00000000000..9797d8eafec --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/selinuxoptions.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SELinuxOptionsApplyConfiguration represents an declarative configuration of the SELinuxOptions type for use +// with apply. +type SELinuxOptionsApplyConfiguration struct { + User *string `json:"user,omitempty"` + Role *string `json:"role,omitempty"` + Type *string `json:"type,omitempty"` + Level *string `json:"level,omitempty"` +} + +// SELinuxOptionsApplyConfiguration constructs an declarative configuration of the SELinuxOptions type for use with +// apply. +func SELinuxOptions() *SELinuxOptionsApplyConfiguration { + return &SELinuxOptionsApplyConfiguration{} +} + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *SELinuxOptionsApplyConfiguration) WithUser(value string) *SELinuxOptionsApplyConfiguration { + b.User = &value + return b +} + +// WithRole sets the Role field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Role field is set to the value of the last call. +func (b *SELinuxOptionsApplyConfiguration) WithRole(value string) *SELinuxOptionsApplyConfiguration { + b.Role = &value + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *SELinuxOptionsApplyConfiguration) WithType(value string) *SELinuxOptionsApplyConfiguration { + b.Type = &value + return b +} + +// WithLevel sets the Level field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Level field is set to the value of the last call. +func (b *SELinuxOptionsApplyConfiguration) WithLevel(value string) *SELinuxOptionsApplyConfiguration { + b.Level = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/service.go b/pkg/generated/applyconfigurations/core/v1/service.go new file mode 100644 index 00000000000..6a715152d2f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/service.go @@ -0,0 +1,247 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ServiceApplyConfiguration represents an declarative configuration of the Service type for use +// with apply. +type ServiceApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *ServiceSpecApplyConfiguration `json:"spec,omitempty"` + Status *ServiceStatusApplyConfiguration `json:"status,omitempty"` +} + +// Service constructs an declarative configuration of the Service type for use with +// apply. +func Service(name, namespace string) *ServiceApplyConfiguration { + b := &ServiceApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("Service") + b.WithAPIVersion("v1") + return b +} + +// ExtractService extracts the applied configuration owned by fieldManager from +// service. If no managedFields are found in service for fieldManager, a +// ServiceApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// service must be a unmodified Service API object that was retrieved from the Kubernetes API. +// ExtractService provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractService(service *apicorev1.Service, fieldManager string) (*ServiceApplyConfiguration, error) { + return extractService(service, fieldManager, "") +} + +// ExtractServiceStatus is the same as ExtractService except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractServiceStatus(service *apicorev1.Service, fieldManager string) (*ServiceApplyConfiguration, error) { + return extractService(service, fieldManager, "status") +} + +func extractService(service *apicorev1.Service, fieldManager string, subresource string) (*ServiceApplyConfiguration, error) { + b := &ServiceApplyConfiguration{} + err := managedfields.ExtractInto(service, internal.Parser().Type("io.k8s.api.core.v1.Service"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(service.Name) + b.WithNamespace(service.Namespace) + + b.WithKind("Service") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithKind(value string) *ServiceApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithAPIVersion(value string) *ServiceApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithName(value string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithGenerateName(value string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithNamespace(value string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithUID(value types.UID) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithResourceVersion(value string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithGeneration(value int64) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ServiceApplyConfiguration) WithLabels(entries map[string]string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ServiceApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ServiceApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ServiceApplyConfiguration) WithFinalizers(values ...string) *ServiceApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ServiceApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithSpec(value *ServiceSpecApplyConfiguration) *ServiceApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ServiceApplyConfiguration) WithStatus(value *ServiceStatusApplyConfiguration) *ServiceApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/serviceaccount.go b/pkg/generated/applyconfigurations/core/v1/serviceaccount.go new file mode 100644 index 00000000000..341ee6323e9 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/serviceaccount.go @@ -0,0 +1,266 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apicorev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// ServiceAccountApplyConfiguration represents an declarative configuration of the ServiceAccount type for use +// with apply. +type ServiceAccountApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Secrets []ObjectReferenceApplyConfiguration `json:"secrets,omitempty"` + ImagePullSecrets []LocalObjectReferenceApplyConfiguration `json:"imagePullSecrets,omitempty"` + AutomountServiceAccountToken *bool `json:"automountServiceAccountToken,omitempty"` +} + +// ServiceAccount constructs an declarative configuration of the ServiceAccount type for use with +// apply. +func ServiceAccount(name, namespace string) *ServiceAccountApplyConfiguration { + b := &ServiceAccountApplyConfiguration{} + b.WithName(name) + b.WithNamespace(namespace) + b.WithKind("ServiceAccount") + b.WithAPIVersion("v1") + return b +} + +// ExtractServiceAccount extracts the applied configuration owned by fieldManager from +// serviceAccount. If no managedFields are found in serviceAccount for fieldManager, a +// ServiceAccountApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// serviceAccount must be a unmodified ServiceAccount API object that was retrieved from the Kubernetes API. +// ExtractServiceAccount provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractServiceAccount(serviceAccount *apicorev1.ServiceAccount, fieldManager string) (*ServiceAccountApplyConfiguration, error) { + return extractServiceAccount(serviceAccount, fieldManager, "") +} + +// ExtractServiceAccountStatus is the same as ExtractServiceAccount except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractServiceAccountStatus(serviceAccount *apicorev1.ServiceAccount, fieldManager string) (*ServiceAccountApplyConfiguration, error) { + return extractServiceAccount(serviceAccount, fieldManager, "status") +} + +func extractServiceAccount(serviceAccount *apicorev1.ServiceAccount, fieldManager string, subresource string) (*ServiceAccountApplyConfiguration, error) { + b := &ServiceAccountApplyConfiguration{} + err := managedfields.ExtractInto(serviceAccount, internal.Parser().Type("io.k8s.api.core.v1.ServiceAccount"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(serviceAccount.Name) + b.WithNamespace(serviceAccount.Namespace) + + b.WithKind("ServiceAccount") + b.WithAPIVersion("v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithKind(value string) *ServiceAccountApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithAPIVersion(value string) *ServiceAccountApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithName(value string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithGenerateName(value string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithNamespace(value string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithUID(value types.UID) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithResourceVersion(value string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithGeneration(value int64) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithCreationTimestamp(value metav1.Time) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ServiceAccountApplyConfiguration) WithLabels(entries map[string]string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ServiceAccountApplyConfiguration) WithAnnotations(entries map[string]string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ServiceAccountApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ServiceAccountApplyConfiguration) WithFinalizers(values ...string) *ServiceAccountApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *ServiceAccountApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSecrets adds the given value to the Secrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Secrets field. +func (b *ServiceAccountApplyConfiguration) WithSecrets(values ...*ObjectReferenceApplyConfiguration) *ServiceAccountApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSecrets") + } + b.Secrets = append(b.Secrets, *values[i]) + } + return b +} + +// WithImagePullSecrets adds the given value to the ImagePullSecrets field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ImagePullSecrets field. +func (b *ServiceAccountApplyConfiguration) WithImagePullSecrets(values ...*LocalObjectReferenceApplyConfiguration) *ServiceAccountApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithImagePullSecrets") + } + b.ImagePullSecrets = append(b.ImagePullSecrets, *values[i]) + } + return b +} + +// WithAutomountServiceAccountToken sets the AutomountServiceAccountToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AutomountServiceAccountToken field is set to the value of the last call. +func (b *ServiceAccountApplyConfiguration) WithAutomountServiceAccountToken(value bool) *ServiceAccountApplyConfiguration { + b.AutomountServiceAccountToken = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/serviceaccounttokenprojection.go b/pkg/generated/applyconfigurations/core/v1/serviceaccounttokenprojection.go new file mode 100644 index 00000000000..0b69dbee254 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/serviceaccounttokenprojection.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ServiceAccountTokenProjectionApplyConfiguration represents an declarative configuration of the ServiceAccountTokenProjection type for use +// with apply. +type ServiceAccountTokenProjectionApplyConfiguration struct { + Audience *string `json:"audience,omitempty"` + ExpirationSeconds *int64 `json:"expirationSeconds,omitempty"` + Path *string `json:"path,omitempty"` +} + +// ServiceAccountTokenProjectionApplyConfiguration constructs an declarative configuration of the ServiceAccountTokenProjection type for use with +// apply. +func ServiceAccountTokenProjection() *ServiceAccountTokenProjectionApplyConfiguration { + return &ServiceAccountTokenProjectionApplyConfiguration{} +} + +// WithAudience sets the Audience field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Audience field is set to the value of the last call. +func (b *ServiceAccountTokenProjectionApplyConfiguration) WithAudience(value string) *ServiceAccountTokenProjectionApplyConfiguration { + b.Audience = &value + return b +} + +// WithExpirationSeconds sets the ExpirationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExpirationSeconds field is set to the value of the last call. +func (b *ServiceAccountTokenProjectionApplyConfiguration) WithExpirationSeconds(value int64) *ServiceAccountTokenProjectionApplyConfiguration { + b.ExpirationSeconds = &value + return b +} + +// WithPath sets the Path field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Path field is set to the value of the last call. +func (b *ServiceAccountTokenProjectionApplyConfiguration) WithPath(value string) *ServiceAccountTokenProjectionApplyConfiguration { + b.Path = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/serviceport.go b/pkg/generated/applyconfigurations/core/v1/serviceport.go new file mode 100644 index 00000000000..99dd3ad6166 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/serviceport.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// ServicePortApplyConfiguration represents an declarative configuration of the ServicePort type for use +// with apply. +type ServicePortApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Protocol *v1.Protocol `json:"protocol,omitempty"` + AppProtocol *string `json:"appProtocol,omitempty"` + Port *int32 `json:"port,omitempty"` + TargetPort *intstr.IntOrString `json:"targetPort,omitempty"` + NodePort *int32 `json:"nodePort,omitempty"` +} + +// ServicePortApplyConfiguration constructs an declarative configuration of the ServicePort type for use with +// apply. +func ServicePort() *ServicePortApplyConfiguration { + return &ServicePortApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServicePortApplyConfiguration) WithName(value string) *ServicePortApplyConfiguration { + b.Name = &value + return b +} + +// WithProtocol sets the Protocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Protocol field is set to the value of the last call. +func (b *ServicePortApplyConfiguration) WithProtocol(value v1.Protocol) *ServicePortApplyConfiguration { + b.Protocol = &value + return b +} + +// WithAppProtocol sets the AppProtocol field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AppProtocol field is set to the value of the last call. +func (b *ServicePortApplyConfiguration) WithAppProtocol(value string) *ServicePortApplyConfiguration { + b.AppProtocol = &value + return b +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *ServicePortApplyConfiguration) WithPort(value int32) *ServicePortApplyConfiguration { + b.Port = &value + return b +} + +// WithTargetPort sets the TargetPort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TargetPort field is set to the value of the last call. +func (b *ServicePortApplyConfiguration) WithTargetPort(value intstr.IntOrString) *ServicePortApplyConfiguration { + b.TargetPort = &value + return b +} + +// WithNodePort sets the NodePort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodePort field is set to the value of the last call. +func (b *ServicePortApplyConfiguration) WithNodePort(value int32) *ServicePortApplyConfiguration { + b.NodePort = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/servicespec.go b/pkg/generated/applyconfigurations/core/v1/servicespec.go new file mode 100644 index 00000000000..192bf4471f1 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/servicespec.go @@ -0,0 +1,222 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + corev1 "k8s.io/api/core/v1" +) + +// ServiceSpecApplyConfiguration represents an declarative configuration of the ServiceSpec type for use +// with apply. +type ServiceSpecApplyConfiguration struct { + Ports []ServicePortApplyConfiguration `json:"ports,omitempty"` + Selector map[string]string `json:"selector,omitempty"` + ClusterIP *string `json:"clusterIP,omitempty"` + ClusterIPs []string `json:"clusterIPs,omitempty"` + Type *corev1.ServiceType `json:"type,omitempty"` + ExternalIPs []string `json:"externalIPs,omitempty"` + SessionAffinity *corev1.ServiceAffinity `json:"sessionAffinity,omitempty"` + LoadBalancerIP *string `json:"loadBalancerIP,omitempty"` + LoadBalancerSourceRanges []string `json:"loadBalancerSourceRanges,omitempty"` + ExternalName *string `json:"externalName,omitempty"` + ExternalTrafficPolicy *corev1.ServiceExternalTrafficPolicy `json:"externalTrafficPolicy,omitempty"` + HealthCheckNodePort *int32 `json:"healthCheckNodePort,omitempty"` + PublishNotReadyAddresses *bool `json:"publishNotReadyAddresses,omitempty"` + SessionAffinityConfig *SessionAffinityConfigApplyConfiguration `json:"sessionAffinityConfig,omitempty"` + IPFamilies []corev1.IPFamily `json:"ipFamilies,omitempty"` + IPFamilyPolicy *corev1.IPFamilyPolicy `json:"ipFamilyPolicy,omitempty"` + AllocateLoadBalancerNodePorts *bool `json:"allocateLoadBalancerNodePorts,omitempty"` + LoadBalancerClass *string `json:"loadBalancerClass,omitempty"` + InternalTrafficPolicy *corev1.ServiceInternalTrafficPolicy `json:"internalTrafficPolicy,omitempty"` + TrafficDistribution *string `json:"trafficDistribution,omitempty"` +} + +// ServiceSpecApplyConfiguration constructs an declarative configuration of the ServiceSpec type for use with +// apply. +func ServiceSpec() *ServiceSpecApplyConfiguration { + return &ServiceSpecApplyConfiguration{} +} + +// WithPorts adds the given value to the Ports field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Ports field. +func (b *ServiceSpecApplyConfiguration) WithPorts(values ...*ServicePortApplyConfiguration) *ServiceSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithPorts") + } + b.Ports = append(b.Ports, *values[i]) + } + return b +} + +// WithSelector puts the entries into the Selector field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Selector field, +// overwriting an existing map entries in Selector field with the same key. +func (b *ServiceSpecApplyConfiguration) WithSelector(entries map[string]string) *ServiceSpecApplyConfiguration { + if b.Selector == nil && len(entries) > 0 { + b.Selector = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Selector[k] = v + } + return b +} + +// WithClusterIP sets the ClusterIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterIP field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithClusterIP(value string) *ServiceSpecApplyConfiguration { + b.ClusterIP = &value + return b +} + +// WithClusterIPs adds the given value to the ClusterIPs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ClusterIPs field. +func (b *ServiceSpecApplyConfiguration) WithClusterIPs(values ...string) *ServiceSpecApplyConfiguration { + for i := range values { + b.ClusterIPs = append(b.ClusterIPs, values[i]) + } + return b +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithType(value corev1.ServiceType) *ServiceSpecApplyConfiguration { + b.Type = &value + return b +} + +// WithExternalIPs adds the given value to the ExternalIPs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ExternalIPs field. +func (b *ServiceSpecApplyConfiguration) WithExternalIPs(values ...string) *ServiceSpecApplyConfiguration { + for i := range values { + b.ExternalIPs = append(b.ExternalIPs, values[i]) + } + return b +} + +// WithSessionAffinity sets the SessionAffinity field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionAffinity field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithSessionAffinity(value corev1.ServiceAffinity) *ServiceSpecApplyConfiguration { + b.SessionAffinity = &value + return b +} + +// WithLoadBalancerIP sets the LoadBalancerIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LoadBalancerIP field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithLoadBalancerIP(value string) *ServiceSpecApplyConfiguration { + b.LoadBalancerIP = &value + return b +} + +// WithLoadBalancerSourceRanges adds the given value to the LoadBalancerSourceRanges field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the LoadBalancerSourceRanges field. +func (b *ServiceSpecApplyConfiguration) WithLoadBalancerSourceRanges(values ...string) *ServiceSpecApplyConfiguration { + for i := range values { + b.LoadBalancerSourceRanges = append(b.LoadBalancerSourceRanges, values[i]) + } + return b +} + +// WithExternalName sets the ExternalName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalName field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithExternalName(value string) *ServiceSpecApplyConfiguration { + b.ExternalName = &value + return b +} + +// WithExternalTrafficPolicy sets the ExternalTrafficPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ExternalTrafficPolicy field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithExternalTrafficPolicy(value corev1.ServiceExternalTrafficPolicy) *ServiceSpecApplyConfiguration { + b.ExternalTrafficPolicy = &value + return b +} + +// WithHealthCheckNodePort sets the HealthCheckNodePort field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HealthCheckNodePort field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithHealthCheckNodePort(value int32) *ServiceSpecApplyConfiguration { + b.HealthCheckNodePort = &value + return b +} + +// WithPublishNotReadyAddresses sets the PublishNotReadyAddresses field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PublishNotReadyAddresses field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithPublishNotReadyAddresses(value bool) *ServiceSpecApplyConfiguration { + b.PublishNotReadyAddresses = &value + return b +} + +// WithSessionAffinityConfig sets the SessionAffinityConfig field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SessionAffinityConfig field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithSessionAffinityConfig(value *SessionAffinityConfigApplyConfiguration) *ServiceSpecApplyConfiguration { + b.SessionAffinityConfig = value + return b +} + +// WithIPFamilies adds the given value to the IPFamilies field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the IPFamilies field. +func (b *ServiceSpecApplyConfiguration) WithIPFamilies(values ...corev1.IPFamily) *ServiceSpecApplyConfiguration { + for i := range values { + b.IPFamilies = append(b.IPFamilies, values[i]) + } + return b +} + +// WithIPFamilyPolicy sets the IPFamilyPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the IPFamilyPolicy field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithIPFamilyPolicy(value corev1.IPFamilyPolicy) *ServiceSpecApplyConfiguration { + b.IPFamilyPolicy = &value + return b +} + +// WithAllocateLoadBalancerNodePorts sets the AllocateLoadBalancerNodePorts field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AllocateLoadBalancerNodePorts field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithAllocateLoadBalancerNodePorts(value bool) *ServiceSpecApplyConfiguration { + b.AllocateLoadBalancerNodePorts = &value + return b +} + +// WithLoadBalancerClass sets the LoadBalancerClass field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LoadBalancerClass field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithLoadBalancerClass(value string) *ServiceSpecApplyConfiguration { + b.LoadBalancerClass = &value + return b +} + +// WithInternalTrafficPolicy sets the InternalTrafficPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the InternalTrafficPolicy field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithInternalTrafficPolicy(value corev1.ServiceInternalTrafficPolicy) *ServiceSpecApplyConfiguration { + b.InternalTrafficPolicy = &value + return b +} + +// WithTrafficDistribution sets the TrafficDistribution field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TrafficDistribution field is set to the value of the last call. +func (b *ServiceSpecApplyConfiguration) WithTrafficDistribution(value string) *ServiceSpecApplyConfiguration { + b.TrafficDistribution = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/servicestatus.go b/pkg/generated/applyconfigurations/core/v1/servicestatus.go new file mode 100644 index 00000000000..d50f9175dc0 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/servicestatus.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" +) + +// ServiceStatusApplyConfiguration represents an declarative configuration of the ServiceStatus type for use +// with apply. +type ServiceStatusApplyConfiguration struct { + LoadBalancer *LoadBalancerStatusApplyConfiguration `json:"loadBalancer,omitempty"` + Conditions []metav1.ConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// ServiceStatusApplyConfiguration constructs an declarative configuration of the ServiceStatus type for use with +// apply. +func ServiceStatus() *ServiceStatusApplyConfiguration { + return &ServiceStatusApplyConfiguration{} +} + +// WithLoadBalancer sets the LoadBalancer field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LoadBalancer field is set to the value of the last call. +func (b *ServiceStatusApplyConfiguration) WithLoadBalancer(value *LoadBalancerStatusApplyConfiguration) *ServiceStatusApplyConfiguration { + b.LoadBalancer = value + return b +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *ServiceStatusApplyConfiguration) WithConditions(values ...*metav1.ConditionApplyConfiguration) *ServiceStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/sessionaffinityconfig.go b/pkg/generated/applyconfigurations/core/v1/sessionaffinityconfig.go new file mode 100644 index 00000000000..9c389d97d11 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/sessionaffinityconfig.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SessionAffinityConfigApplyConfiguration represents an declarative configuration of the SessionAffinityConfig type for use +// with apply. +type SessionAffinityConfigApplyConfiguration struct { + ClientIP *ClientIPConfigApplyConfiguration `json:"clientIP,omitempty"` +} + +// SessionAffinityConfigApplyConfiguration constructs an declarative configuration of the SessionAffinityConfig type for use with +// apply. +func SessionAffinityConfig() *SessionAffinityConfigApplyConfiguration { + return &SessionAffinityConfigApplyConfiguration{} +} + +// WithClientIP sets the ClientIP field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClientIP field is set to the value of the last call. +func (b *SessionAffinityConfigApplyConfiguration) WithClientIP(value *ClientIPConfigApplyConfiguration) *SessionAffinityConfigApplyConfiguration { + b.ClientIP = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/sleepaction.go b/pkg/generated/applyconfigurations/core/v1/sleepaction.go new file mode 100644 index 00000000000..c1026b0e914 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/sleepaction.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SleepActionApplyConfiguration represents an declarative configuration of the SleepAction type for use +// with apply. +type SleepActionApplyConfiguration struct { + Seconds *int64 `json:"seconds,omitempty"` +} + +// SleepActionApplyConfiguration constructs an declarative configuration of the SleepAction type for use with +// apply. +func SleepAction() *SleepActionApplyConfiguration { + return &SleepActionApplyConfiguration{} +} + +// WithSeconds sets the Seconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Seconds field is set to the value of the last call. +func (b *SleepActionApplyConfiguration) WithSeconds(value int64) *SleepActionApplyConfiguration { + b.Seconds = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/storageospersistentvolumesource.go b/pkg/generated/applyconfigurations/core/v1/storageospersistentvolumesource.go new file mode 100644 index 00000000000..734f5d41fea --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/storageospersistentvolumesource.go @@ -0,0 +1,64 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// StorageOSPersistentVolumeSourceApplyConfiguration represents an declarative configuration of the StorageOSPersistentVolumeSource type for use +// with apply. +type StorageOSPersistentVolumeSourceApplyConfiguration struct { + VolumeName *string `json:"volumeName,omitempty"` + VolumeNamespace *string `json:"volumeNamespace,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *ObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` +} + +// StorageOSPersistentVolumeSourceApplyConfiguration constructs an declarative configuration of the StorageOSPersistentVolumeSource type for use with +// apply. +func StorageOSPersistentVolumeSource() *StorageOSPersistentVolumeSourceApplyConfiguration { + return &StorageOSPersistentVolumeSourceApplyConfiguration{} +} + +// WithVolumeName sets the VolumeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeName field is set to the value of the last call. +func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithVolumeName(value string) *StorageOSPersistentVolumeSourceApplyConfiguration { + b.VolumeName = &value + return b +} + +// WithVolumeNamespace sets the VolumeNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeNamespace field is set to the value of the last call. +func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithVolumeNamespace(value string) *StorageOSPersistentVolumeSourceApplyConfiguration { + b.VolumeNamespace = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithFSType(value string) *StorageOSPersistentVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithReadOnly(value bool) *StorageOSPersistentVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *StorageOSPersistentVolumeSourceApplyConfiguration) WithSecretRef(value *ObjectReferenceApplyConfiguration) *StorageOSPersistentVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/storageosvolumesource.go b/pkg/generated/applyconfigurations/core/v1/storageosvolumesource.go new file mode 100644 index 00000000000..a0e898db477 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/storageosvolumesource.go @@ -0,0 +1,64 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// StorageOSVolumeSourceApplyConfiguration represents an declarative configuration of the StorageOSVolumeSource type for use +// with apply. +type StorageOSVolumeSourceApplyConfiguration struct { + VolumeName *string `json:"volumeName,omitempty"` + VolumeNamespace *string `json:"volumeNamespace,omitempty"` + FSType *string `json:"fsType,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + SecretRef *LocalObjectReferenceApplyConfiguration `json:"secretRef,omitempty"` +} + +// StorageOSVolumeSourceApplyConfiguration constructs an declarative configuration of the StorageOSVolumeSource type for use with +// apply. +func StorageOSVolumeSource() *StorageOSVolumeSourceApplyConfiguration { + return &StorageOSVolumeSourceApplyConfiguration{} +} + +// WithVolumeName sets the VolumeName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeName field is set to the value of the last call. +func (b *StorageOSVolumeSourceApplyConfiguration) WithVolumeName(value string) *StorageOSVolumeSourceApplyConfiguration { + b.VolumeName = &value + return b +} + +// WithVolumeNamespace sets the VolumeNamespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumeNamespace field is set to the value of the last call. +func (b *StorageOSVolumeSourceApplyConfiguration) WithVolumeNamespace(value string) *StorageOSVolumeSourceApplyConfiguration { + b.VolumeNamespace = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *StorageOSVolumeSourceApplyConfiguration) WithFSType(value string) *StorageOSVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *StorageOSVolumeSourceApplyConfiguration) WithReadOnly(value bool) *StorageOSVolumeSourceApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithSecretRef sets the SecretRef field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SecretRef field is set to the value of the last call. +func (b *StorageOSVolumeSourceApplyConfiguration) WithSecretRef(value *LocalObjectReferenceApplyConfiguration) *StorageOSVolumeSourceApplyConfiguration { + b.SecretRef = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/sysctl.go b/pkg/generated/applyconfigurations/core/v1/sysctl.go new file mode 100644 index 00000000000..426cd81f938 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/sysctl.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// SysctlApplyConfiguration represents an declarative configuration of the Sysctl type for use +// with apply. +type SysctlApplyConfiguration struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// SysctlApplyConfiguration constructs an declarative configuration of the Sysctl type for use with +// apply. +func Sysctl() *SysctlApplyConfiguration { + return &SysctlApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *SysctlApplyConfiguration) WithName(value string) *SysctlApplyConfiguration { + b.Name = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *SysctlApplyConfiguration) WithValue(value string) *SysctlApplyConfiguration { + b.Value = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/taint.go b/pkg/generated/applyconfigurations/core/v1/taint.go new file mode 100644 index 00000000000..6ffbd3b9784 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/taint.go @@ -0,0 +1,60 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// TaintApplyConfiguration represents an declarative configuration of the Taint type for use +// with apply. +type TaintApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Value *string `json:"value,omitempty"` + Effect *v1.TaintEffect `json:"effect,omitempty"` + TimeAdded *metav1.Time `json:"timeAdded,omitempty"` +} + +// TaintApplyConfiguration constructs an declarative configuration of the Taint type for use with +// apply. +func Taint() *TaintApplyConfiguration { + return &TaintApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *TaintApplyConfiguration) WithKey(value string) *TaintApplyConfiguration { + b.Key = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *TaintApplyConfiguration) WithValue(value string) *TaintApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *TaintApplyConfiguration) WithEffect(value v1.TaintEffect) *TaintApplyConfiguration { + b.Effect = &value + return b +} + +// WithTimeAdded sets the TimeAdded field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TimeAdded field is set to the value of the last call. +func (b *TaintApplyConfiguration) WithTimeAdded(value metav1.Time) *TaintApplyConfiguration { + b.TimeAdded = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/tcpsocketaction.go b/pkg/generated/applyconfigurations/core/v1/tcpsocketaction.go new file mode 100644 index 00000000000..b064093f229 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/tcpsocketaction.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + intstr "k8s.io/apimachinery/pkg/util/intstr" +) + +// TCPSocketActionApplyConfiguration represents an declarative configuration of the TCPSocketAction type for use +// with apply. +type TCPSocketActionApplyConfiguration struct { + Port *intstr.IntOrString `json:"port,omitempty"` + Host *string `json:"host,omitempty"` +} + +// TCPSocketActionApplyConfiguration constructs an declarative configuration of the TCPSocketAction type for use with +// apply. +func TCPSocketAction() *TCPSocketActionApplyConfiguration { + return &TCPSocketActionApplyConfiguration{} +} + +// WithPort sets the Port field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Port field is set to the value of the last call. +func (b *TCPSocketActionApplyConfiguration) WithPort(value intstr.IntOrString) *TCPSocketActionApplyConfiguration { + b.Port = &value + return b +} + +// WithHost sets the Host field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Host field is set to the value of the last call. +func (b *TCPSocketActionApplyConfiguration) WithHost(value string) *TCPSocketActionApplyConfiguration { + b.Host = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/toleration.go b/pkg/generated/applyconfigurations/core/v1/toleration.go new file mode 100644 index 00000000000..2d889161b54 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/toleration.go @@ -0,0 +1,68 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// TolerationApplyConfiguration represents an declarative configuration of the Toleration type for use +// with apply. +type TolerationApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *v1.TolerationOperator `json:"operator,omitempty"` + Value *string `json:"value,omitempty"` + Effect *v1.TaintEffect `json:"effect,omitempty"` + TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"` +} + +// TolerationApplyConfiguration constructs an declarative configuration of the Toleration type for use with +// apply. +func Toleration() *TolerationApplyConfiguration { + return &TolerationApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *TolerationApplyConfiguration) WithKey(value string) *TolerationApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *TolerationApplyConfiguration) WithOperator(value v1.TolerationOperator) *TolerationApplyConfiguration { + b.Operator = &value + return b +} + +// WithValue sets the Value field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Value field is set to the value of the last call. +func (b *TolerationApplyConfiguration) WithValue(value string) *TolerationApplyConfiguration { + b.Value = &value + return b +} + +// WithEffect sets the Effect field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Effect field is set to the value of the last call. +func (b *TolerationApplyConfiguration) WithEffect(value v1.TaintEffect) *TolerationApplyConfiguration { + b.Effect = &value + return b +} + +// WithTolerationSeconds sets the TolerationSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TolerationSeconds field is set to the value of the last call. +func (b *TolerationApplyConfiguration) WithTolerationSeconds(value int64) *TolerationApplyConfiguration { + b.TolerationSeconds = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/topologyspreadconstraint.go b/pkg/generated/applyconfigurations/core/v1/topologyspreadconstraint.go new file mode 100644 index 00000000000..6763054ba77 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/topologyspreadconstraint.go @@ -0,0 +1,98 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + v1 "k8s.io/api/core/v1" +) + +// TopologySpreadConstraintApplyConfiguration represents an declarative configuration of the TopologySpreadConstraint type for use +// with apply. +type TopologySpreadConstraintApplyConfiguration struct { + MaxSkew *int32 `json:"maxSkew,omitempty"` + TopologyKey *string `json:"topologyKey,omitempty"` + WhenUnsatisfiable *v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable,omitempty"` + LabelSelector *metav1.LabelSelectorApplyConfiguration `json:"labelSelector,omitempty"` + MinDomains *int32 `json:"minDomains,omitempty"` + NodeAffinityPolicy *v1.NodeInclusionPolicy `json:"nodeAffinityPolicy,omitempty"` + NodeTaintsPolicy *v1.NodeInclusionPolicy `json:"nodeTaintsPolicy,omitempty"` + MatchLabelKeys []string `json:"matchLabelKeys,omitempty"` +} + +// TopologySpreadConstraintApplyConfiguration constructs an declarative configuration of the TopologySpreadConstraint type for use with +// apply. +func TopologySpreadConstraint() *TopologySpreadConstraintApplyConfiguration { + return &TopologySpreadConstraintApplyConfiguration{} +} + +// WithMaxSkew sets the MaxSkew field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MaxSkew field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithMaxSkew(value int32) *TopologySpreadConstraintApplyConfiguration { + b.MaxSkew = &value + return b +} + +// WithTopologyKey sets the TopologyKey field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the TopologyKey field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithTopologyKey(value string) *TopologySpreadConstraintApplyConfiguration { + b.TopologyKey = &value + return b +} + +// WithWhenUnsatisfiable sets the WhenUnsatisfiable field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the WhenUnsatisfiable field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithWhenUnsatisfiable(value v1.UnsatisfiableConstraintAction) *TopologySpreadConstraintApplyConfiguration { + b.WhenUnsatisfiable = &value + return b +} + +// WithLabelSelector sets the LabelSelector field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LabelSelector field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithLabelSelector(value *metav1.LabelSelectorApplyConfiguration) *TopologySpreadConstraintApplyConfiguration { + b.LabelSelector = value + return b +} + +// WithMinDomains sets the MinDomains field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MinDomains field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithMinDomains(value int32) *TopologySpreadConstraintApplyConfiguration { + b.MinDomains = &value + return b +} + +// WithNodeAffinityPolicy sets the NodeAffinityPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeAffinityPolicy field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithNodeAffinityPolicy(value v1.NodeInclusionPolicy) *TopologySpreadConstraintApplyConfiguration { + b.NodeAffinityPolicy = &value + return b +} + +// WithNodeTaintsPolicy sets the NodeTaintsPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NodeTaintsPolicy field is set to the value of the last call. +func (b *TopologySpreadConstraintApplyConfiguration) WithNodeTaintsPolicy(value v1.NodeInclusionPolicy) *TopologySpreadConstraintApplyConfiguration { + b.NodeTaintsPolicy = &value + return b +} + +// WithMatchLabelKeys adds the given value to the MatchLabelKeys field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchLabelKeys field. +func (b *TopologySpreadConstraintApplyConfiguration) WithMatchLabelKeys(values ...string) *TopologySpreadConstraintApplyConfiguration { + for i := range values { + b.MatchLabelKeys = append(b.MatchLabelKeys, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/typedlocalobjectreference.go b/pkg/generated/applyconfigurations/core/v1/typedlocalobjectreference.go new file mode 100644 index 00000000000..7f5a6f70a6f --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/typedlocalobjectreference.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// TypedLocalObjectReferenceApplyConfiguration represents an declarative configuration of the TypedLocalObjectReference type for use +// with apply. +type TypedLocalObjectReferenceApplyConfiguration struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` +} + +// TypedLocalObjectReferenceApplyConfiguration constructs an declarative configuration of the TypedLocalObjectReference type for use with +// apply. +func TypedLocalObjectReference() *TypedLocalObjectReferenceApplyConfiguration { + return &TypedLocalObjectReferenceApplyConfiguration{} +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *TypedLocalObjectReferenceApplyConfiguration) WithAPIGroup(value string) *TypedLocalObjectReferenceApplyConfiguration { + b.APIGroup = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TypedLocalObjectReferenceApplyConfiguration) WithKind(value string) *TypedLocalObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TypedLocalObjectReferenceApplyConfiguration) WithName(value string) *TypedLocalObjectReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/typedobjectreference.go b/pkg/generated/applyconfigurations/core/v1/typedobjectreference.go new file mode 100644 index 00000000000..276b5e9c865 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/typedobjectreference.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// TypedObjectReferenceApplyConfiguration represents an declarative configuration of the TypedObjectReference type for use +// with apply. +type TypedObjectReferenceApplyConfiguration struct { + APIGroup *string `json:"apiGroup,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Namespace *string `json:"namespace,omitempty"` +} + +// TypedObjectReferenceApplyConfiguration constructs an declarative configuration of the TypedObjectReference type for use with +// apply. +func TypedObjectReference() *TypedObjectReferenceApplyConfiguration { + return &TypedObjectReferenceApplyConfiguration{} +} + +// WithAPIGroup sets the APIGroup field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIGroup field is set to the value of the last call. +func (b *TypedObjectReferenceApplyConfiguration) WithAPIGroup(value string) *TypedObjectReferenceApplyConfiguration { + b.APIGroup = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TypedObjectReferenceApplyConfiguration) WithKind(value string) *TypedObjectReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *TypedObjectReferenceApplyConfiguration) WithName(value string) *TypedObjectReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *TypedObjectReferenceApplyConfiguration) WithNamespace(value string) *TypedObjectReferenceApplyConfiguration { + b.Namespace = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volume.go b/pkg/generated/applyconfigurations/core/v1/volume.go new file mode 100644 index 00000000000..7b5f2a7ea15 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volume.go @@ -0,0 +1,261 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// VolumeApplyConfiguration represents an declarative configuration of the Volume type for use +// with apply. +type VolumeApplyConfiguration struct { + Name *string `json:"name,omitempty"` + VolumeSourceApplyConfiguration `json:",inline"` +} + +// VolumeApplyConfiguration constructs an declarative configuration of the Volume type for use with +// apply. +func Volume() *VolumeApplyConfiguration { + return &VolumeApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithName(value string) *VolumeApplyConfiguration { + b.Name = &value + return b +} + +// WithHostPath sets the HostPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPath field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.HostPath = value + return b +} + +// WithEmptyDir sets the EmptyDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EmptyDir field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithEmptyDir(value *EmptyDirVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.EmptyDir = value + return b +} + +// WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GCEPersistentDisk field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.GCEPersistentDisk = value + return b +} + +// WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.AWSElasticBlockStore = value + return b +} + +// WithGitRepo sets the GitRepo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GitRepo field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithGitRepo(value *GitRepoVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.GitRepo = value + return b +} + +// WithSecret sets the Secret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Secret field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithSecret(value *SecretVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Secret = value + return b +} + +// WithNFS sets the NFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NFS field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.NFS = value + return b +} + +// WithISCSI sets the ISCSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ISCSI field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithISCSI(value *ISCSIVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.ISCSI = value + return b +} + +// WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Glusterfs field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithGlusterfs(value *GlusterfsVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Glusterfs = value + return b +} + +// WithPersistentVolumeClaim sets the PersistentVolumeClaim field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PersistentVolumeClaim field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithPersistentVolumeClaim(value *PersistentVolumeClaimVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.PersistentVolumeClaim = value + return b +} + +// WithRBD sets the RBD field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBD field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithRBD(value *RBDVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.RBD = value + return b +} + +// WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FlexVolume field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithFlexVolume(value *FlexVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.FlexVolume = value + return b +} + +// WithCinder sets the Cinder field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cinder field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithCinder(value *CinderVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Cinder = value + return b +} + +// WithCephFS sets the CephFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CephFS field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithCephFS(value *CephFSVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.CephFS = value + return b +} + +// WithFlocker sets the Flocker field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Flocker field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Flocker = value + return b +} + +// WithDownwardAPI sets the DownwardAPI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DownwardAPI field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithDownwardAPI(value *DownwardAPIVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.DownwardAPI = value + return b +} + +// WithFC sets the FC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FC field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.FC = value + return b +} + +// WithAzureFile sets the AzureFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureFile field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithAzureFile(value *AzureFileVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.AzureFile = value + return b +} + +// WithConfigMap sets the ConfigMap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMap field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithConfigMap(value *ConfigMapVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.ConfigMap = value + return b +} + +// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VsphereVolume field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.VsphereVolume = value + return b +} + +// WithQuobyte sets the Quobyte field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Quobyte field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Quobyte = value + return b +} + +// WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureDisk field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.AzureDisk = value + return b +} + +// WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.PhotonPersistentDisk = value + return b +} + +// WithProjected sets the Projected field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Projected field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithProjected(value *ProjectedVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Projected = value + return b +} + +// WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortworxVolume field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.PortworxVolume = value + return b +} + +// WithScaleIO sets the ScaleIO field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScaleIO field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithScaleIO(value *ScaleIOVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.ScaleIO = value + return b +} + +// WithStorageOS sets the StorageOS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageOS field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithStorageOS(value *StorageOSVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.StorageOS = value + return b +} + +// WithCSI sets the CSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CSI field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithCSI(value *CSIVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.CSI = value + return b +} + +// WithEphemeral sets the Ephemeral field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ephemeral field is set to the value of the last call. +func (b *VolumeApplyConfiguration) WithEphemeral(value *EphemeralVolumeSourceApplyConfiguration) *VolumeApplyConfiguration { + b.Ephemeral = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumedevice.go b/pkg/generated/applyconfigurations/core/v1/volumedevice.go new file mode 100644 index 00000000000..69ce7e9b755 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumedevice.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// VolumeDeviceApplyConfiguration represents an declarative configuration of the VolumeDevice type for use +// with apply. +type VolumeDeviceApplyConfiguration struct { + Name *string `json:"name,omitempty"` + DevicePath *string `json:"devicePath,omitempty"` +} + +// VolumeDeviceApplyConfiguration constructs an declarative configuration of the VolumeDevice type for use with +// apply. +func VolumeDevice() *VolumeDeviceApplyConfiguration { + return &VolumeDeviceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *VolumeDeviceApplyConfiguration) WithName(value string) *VolumeDeviceApplyConfiguration { + b.Name = &value + return b +} + +// WithDevicePath sets the DevicePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DevicePath field is set to the value of the last call. +func (b *VolumeDeviceApplyConfiguration) WithDevicePath(value string) *VolumeDeviceApplyConfiguration { + b.DevicePath = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumemount.go b/pkg/generated/applyconfigurations/core/v1/volumemount.go new file mode 100644 index 00000000000..a7c665a2cc6 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumemount.go @@ -0,0 +1,86 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// VolumeMountApplyConfiguration represents an declarative configuration of the VolumeMount type for use +// with apply. +type VolumeMountApplyConfiguration struct { + Name *string `json:"name,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` + MountPath *string `json:"mountPath,omitempty"` + SubPath *string `json:"subPath,omitempty"` + MountPropagation *v1.MountPropagationMode `json:"mountPropagation,omitempty"` + SubPathExpr *string `json:"subPathExpr,omitempty"` +} + +// VolumeMountApplyConfiguration constructs an declarative configuration of the VolumeMount type for use with +// apply. +func VolumeMount() *VolumeMountApplyConfiguration { + return &VolumeMountApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithName(value string) *VolumeMountApplyConfiguration { + b.Name = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithReadOnly(value bool) *VolumeMountApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithRecursiveReadOnly sets the RecursiveReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RecursiveReadOnly field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountApplyConfiguration { + b.RecursiveReadOnly = &value + return b +} + +// WithMountPath sets the MountPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MountPath field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithMountPath(value string) *VolumeMountApplyConfiguration { + b.MountPath = &value + return b +} + +// WithSubPath sets the SubPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SubPath field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithSubPath(value string) *VolumeMountApplyConfiguration { + b.SubPath = &value + return b +} + +// WithMountPropagation sets the MountPropagation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MountPropagation field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithMountPropagation(value v1.MountPropagationMode) *VolumeMountApplyConfiguration { + b.MountPropagation = &value + return b +} + +// WithSubPathExpr sets the SubPathExpr field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the SubPathExpr field is set to the value of the last call. +func (b *VolumeMountApplyConfiguration) WithSubPathExpr(value string) *VolumeMountApplyConfiguration { + b.SubPathExpr = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumemountstatus.go b/pkg/generated/applyconfigurations/core/v1/volumemountstatus.go new file mode 100644 index 00000000000..cdc7ff87612 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumemountstatus.go @@ -0,0 +1,59 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// VolumeMountStatusApplyConfiguration represents an declarative configuration of the VolumeMountStatus type for use +// with apply. +type VolumeMountStatusApplyConfiguration struct { + Name *string `json:"name,omitempty"` + MountPath *string `json:"mountPath,omitempty"` + ReadOnly *bool `json:"readOnly,omitempty"` + RecursiveReadOnly *v1.RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty"` +} + +// VolumeMountStatusApplyConfiguration constructs an declarative configuration of the VolumeMountStatus type for use with +// apply. +func VolumeMountStatus() *VolumeMountStatusApplyConfiguration { + return &VolumeMountStatusApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithName(value string) *VolumeMountStatusApplyConfiguration { + b.Name = &value + return b +} + +// WithMountPath sets the MountPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MountPath field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithMountPath(value string) *VolumeMountStatusApplyConfiguration { + b.MountPath = &value + return b +} + +// WithReadOnly sets the ReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ReadOnly field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithReadOnly(value bool) *VolumeMountStatusApplyConfiguration { + b.ReadOnly = &value + return b +} + +// WithRecursiveReadOnly sets the RecursiveReadOnly field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RecursiveReadOnly field is set to the value of the last call. +func (b *VolumeMountStatusApplyConfiguration) WithRecursiveReadOnly(value v1.RecursiveReadOnlyMode) *VolumeMountStatusApplyConfiguration { + b.RecursiveReadOnly = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumenodeaffinity.go b/pkg/generated/applyconfigurations/core/v1/volumenodeaffinity.go new file mode 100644 index 00000000000..034159f2d72 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumenodeaffinity.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// VolumeNodeAffinityApplyConfiguration represents an declarative configuration of the VolumeNodeAffinity type for use +// with apply. +type VolumeNodeAffinityApplyConfiguration struct { + Required *NodeSelectorApplyConfiguration `json:"required,omitempty"` +} + +// VolumeNodeAffinityApplyConfiguration constructs an declarative configuration of the VolumeNodeAffinity type for use with +// apply. +func VolumeNodeAffinity() *VolumeNodeAffinityApplyConfiguration { + return &VolumeNodeAffinityApplyConfiguration{} +} + +// WithRequired sets the Required field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Required field is set to the value of the last call. +func (b *VolumeNodeAffinityApplyConfiguration) WithRequired(value *NodeSelectorApplyConfiguration) *VolumeNodeAffinityApplyConfiguration { + b.Required = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumeprojection.go b/pkg/generated/applyconfigurations/core/v1/volumeprojection.go new file mode 100644 index 00000000000..75ed3b1612e --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumeprojection.go @@ -0,0 +1,64 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// VolumeProjectionApplyConfiguration represents an declarative configuration of the VolumeProjection type for use +// with apply. +type VolumeProjectionApplyConfiguration struct { + Secret *SecretProjectionApplyConfiguration `json:"secret,omitempty"` + DownwardAPI *DownwardAPIProjectionApplyConfiguration `json:"downwardAPI,omitempty"` + ConfigMap *ConfigMapProjectionApplyConfiguration `json:"configMap,omitempty"` + ServiceAccountToken *ServiceAccountTokenProjectionApplyConfiguration `json:"serviceAccountToken,omitempty"` + ClusterTrustBundle *ClusterTrustBundleProjectionApplyConfiguration `json:"clusterTrustBundle,omitempty"` +} + +// VolumeProjectionApplyConfiguration constructs an declarative configuration of the VolumeProjection type for use with +// apply. +func VolumeProjection() *VolumeProjectionApplyConfiguration { + return &VolumeProjectionApplyConfiguration{} +} + +// WithSecret sets the Secret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Secret field is set to the value of the last call. +func (b *VolumeProjectionApplyConfiguration) WithSecret(value *SecretProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { + b.Secret = value + return b +} + +// WithDownwardAPI sets the DownwardAPI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DownwardAPI field is set to the value of the last call. +func (b *VolumeProjectionApplyConfiguration) WithDownwardAPI(value *DownwardAPIProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { + b.DownwardAPI = value + return b +} + +// WithConfigMap sets the ConfigMap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMap field is set to the value of the last call. +func (b *VolumeProjectionApplyConfiguration) WithConfigMap(value *ConfigMapProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { + b.ConfigMap = value + return b +} + +// WithServiceAccountToken sets the ServiceAccountToken field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccountToken field is set to the value of the last call. +func (b *VolumeProjectionApplyConfiguration) WithServiceAccountToken(value *ServiceAccountTokenProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { + b.ServiceAccountToken = value + return b +} + +// WithClusterTrustBundle sets the ClusterTrustBundle field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterTrustBundle field is set to the value of the last call. +func (b *VolumeProjectionApplyConfiguration) WithClusterTrustBundle(value *ClusterTrustBundleProjectionApplyConfiguration) *VolumeProjectionApplyConfiguration { + b.ClusterTrustBundle = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumeresourcerequirements.go b/pkg/generated/applyconfigurations/core/v1/volumeresourcerequirements.go new file mode 100644 index 00000000000..b5f69455ce6 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumeresourcerequirements.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/core/v1" +) + +// VolumeResourceRequirementsApplyConfiguration represents an declarative configuration of the VolumeResourceRequirements type for use +// with apply. +type VolumeResourceRequirementsApplyConfiguration struct { + Limits *v1.ResourceList `json:"limits,omitempty"` + Requests *v1.ResourceList `json:"requests,omitempty"` +} + +// VolumeResourceRequirementsApplyConfiguration constructs an declarative configuration of the VolumeResourceRequirements type for use with +// apply. +func VolumeResourceRequirements() *VolumeResourceRequirementsApplyConfiguration { + return &VolumeResourceRequirementsApplyConfiguration{} +} + +// WithLimits sets the Limits field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Limits field is set to the value of the last call. +func (b *VolumeResourceRequirementsApplyConfiguration) WithLimits(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { + b.Limits = &value + return b +} + +// WithRequests sets the Requests field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Requests field is set to the value of the last call. +func (b *VolumeResourceRequirementsApplyConfiguration) WithRequests(value v1.ResourceList) *VolumeResourceRequirementsApplyConfiguration { + b.Requests = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/volumesource.go b/pkg/generated/applyconfigurations/core/v1/volumesource.go new file mode 100644 index 00000000000..923cfd6c6ae --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/volumesource.go @@ -0,0 +1,280 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// VolumeSourceApplyConfiguration represents an declarative configuration of the VolumeSource type for use +// with apply. +type VolumeSourceApplyConfiguration struct { + HostPath *HostPathVolumeSourceApplyConfiguration `json:"hostPath,omitempty"` + EmptyDir *EmptyDirVolumeSourceApplyConfiguration `json:"emptyDir,omitempty"` + GCEPersistentDisk *GCEPersistentDiskVolumeSourceApplyConfiguration `json:"gcePersistentDisk,omitempty"` + AWSElasticBlockStore *AWSElasticBlockStoreVolumeSourceApplyConfiguration `json:"awsElasticBlockStore,omitempty"` + GitRepo *GitRepoVolumeSourceApplyConfiguration `json:"gitRepo,omitempty"` + Secret *SecretVolumeSourceApplyConfiguration `json:"secret,omitempty"` + NFS *NFSVolumeSourceApplyConfiguration `json:"nfs,omitempty"` + ISCSI *ISCSIVolumeSourceApplyConfiguration `json:"iscsi,omitempty"` + Glusterfs *GlusterfsVolumeSourceApplyConfiguration `json:"glusterfs,omitempty"` + PersistentVolumeClaim *PersistentVolumeClaimVolumeSourceApplyConfiguration `json:"persistentVolumeClaim,omitempty"` + RBD *RBDVolumeSourceApplyConfiguration `json:"rbd,omitempty"` + FlexVolume *FlexVolumeSourceApplyConfiguration `json:"flexVolume,omitempty"` + Cinder *CinderVolumeSourceApplyConfiguration `json:"cinder,omitempty"` + CephFS *CephFSVolumeSourceApplyConfiguration `json:"cephfs,omitempty"` + Flocker *FlockerVolumeSourceApplyConfiguration `json:"flocker,omitempty"` + DownwardAPI *DownwardAPIVolumeSourceApplyConfiguration `json:"downwardAPI,omitempty"` + FC *FCVolumeSourceApplyConfiguration `json:"fc,omitempty"` + AzureFile *AzureFileVolumeSourceApplyConfiguration `json:"azureFile,omitempty"` + ConfigMap *ConfigMapVolumeSourceApplyConfiguration `json:"configMap,omitempty"` + VsphereVolume *VsphereVirtualDiskVolumeSourceApplyConfiguration `json:"vsphereVolume,omitempty"` + Quobyte *QuobyteVolumeSourceApplyConfiguration `json:"quobyte,omitempty"` + AzureDisk *AzureDiskVolumeSourceApplyConfiguration `json:"azureDisk,omitempty"` + PhotonPersistentDisk *PhotonPersistentDiskVolumeSourceApplyConfiguration `json:"photonPersistentDisk,omitempty"` + Projected *ProjectedVolumeSourceApplyConfiguration `json:"projected,omitempty"` + PortworxVolume *PortworxVolumeSourceApplyConfiguration `json:"portworxVolume,omitempty"` + ScaleIO *ScaleIOVolumeSourceApplyConfiguration `json:"scaleIO,omitempty"` + StorageOS *StorageOSVolumeSourceApplyConfiguration `json:"storageos,omitempty"` + CSI *CSIVolumeSourceApplyConfiguration `json:"csi,omitempty"` + Ephemeral *EphemeralVolumeSourceApplyConfiguration `json:"ephemeral,omitempty"` +} + +// VolumeSourceApplyConfiguration constructs an declarative configuration of the VolumeSource type for use with +// apply. +func VolumeSource() *VolumeSourceApplyConfiguration { + return &VolumeSourceApplyConfiguration{} +} + +// WithHostPath sets the HostPath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostPath field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithHostPath(value *HostPathVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.HostPath = value + return b +} + +// WithEmptyDir sets the EmptyDir field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the EmptyDir field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithEmptyDir(value *EmptyDirVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.EmptyDir = value + return b +} + +// WithGCEPersistentDisk sets the GCEPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GCEPersistentDisk field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithGCEPersistentDisk(value *GCEPersistentDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.GCEPersistentDisk = value + return b +} + +// WithAWSElasticBlockStore sets the AWSElasticBlockStore field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AWSElasticBlockStore field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithAWSElasticBlockStore(value *AWSElasticBlockStoreVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.AWSElasticBlockStore = value + return b +} + +// WithGitRepo sets the GitRepo field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GitRepo field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithGitRepo(value *GitRepoVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.GitRepo = value + return b +} + +// WithSecret sets the Secret field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Secret field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithSecret(value *SecretVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Secret = value + return b +} + +// WithNFS sets the NFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NFS field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithNFS(value *NFSVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.NFS = value + return b +} + +// WithISCSI sets the ISCSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ISCSI field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithISCSI(value *ISCSIVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.ISCSI = value + return b +} + +// WithGlusterfs sets the Glusterfs field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Glusterfs field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithGlusterfs(value *GlusterfsVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Glusterfs = value + return b +} + +// WithPersistentVolumeClaim sets the PersistentVolumeClaim field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PersistentVolumeClaim field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithPersistentVolumeClaim(value *PersistentVolumeClaimVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.PersistentVolumeClaim = value + return b +} + +// WithRBD sets the RBD field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RBD field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithRBD(value *RBDVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.RBD = value + return b +} + +// WithFlexVolume sets the FlexVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FlexVolume field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithFlexVolume(value *FlexVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.FlexVolume = value + return b +} + +// WithCinder sets the Cinder field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Cinder field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithCinder(value *CinderVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Cinder = value + return b +} + +// WithCephFS sets the CephFS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CephFS field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithCephFS(value *CephFSVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.CephFS = value + return b +} + +// WithFlocker sets the Flocker field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Flocker field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithFlocker(value *FlockerVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Flocker = value + return b +} + +// WithDownwardAPI sets the DownwardAPI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DownwardAPI field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithDownwardAPI(value *DownwardAPIVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.DownwardAPI = value + return b +} + +// WithFC sets the FC field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FC field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithFC(value *FCVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.FC = value + return b +} + +// WithAzureFile sets the AzureFile field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureFile field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithAzureFile(value *AzureFileVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.AzureFile = value + return b +} + +// WithConfigMap sets the ConfigMap field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ConfigMap field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithConfigMap(value *ConfigMapVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.ConfigMap = value + return b +} + +// WithVsphereVolume sets the VsphereVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VsphereVolume field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithVsphereVolume(value *VsphereVirtualDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.VsphereVolume = value + return b +} + +// WithQuobyte sets the Quobyte field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Quobyte field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithQuobyte(value *QuobyteVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Quobyte = value + return b +} + +// WithAzureDisk sets the AzureDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the AzureDisk field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithAzureDisk(value *AzureDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.AzureDisk = value + return b +} + +// WithPhotonPersistentDisk sets the PhotonPersistentDisk field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PhotonPersistentDisk field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithPhotonPersistentDisk(value *PhotonPersistentDiskVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.PhotonPersistentDisk = value + return b +} + +// WithProjected sets the Projected field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Projected field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithProjected(value *ProjectedVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Projected = value + return b +} + +// WithPortworxVolume sets the PortworxVolume field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PortworxVolume field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithPortworxVolume(value *PortworxVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.PortworxVolume = value + return b +} + +// WithScaleIO sets the ScaleIO field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ScaleIO field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithScaleIO(value *ScaleIOVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.ScaleIO = value + return b +} + +// WithStorageOS sets the StorageOS field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StorageOS field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithStorageOS(value *StorageOSVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.StorageOS = value + return b +} + +// WithCSI sets the CSI field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CSI field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithCSI(value *CSIVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.CSI = value + return b +} + +// WithEphemeral sets the Ephemeral field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Ephemeral field is set to the value of the last call. +func (b *VolumeSourceApplyConfiguration) WithEphemeral(value *EphemeralVolumeSourceApplyConfiguration) *VolumeSourceApplyConfiguration { + b.Ephemeral = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go b/pkg/generated/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go new file mode 100644 index 00000000000..2e9ee2ec4c6 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/vspherevirtualdiskvolumesource.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// VsphereVirtualDiskVolumeSourceApplyConfiguration represents an declarative configuration of the VsphereVirtualDiskVolumeSource type for use +// with apply. +type VsphereVirtualDiskVolumeSourceApplyConfiguration struct { + VolumePath *string `json:"volumePath,omitempty"` + FSType *string `json:"fsType,omitempty"` + StoragePolicyName *string `json:"storagePolicyName,omitempty"` + StoragePolicyID *string `json:"storagePolicyID,omitempty"` +} + +// VsphereVirtualDiskVolumeSourceApplyConfiguration constructs an declarative configuration of the VsphereVirtualDiskVolumeSource type for use with +// apply. +func VsphereVirtualDiskVolumeSource() *VsphereVirtualDiskVolumeSourceApplyConfiguration { + return &VsphereVirtualDiskVolumeSourceApplyConfiguration{} +} + +// WithVolumePath sets the VolumePath field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the VolumePath field is set to the value of the last call. +func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithVolumePath(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { + b.VolumePath = &value + return b +} + +// WithFSType sets the FSType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FSType field is set to the value of the last call. +func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithFSType(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { + b.FSType = &value + return b +} + +// WithStoragePolicyName sets the StoragePolicyName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StoragePolicyName field is set to the value of the last call. +func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithStoragePolicyName(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { + b.StoragePolicyName = &value + return b +} + +// WithStoragePolicyID sets the StoragePolicyID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the StoragePolicyID field is set to the value of the last call. +func (b *VsphereVirtualDiskVolumeSourceApplyConfiguration) WithStoragePolicyID(value string) *VsphereVirtualDiskVolumeSourceApplyConfiguration { + b.StoragePolicyID = &value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/weightedpodaffinityterm.go b/pkg/generated/applyconfigurations/core/v1/weightedpodaffinityterm.go new file mode 100644 index 00000000000..9f8b2114db2 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/weightedpodaffinityterm.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WeightedPodAffinityTermApplyConfiguration represents an declarative configuration of the WeightedPodAffinityTerm type for use +// with apply. +type WeightedPodAffinityTermApplyConfiguration struct { + Weight *int32 `json:"weight,omitempty"` + PodAffinityTerm *PodAffinityTermApplyConfiguration `json:"podAffinityTerm,omitempty"` +} + +// WeightedPodAffinityTermApplyConfiguration constructs an declarative configuration of the WeightedPodAffinityTerm type for use with +// apply. +func WeightedPodAffinityTerm() *WeightedPodAffinityTermApplyConfiguration { + return &WeightedPodAffinityTermApplyConfiguration{} +} + +// WithWeight sets the Weight field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Weight field is set to the value of the last call. +func (b *WeightedPodAffinityTermApplyConfiguration) WithWeight(value int32) *WeightedPodAffinityTermApplyConfiguration { + b.Weight = &value + return b +} + +// WithPodAffinityTerm sets the PodAffinityTerm field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PodAffinityTerm field is set to the value of the last call. +func (b *WeightedPodAffinityTermApplyConfiguration) WithPodAffinityTerm(value *PodAffinityTermApplyConfiguration) *WeightedPodAffinityTermApplyConfiguration { + b.PodAffinityTerm = value + return b +} diff --git a/pkg/generated/applyconfigurations/core/v1/windowssecuritycontextoptions.go b/pkg/generated/applyconfigurations/core/v1/windowssecuritycontextoptions.go new file mode 100644 index 00000000000..0bfe82a4726 --- /dev/null +++ b/pkg/generated/applyconfigurations/core/v1/windowssecuritycontextoptions.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// WindowsSecurityContextOptionsApplyConfiguration represents an declarative configuration of the WindowsSecurityContextOptions type for use +// with apply. +type WindowsSecurityContextOptionsApplyConfiguration struct { + GMSACredentialSpecName *string `json:"gmsaCredentialSpecName,omitempty"` + GMSACredentialSpec *string `json:"gmsaCredentialSpec,omitempty"` + RunAsUserName *string `json:"runAsUserName,omitempty"` + HostProcess *bool `json:"hostProcess,omitempty"` +} + +// WindowsSecurityContextOptionsApplyConfiguration constructs an declarative configuration of the WindowsSecurityContextOptions type for use with +// apply. +func WindowsSecurityContextOptions() *WindowsSecurityContextOptionsApplyConfiguration { + return &WindowsSecurityContextOptionsApplyConfiguration{} +} + +// WithGMSACredentialSpecName sets the GMSACredentialSpecName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GMSACredentialSpecName field is set to the value of the last call. +func (b *WindowsSecurityContextOptionsApplyConfiguration) WithGMSACredentialSpecName(value string) *WindowsSecurityContextOptionsApplyConfiguration { + b.GMSACredentialSpecName = &value + return b +} + +// WithGMSACredentialSpec sets the GMSACredentialSpec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GMSACredentialSpec field is set to the value of the last call. +func (b *WindowsSecurityContextOptionsApplyConfiguration) WithGMSACredentialSpec(value string) *WindowsSecurityContextOptionsApplyConfiguration { + b.GMSACredentialSpec = &value + return b +} + +// WithRunAsUserName sets the RunAsUserName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the RunAsUserName field is set to the value of the last call. +func (b *WindowsSecurityContextOptionsApplyConfiguration) WithRunAsUserName(value string) *WindowsSecurityContextOptionsApplyConfiguration { + b.RunAsUserName = &value + return b +} + +// WithHostProcess sets the HostProcess field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HostProcess field is set to the value of the last call. +func (b *WindowsSecurityContextOptionsApplyConfiguration) WithHostProcess(value bool) *WindowsSecurityContextOptionsApplyConfiguration { + b.HostProcess = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go b/pkg/generated/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go new file mode 100644 index 00000000000..db446d7c551 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/exemptprioritylevelconfiguration.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ExemptPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the ExemptPriorityLevelConfiguration type for use +// with apply. +type ExemptPriorityLevelConfigurationApplyConfiguration struct { + NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` + LendablePercent *int32 `json:"lendablePercent,omitempty"` +} + +// ExemptPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the ExemptPriorityLevelConfiguration type for use with +// apply. +func ExemptPriorityLevelConfiguration() *ExemptPriorityLevelConfigurationApplyConfiguration { + return &ExemptPriorityLevelConfigurationApplyConfiguration{} +} + +// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. +func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { + b.NominalConcurrencyShares = &value + return b +} + +// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LendablePercent field is set to the value of the last call. +func (b *ExemptPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *ExemptPriorityLevelConfigurationApplyConfiguration { + b.LendablePercent = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go b/pkg/generated/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go new file mode 100644 index 00000000000..244d96e7b21 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/flowdistinguishermethod.go @@ -0,0 +1,32 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" +) + +// FlowDistinguisherMethodApplyConfiguration represents an declarative configuration of the FlowDistinguisherMethod type for use +// with apply. +type FlowDistinguisherMethodApplyConfiguration struct { + Type *v1.FlowDistinguisherMethodType `json:"type,omitempty"` +} + +// FlowDistinguisherMethodApplyConfiguration constructs an declarative configuration of the FlowDistinguisherMethod type for use with +// apply. +func FlowDistinguisherMethod() *FlowDistinguisherMethodApplyConfiguration { + return &FlowDistinguisherMethodApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *FlowDistinguisherMethodApplyConfiguration) WithType(value v1.FlowDistinguisherMethodType) *FlowDistinguisherMethodApplyConfiguration { + b.Type = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/flowschema.go b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschema.go new file mode 100644 index 00000000000..fe7bd429e83 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschema.go @@ -0,0 +1,245 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// FlowSchemaApplyConfiguration represents an declarative configuration of the FlowSchema type for use +// with apply. +type FlowSchemaApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *FlowSchemaSpecApplyConfiguration `json:"spec,omitempty"` + Status *FlowSchemaStatusApplyConfiguration `json:"status,omitempty"` +} + +// FlowSchema constructs an declarative configuration of the FlowSchema type for use with +// apply. +func FlowSchema(name string) *FlowSchemaApplyConfiguration { + b := &FlowSchemaApplyConfiguration{} + b.WithName(name) + b.WithKind("FlowSchema") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + return b +} + +// ExtractFlowSchema extracts the applied configuration owned by fieldManager from +// flowSchema. If no managedFields are found in flowSchema for fieldManager, a +// FlowSchemaApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// flowSchema must be a unmodified FlowSchema API object that was retrieved from the Kubernetes API. +// ExtractFlowSchema provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { + return extractFlowSchema(flowSchema, fieldManager, "") +} + +// ExtractFlowSchemaStatus is the same as ExtractFlowSchema except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractFlowSchemaStatus(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string) (*FlowSchemaApplyConfiguration, error) { + return extractFlowSchema(flowSchema, fieldManager, "status") +} + +func extractFlowSchema(flowSchema *apiflowcontrolv1.FlowSchema, fieldManager string, subresource string) (*FlowSchemaApplyConfiguration, error) { + b := &FlowSchemaApplyConfiguration{} + err := managedfields.ExtractInto(flowSchema, internal.Parser().Type("io.k8s.api.flowcontrol.v1.FlowSchema"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(flowSchema.Name) + + b.WithKind("FlowSchema") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithKind(value string) *FlowSchemaApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithAPIVersion(value string) *FlowSchemaApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithName(value string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithGenerateName(value string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithNamespace(value string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithUID(value types.UID) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithResourceVersion(value string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithGeneration(value int64) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithCreationTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *FlowSchemaApplyConfiguration) WithLabels(entries map[string]string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *FlowSchemaApplyConfiguration) WithAnnotations(entries map[string]string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *FlowSchemaApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *FlowSchemaApplyConfiguration) WithFinalizers(values ...string) *FlowSchemaApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *FlowSchemaApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithSpec(value *FlowSchemaSpecApplyConfiguration) *FlowSchemaApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *FlowSchemaApplyConfiguration) WithStatus(value *FlowSchemaStatusApplyConfiguration) *FlowSchemaApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemacondition.go b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemacondition.go new file mode 100644 index 00000000000..98234ebade1 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemacondition.go @@ -0,0 +1,69 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// FlowSchemaConditionApplyConfiguration represents an declarative configuration of the FlowSchemaCondition type for use +// with apply. +type FlowSchemaConditionApplyConfiguration struct { + Type *v1.FlowSchemaConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// FlowSchemaConditionApplyConfiguration constructs an declarative configuration of the FlowSchemaCondition type for use with +// apply. +func FlowSchemaCondition() *FlowSchemaConditionApplyConfiguration { + return &FlowSchemaConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *FlowSchemaConditionApplyConfiguration) WithType(value v1.FlowSchemaConditionType) *FlowSchemaConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *FlowSchemaConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *FlowSchemaConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *FlowSchemaConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *FlowSchemaConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *FlowSchemaConditionApplyConfiguration) WithReason(value string) *FlowSchemaConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *FlowSchemaConditionApplyConfiguration) WithMessage(value string) *FlowSchemaConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemaspec.go b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemaspec.go new file mode 100644 index 00000000000..2c3e296b482 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemaspec.go @@ -0,0 +1,60 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FlowSchemaSpecApplyConfiguration represents an declarative configuration of the FlowSchemaSpec type for use +// with apply. +type FlowSchemaSpecApplyConfiguration struct { + PriorityLevelConfiguration *PriorityLevelConfigurationReferenceApplyConfiguration `json:"priorityLevelConfiguration,omitempty"` + MatchingPrecedence *int32 `json:"matchingPrecedence,omitempty"` + DistinguisherMethod *FlowDistinguisherMethodApplyConfiguration `json:"distinguisherMethod,omitempty"` + Rules []PolicyRulesWithSubjectsApplyConfiguration `json:"rules,omitempty"` +} + +// FlowSchemaSpecApplyConfiguration constructs an declarative configuration of the FlowSchemaSpec type for use with +// apply. +func FlowSchemaSpec() *FlowSchemaSpecApplyConfiguration { + return &FlowSchemaSpecApplyConfiguration{} +} + +// WithPriorityLevelConfiguration sets the PriorityLevelConfiguration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PriorityLevelConfiguration field is set to the value of the last call. +func (b *FlowSchemaSpecApplyConfiguration) WithPriorityLevelConfiguration(value *PriorityLevelConfigurationReferenceApplyConfiguration) *FlowSchemaSpecApplyConfiguration { + b.PriorityLevelConfiguration = value + return b +} + +// WithMatchingPrecedence sets the MatchingPrecedence field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the MatchingPrecedence field is set to the value of the last call. +func (b *FlowSchemaSpecApplyConfiguration) WithMatchingPrecedence(value int32) *FlowSchemaSpecApplyConfiguration { + b.MatchingPrecedence = &value + return b +} + +// WithDistinguisherMethod sets the DistinguisherMethod field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DistinguisherMethod field is set to the value of the last call. +func (b *FlowSchemaSpecApplyConfiguration) WithDistinguisherMethod(value *FlowDistinguisherMethodApplyConfiguration) *FlowSchemaSpecApplyConfiguration { + b.DistinguisherMethod = value + return b +} + +// WithRules adds the given value to the Rules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Rules field. +func (b *FlowSchemaSpecApplyConfiguration) WithRules(values ...*PolicyRulesWithSubjectsApplyConfiguration) *FlowSchemaSpecApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithRules") + } + b.Rules = append(b.Rules, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemastatus.go b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemastatus.go new file mode 100644 index 00000000000..aefda3973a5 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/flowschemastatus.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// FlowSchemaStatusApplyConfiguration represents an declarative configuration of the FlowSchemaStatus type for use +// with apply. +type FlowSchemaStatusApplyConfiguration struct { + Conditions []FlowSchemaConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// FlowSchemaStatusApplyConfiguration constructs an declarative configuration of the FlowSchemaStatus type for use with +// apply. +func FlowSchemaStatus() *FlowSchemaStatusApplyConfiguration { + return &FlowSchemaStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *FlowSchemaStatusApplyConfiguration) WithConditions(values ...*FlowSchemaConditionApplyConfiguration) *FlowSchemaStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/groupsubject.go b/pkg/generated/applyconfigurations/flowcontrol/v1/groupsubject.go new file mode 100644 index 00000000000..f8bf8015451 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/groupsubject.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// GroupSubjectApplyConfiguration represents an declarative configuration of the GroupSubject type for use +// with apply. +type GroupSubjectApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// GroupSubjectApplyConfiguration constructs an declarative configuration of the GroupSubject type for use with +// apply. +func GroupSubject() *GroupSubjectApplyConfiguration { + return &GroupSubjectApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *GroupSubjectApplyConfiguration) WithName(value string) *GroupSubjectApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go b/pkg/generated/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go new file mode 100644 index 00000000000..30b68087035 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/limitedprioritylevelconfiguration.go @@ -0,0 +1,55 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LimitedPriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the LimitedPriorityLevelConfiguration type for use +// with apply. +type LimitedPriorityLevelConfigurationApplyConfiguration struct { + NominalConcurrencyShares *int32 `json:"nominalConcurrencyShares,omitempty"` + LimitResponse *LimitResponseApplyConfiguration `json:"limitResponse,omitempty"` + LendablePercent *int32 `json:"lendablePercent,omitempty"` + BorrowingLimitPercent *int32 `json:"borrowingLimitPercent,omitempty"` +} + +// LimitedPriorityLevelConfigurationApplyConfiguration constructs an declarative configuration of the LimitedPriorityLevelConfiguration type for use with +// apply. +func LimitedPriorityLevelConfiguration() *LimitedPriorityLevelConfigurationApplyConfiguration { + return &LimitedPriorityLevelConfigurationApplyConfiguration{} +} + +// WithNominalConcurrencyShares sets the NominalConcurrencyShares field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the NominalConcurrencyShares field is set to the value of the last call. +func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithNominalConcurrencyShares(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { + b.NominalConcurrencyShares = &value + return b +} + +// WithLimitResponse sets the LimitResponse field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LimitResponse field is set to the value of the last call. +func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLimitResponse(value *LimitResponseApplyConfiguration) *LimitedPriorityLevelConfigurationApplyConfiguration { + b.LimitResponse = value + return b +} + +// WithLendablePercent sets the LendablePercent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LendablePercent field is set to the value of the last call. +func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithLendablePercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { + b.LendablePercent = &value + return b +} + +// WithBorrowingLimitPercent sets the BorrowingLimitPercent field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BorrowingLimitPercent field is set to the value of the last call. +func (b *LimitedPriorityLevelConfigurationApplyConfiguration) WithBorrowingLimitPercent(value int32) *LimitedPriorityLevelConfigurationApplyConfiguration { + b.BorrowingLimitPercent = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/limitresponse.go b/pkg/generated/applyconfigurations/flowcontrol/v1/limitresponse.go new file mode 100644 index 00000000000..aca441a6a79 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/limitresponse.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" +) + +// LimitResponseApplyConfiguration represents an declarative configuration of the LimitResponse type for use +// with apply. +type LimitResponseApplyConfiguration struct { + Type *v1.LimitResponseType `json:"type,omitempty"` + Queuing *QueuingConfigurationApplyConfiguration `json:"queuing,omitempty"` +} + +// LimitResponseApplyConfiguration constructs an declarative configuration of the LimitResponse type for use with +// apply. +func LimitResponse() *LimitResponseApplyConfiguration { + return &LimitResponseApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *LimitResponseApplyConfiguration) WithType(value v1.LimitResponseType) *LimitResponseApplyConfiguration { + b.Type = &value + return b +} + +// WithQueuing sets the Queuing field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Queuing field is set to the value of the last call. +func (b *LimitResponseApplyConfiguration) WithQueuing(value *QueuingConfigurationApplyConfiguration) *LimitResponseApplyConfiguration { + b.Queuing = value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go b/pkg/generated/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go new file mode 100644 index 00000000000..7b7c40499bf --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/nonresourcepolicyrule.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// NonResourcePolicyRuleApplyConfiguration represents an declarative configuration of the NonResourcePolicyRule type for use +// with apply. +type NonResourcePolicyRuleApplyConfiguration struct { + Verbs []string `json:"verbs,omitempty"` + NonResourceURLs []string `json:"nonResourceURLs,omitempty"` +} + +// NonResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the NonResourcePolicyRule type for use with +// apply. +func NonResourcePolicyRule() *NonResourcePolicyRuleApplyConfiguration { + return &NonResourcePolicyRuleApplyConfiguration{} +} + +// WithVerbs adds the given value to the Verbs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Verbs field. +func (b *NonResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *NonResourcePolicyRuleApplyConfiguration { + for i := range values { + b.Verbs = append(b.Verbs, values[i]) + } + return b +} + +// WithNonResourceURLs adds the given value to the NonResourceURLs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NonResourceURLs field. +func (b *NonResourcePolicyRuleApplyConfiguration) WithNonResourceURLs(values ...string) *NonResourcePolicyRuleApplyConfiguration { + for i := range values { + b.NonResourceURLs = append(b.NonResourceURLs, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go b/pkg/generated/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go new file mode 100644 index 00000000000..95e4db3e266 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/policyruleswithsubjects.go @@ -0,0 +1,61 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PolicyRulesWithSubjectsApplyConfiguration represents an declarative configuration of the PolicyRulesWithSubjects type for use +// with apply. +type PolicyRulesWithSubjectsApplyConfiguration struct { + Subjects []SubjectApplyConfiguration `json:"subjects,omitempty"` + ResourceRules []ResourcePolicyRuleApplyConfiguration `json:"resourceRules,omitempty"` + NonResourceRules []NonResourcePolicyRuleApplyConfiguration `json:"nonResourceRules,omitempty"` +} + +// PolicyRulesWithSubjectsApplyConfiguration constructs an declarative configuration of the PolicyRulesWithSubjects type for use with +// apply. +func PolicyRulesWithSubjects() *PolicyRulesWithSubjectsApplyConfiguration { + return &PolicyRulesWithSubjectsApplyConfiguration{} +} + +// WithSubjects adds the given value to the Subjects field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Subjects field. +func (b *PolicyRulesWithSubjectsApplyConfiguration) WithSubjects(values ...*SubjectApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithSubjects") + } + b.Subjects = append(b.Subjects, *values[i]) + } + return b +} + +// WithResourceRules adds the given value to the ResourceRules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the ResourceRules field. +func (b *PolicyRulesWithSubjectsApplyConfiguration) WithResourceRules(values ...*ResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithResourceRules") + } + b.ResourceRules = append(b.ResourceRules, *values[i]) + } + return b +} + +// WithNonResourceRules adds the given value to the NonResourceRules field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the NonResourceRules field. +func (b *PolicyRulesWithSubjectsApplyConfiguration) WithNonResourceRules(values ...*NonResourcePolicyRuleApplyConfiguration) *PolicyRulesWithSubjectsApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithNonResourceRules") + } + b.NonResourceRules = append(b.NonResourceRules, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go new file mode 100644 index 00000000000..ac6b67f4335 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfiguration.go @@ -0,0 +1,245 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + internal "github.com/superproj/onex/pkg/generated/applyconfigurations/internal" + v1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + apiflowcontrolv1 "k8s.io/api/flowcontrol/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + managedfields "k8s.io/apimachinery/pkg/util/managedfields" +) + +// PriorityLevelConfigurationApplyConfiguration represents an declarative configuration of the PriorityLevelConfiguration type for use +// with apply. +type PriorityLevelConfigurationApplyConfiguration struct { + v1.TypeMetaApplyConfiguration `json:",inline"` + *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` + Spec *PriorityLevelConfigurationSpecApplyConfiguration `json:"spec,omitempty"` + Status *PriorityLevelConfigurationStatusApplyConfiguration `json:"status,omitempty"` +} + +// PriorityLevelConfiguration constructs an declarative configuration of the PriorityLevelConfiguration type for use with +// apply. +func PriorityLevelConfiguration(name string) *PriorityLevelConfigurationApplyConfiguration { + b := &PriorityLevelConfigurationApplyConfiguration{} + b.WithName(name) + b.WithKind("PriorityLevelConfiguration") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + return b +} + +// ExtractPriorityLevelConfiguration extracts the applied configuration owned by fieldManager from +// priorityLevelConfiguration. If no managedFields are found in priorityLevelConfiguration for fieldManager, a +// PriorityLevelConfigurationApplyConfiguration is returned with only the Name, Namespace (if applicable), +// APIVersion and Kind populated. It is possible that no managed fields were found for because other +// field managers have taken ownership of all the fields previously owned by fieldManager, or because +// the fieldManager never owned fields any fields. +// priorityLevelConfiguration must be a unmodified PriorityLevelConfiguration API object that was retrieved from the Kubernetes API. +// ExtractPriorityLevelConfiguration provides a way to perform a extract/modify-in-place/apply workflow. +// Note that an extracted apply configuration will contain fewer fields than what the fieldManager previously +// applied if another fieldManager has updated or force applied any of the previously applied fields. +// Experimental! +func ExtractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { + return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "") +} + +// ExtractPriorityLevelConfigurationStatus is the same as ExtractPriorityLevelConfiguration except +// that it extracts the status subresource applied configuration. +// Experimental! +func ExtractPriorityLevelConfigurationStatus(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string) (*PriorityLevelConfigurationApplyConfiguration, error) { + return extractPriorityLevelConfiguration(priorityLevelConfiguration, fieldManager, "status") +} + +func extractPriorityLevelConfiguration(priorityLevelConfiguration *apiflowcontrolv1.PriorityLevelConfiguration, fieldManager string, subresource string) (*PriorityLevelConfigurationApplyConfiguration, error) { + b := &PriorityLevelConfigurationApplyConfiguration{} + err := managedfields.ExtractInto(priorityLevelConfiguration, internal.Parser().Type("io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration"), fieldManager, b, subresource) + if err != nil { + return nil, err + } + b.WithName(priorityLevelConfiguration.Name) + + b.WithKind("PriorityLevelConfiguration") + b.WithAPIVersion("flowcontrol.apiserver.k8s.io/v1") + return b, nil +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithKind(value string) *PriorityLevelConfigurationApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithAPIVersion(value string) *PriorityLevelConfigurationApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithName(value string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithGenerateName(value string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithNamespace(value string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithUID(value types.UID) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithResourceVersion(value string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithGeneration(value int64) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithCreationTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionTimestamp(value metav1.Time) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *PriorityLevelConfigurationApplyConfiguration) WithLabels(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *PriorityLevelConfigurationApplyConfiguration) WithAnnotations(entries map[string]string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *PriorityLevelConfigurationApplyConfiguration) WithOwnerReferences(values ...*v1.OwnerReferenceApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *PriorityLevelConfigurationApplyConfiguration) WithFinalizers(values ...string) *PriorityLevelConfigurationApplyConfiguration { + b.ensureObjectMetaApplyConfigurationExists() + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} + +func (b *PriorityLevelConfigurationApplyConfiguration) ensureObjectMetaApplyConfigurationExists() { + if b.ObjectMetaApplyConfiguration == nil { + b.ObjectMetaApplyConfiguration = &v1.ObjectMetaApplyConfiguration{} + } +} + +// WithSpec sets the Spec field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Spec field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithSpec(value *PriorityLevelConfigurationSpecApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { + b.Spec = value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PriorityLevelConfigurationApplyConfiguration) WithStatus(value *PriorityLevelConfigurationStatusApplyConfiguration) *PriorityLevelConfigurationApplyConfiguration { + b.Status = value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go new file mode 100644 index 00000000000..e835f35379f --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationcondition.go @@ -0,0 +1,69 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// PriorityLevelConfigurationConditionApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationCondition type for use +// with apply. +type PriorityLevelConfigurationConditionApplyConfiguration struct { + Type *v1.PriorityLevelConfigurationConditionType `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// PriorityLevelConfigurationConditionApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationCondition type for use with +// apply. +func PriorityLevelConfigurationCondition() *PriorityLevelConfigurationConditionApplyConfiguration { + return &PriorityLevelConfigurationConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithType(value v1.PriorityLevelConfigurationConditionType) *PriorityLevelConfigurationConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *PriorityLevelConfigurationConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithLastTransitionTime(value metav1.Time) *PriorityLevelConfigurationConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithReason(value string) *PriorityLevelConfigurationConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *PriorityLevelConfigurationConditionApplyConfiguration) WithMessage(value string) *PriorityLevelConfigurationConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go new file mode 100644 index 00000000000..6c0bb19e5ef --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationreference.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PriorityLevelConfigurationReferenceApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationReference type for use +// with apply. +type PriorityLevelConfigurationReferenceApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// PriorityLevelConfigurationReferenceApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationReference type for use with +// apply. +func PriorityLevelConfigurationReference() *PriorityLevelConfigurationReferenceApplyConfiguration { + return &PriorityLevelConfigurationReferenceApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *PriorityLevelConfigurationReferenceApplyConfiguration) WithName(value string) *PriorityLevelConfigurationReferenceApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go new file mode 100644 index 00000000000..8b91e384b73 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationspec.go @@ -0,0 +1,50 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" +) + +// PriorityLevelConfigurationSpecApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationSpec type for use +// with apply. +type PriorityLevelConfigurationSpecApplyConfiguration struct { + Type *v1.PriorityLevelEnablement `json:"type,omitempty"` + Limited *LimitedPriorityLevelConfigurationApplyConfiguration `json:"limited,omitempty"` + Exempt *ExemptPriorityLevelConfigurationApplyConfiguration `json:"exempt,omitempty"` +} + +// PriorityLevelConfigurationSpecApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationSpec type for use with +// apply. +func PriorityLevelConfigurationSpec() *PriorityLevelConfigurationSpecApplyConfiguration { + return &PriorityLevelConfigurationSpecApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithType(value v1.PriorityLevelEnablement) *PriorityLevelConfigurationSpecApplyConfiguration { + b.Type = &value + return b +} + +// WithLimited sets the Limited field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Limited field is set to the value of the last call. +func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithLimited(value *LimitedPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { + b.Limited = value + return b +} + +// WithExempt sets the Exempt field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Exempt field is set to the value of the last call. +func (b *PriorityLevelConfigurationSpecApplyConfiguration) WithExempt(value *ExemptPriorityLevelConfigurationApplyConfiguration) *PriorityLevelConfigurationSpecApplyConfiguration { + b.Exempt = value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go new file mode 100644 index 00000000000..933e9acd2ba --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/prioritylevelconfigurationstatus.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// PriorityLevelConfigurationStatusApplyConfiguration represents an declarative configuration of the PriorityLevelConfigurationStatus type for use +// with apply. +type PriorityLevelConfigurationStatusApplyConfiguration struct { + Conditions []PriorityLevelConfigurationConditionApplyConfiguration `json:"conditions,omitempty"` +} + +// PriorityLevelConfigurationStatusApplyConfiguration constructs an declarative configuration of the PriorityLevelConfigurationStatus type for use with +// apply. +func PriorityLevelConfigurationStatus() *PriorityLevelConfigurationStatusApplyConfiguration { + return &PriorityLevelConfigurationStatusApplyConfiguration{} +} + +// WithConditions adds the given value to the Conditions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Conditions field. +func (b *PriorityLevelConfigurationStatusApplyConfiguration) WithConditions(values ...*PriorityLevelConfigurationConditionApplyConfiguration) *PriorityLevelConfigurationStatusApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithConditions") + } + b.Conditions = append(b.Conditions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/queuingconfiguration.go b/pkg/generated/applyconfigurations/flowcontrol/v1/queuingconfiguration.go new file mode 100644 index 00000000000..5fc4dcf1384 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/queuingconfiguration.go @@ -0,0 +1,46 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// QueuingConfigurationApplyConfiguration represents an declarative configuration of the QueuingConfiguration type for use +// with apply. +type QueuingConfigurationApplyConfiguration struct { + Queues *int32 `json:"queues,omitempty"` + HandSize *int32 `json:"handSize,omitempty"` + QueueLengthLimit *int32 `json:"queueLengthLimit,omitempty"` +} + +// QueuingConfigurationApplyConfiguration constructs an declarative configuration of the QueuingConfiguration type for use with +// apply. +func QueuingConfiguration() *QueuingConfigurationApplyConfiguration { + return &QueuingConfigurationApplyConfiguration{} +} + +// WithQueues sets the Queues field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Queues field is set to the value of the last call. +func (b *QueuingConfigurationApplyConfiguration) WithQueues(value int32) *QueuingConfigurationApplyConfiguration { + b.Queues = &value + return b +} + +// WithHandSize sets the HandSize field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the HandSize field is set to the value of the last call. +func (b *QueuingConfigurationApplyConfiguration) WithHandSize(value int32) *QueuingConfigurationApplyConfiguration { + b.HandSize = &value + return b +} + +// WithQueueLengthLimit sets the QueueLengthLimit field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the QueueLengthLimit field is set to the value of the last call. +func (b *QueuingConfigurationApplyConfiguration) WithQueueLengthLimit(value int32) *QueuingConfigurationApplyConfiguration { + b.QueueLengthLimit = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go b/pkg/generated/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go new file mode 100644 index 00000000000..9a5ed6418a9 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/resourcepolicyrule.go @@ -0,0 +1,72 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ResourcePolicyRuleApplyConfiguration represents an declarative configuration of the ResourcePolicyRule type for use +// with apply. +type ResourcePolicyRuleApplyConfiguration struct { + Verbs []string `json:"verbs,omitempty"` + APIGroups []string `json:"apiGroups,omitempty"` + Resources []string `json:"resources,omitempty"` + ClusterScope *bool `json:"clusterScope,omitempty"` + Namespaces []string `json:"namespaces,omitempty"` +} + +// ResourcePolicyRuleApplyConfiguration constructs an declarative configuration of the ResourcePolicyRule type for use with +// apply. +func ResourcePolicyRule() *ResourcePolicyRuleApplyConfiguration { + return &ResourcePolicyRuleApplyConfiguration{} +} + +// WithVerbs adds the given value to the Verbs field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Verbs field. +func (b *ResourcePolicyRuleApplyConfiguration) WithVerbs(values ...string) *ResourcePolicyRuleApplyConfiguration { + for i := range values { + b.Verbs = append(b.Verbs, values[i]) + } + return b +} + +// WithAPIGroups adds the given value to the APIGroups field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the APIGroups field. +func (b *ResourcePolicyRuleApplyConfiguration) WithAPIGroups(values ...string) *ResourcePolicyRuleApplyConfiguration { + for i := range values { + b.APIGroups = append(b.APIGroups, values[i]) + } + return b +} + +// WithResources adds the given value to the Resources field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Resources field. +func (b *ResourcePolicyRuleApplyConfiguration) WithResources(values ...string) *ResourcePolicyRuleApplyConfiguration { + for i := range values { + b.Resources = append(b.Resources, values[i]) + } + return b +} + +// WithClusterScope sets the ClusterScope field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ClusterScope field is set to the value of the last call. +func (b *ResourcePolicyRuleApplyConfiguration) WithClusterScope(value bool) *ResourcePolicyRuleApplyConfiguration { + b.ClusterScope = &value + return b +} + +// WithNamespaces adds the given value to the Namespaces field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Namespaces field. +func (b *ResourcePolicyRuleApplyConfiguration) WithNamespaces(values ...string) *ResourcePolicyRuleApplyConfiguration { + for i := range values { + b.Namespaces = append(b.Namespaces, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go b/pkg/generated/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go new file mode 100644 index 00000000000..479dc878858 --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/serviceaccountsubject.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// ServiceAccountSubjectApplyConfiguration represents an declarative configuration of the ServiceAccountSubject type for use +// with apply. +type ServiceAccountSubjectApplyConfiguration struct { + Namespace *string `json:"namespace,omitempty"` + Name *string `json:"name,omitempty"` +} + +// ServiceAccountSubjectApplyConfiguration constructs an declarative configuration of the ServiceAccountSubject type for use with +// apply. +func ServiceAccountSubject() *ServiceAccountSubjectApplyConfiguration { + return &ServiceAccountSubjectApplyConfiguration{} +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ServiceAccountSubjectApplyConfiguration) WithNamespace(value string) *ServiceAccountSubjectApplyConfiguration { + b.Namespace = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ServiceAccountSubjectApplyConfiguration) WithName(value string) *ServiceAccountSubjectApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/subject.go b/pkg/generated/applyconfigurations/flowcontrol/v1/subject.go new file mode 100644 index 00000000000..2661702ccff --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/subject.go @@ -0,0 +1,59 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" +) + +// SubjectApplyConfiguration represents an declarative configuration of the Subject type for use +// with apply. +type SubjectApplyConfiguration struct { + Kind *v1.SubjectKind `json:"kind,omitempty"` + User *UserSubjectApplyConfiguration `json:"user,omitempty"` + Group *GroupSubjectApplyConfiguration `json:"group,omitempty"` + ServiceAccount *ServiceAccountSubjectApplyConfiguration `json:"serviceAccount,omitempty"` +} + +// SubjectApplyConfiguration constructs an declarative configuration of the Subject type for use with +// apply. +func Subject() *SubjectApplyConfiguration { + return &SubjectApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *SubjectApplyConfiguration) WithKind(value v1.SubjectKind) *SubjectApplyConfiguration { + b.Kind = &value + return b +} + +// WithUser sets the User field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the User field is set to the value of the last call. +func (b *SubjectApplyConfiguration) WithUser(value *UserSubjectApplyConfiguration) *SubjectApplyConfiguration { + b.User = value + return b +} + +// WithGroup sets the Group field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Group field is set to the value of the last call. +func (b *SubjectApplyConfiguration) WithGroup(value *GroupSubjectApplyConfiguration) *SubjectApplyConfiguration { + b.Group = value + return b +} + +// WithServiceAccount sets the ServiceAccount field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ServiceAccount field is set to the value of the last call. +func (b *SubjectApplyConfiguration) WithServiceAccount(value *ServiceAccountSubjectApplyConfiguration) *SubjectApplyConfiguration { + b.ServiceAccount = value + return b +} diff --git a/pkg/generated/applyconfigurations/flowcontrol/v1/usersubject.go b/pkg/generated/applyconfigurations/flowcontrol/v1/usersubject.go new file mode 100644 index 00000000000..793a6e3b1bb --- /dev/null +++ b/pkg/generated/applyconfigurations/flowcontrol/v1/usersubject.go @@ -0,0 +1,28 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// UserSubjectApplyConfiguration represents an declarative configuration of the UserSubject type for use +// with apply. +type UserSubjectApplyConfiguration struct { + Name *string `json:"name,omitempty"` +} + +// UserSubjectApplyConfiguration constructs an declarative configuration of the UserSubject type for use with +// apply. +func UserSubject() *UserSubjectApplyConfiguration { + return &UserSubjectApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *UserSubjectApplyConfiguration) WithName(value string) *UserSubjectApplyConfiguration { + b.Name = &value + return b +} diff --git a/pkg/generated/applyconfigurations/internal/internal.go b/pkg/generated/applyconfigurations/internal/internal.go new file mode 100644 index 00000000000..54a3b24903f --- /dev/null +++ b/pkg/generated/applyconfigurations/internal/internal.go @@ -0,0 +1,5144 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package internal + +import ( + "fmt" + "sync" + + typed "sigs.k8s.io/structured-merge-diff/v4/typed" +) + +func Parser() *typed.Parser { + parserOnce.Do(func() { + var err error + parser, err = typed.NewParser(schemaYAML) + if err != nil { + panic(fmt.Sprintf("Failed to parse schema: %v", err)) + } + }) + return parser +} + +var parserOnce sync.Once +var parser *typed.Parser +var schemaYAML = typed.YAMLObject(`types: +- name: com.github.superproj.onex.pkg.apis.apps.v1beta1.Chain + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: com.github.superproj.onex.pkg.apis.apps.v1beta1.ChargeRequest + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: com.github.superproj.onex.pkg.apis.apps.v1beta1.Miner + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: com.github.superproj.onex.pkg.apis.apps.v1beta1.MinerSet + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.autoscaling.v1.CrossVersionObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscaler + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec + default: {} + - name: status + type: + namedType: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus + default: {} +- name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec + map: + fields: + - name: maxReplicas + type: + scalar: numeric + default: 0 + - name: minReplicas + type: + scalar: numeric + - name: scaleTargetRef + type: + namedType: io.k8s.api.autoscaling.v1.CrossVersionObjectReference + default: {} + - name: targetCPUUtilizationPercentage + type: + scalar: numeric +- name: io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerStatus + map: + fields: + - name: currentCPUUtilizationPercentage + type: + scalar: numeric + - name: currentReplicas + type: + scalar: numeric + default: 0 + - name: desiredReplicas + type: + scalar: numeric + default: 0 + - name: lastScaleTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.coordination.v1.Lease + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.coordination.v1.LeaseSpec + default: {} +- name: io.k8s.api.coordination.v1.LeaseSpec + map: + fields: + - name: acquireTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: holderIdentity + type: + scalar: string + - name: leaseDurationSeconds + type: + scalar: numeric + - name: leaseTransitions + type: + scalar: numeric + - name: renewTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime +- name: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: partition + type: + scalar: numeric + - name: readOnly + type: + scalar: boolean + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Affinity + map: + fields: + - name: nodeAffinity + type: + namedType: io.k8s.api.core.v1.NodeAffinity + - name: podAffinity + type: + namedType: io.k8s.api.core.v1.PodAffinity + - name: podAntiAffinity + type: + namedType: io.k8s.api.core.v1.PodAntiAffinity +- name: io.k8s.api.core.v1.AppArmorProfile + map: + fields: + - name: localhostProfile + type: + scalar: string + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: localhostProfile + discriminatorValue: LocalhostProfile +- name: io.k8s.api.core.v1.AttachedVolume + map: + fields: + - name: devicePath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.AzureDiskVolumeSource + map: + fields: + - name: cachingMode + type: + scalar: string + - name: diskName + type: + scalar: string + default: "" + - name: diskURI + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: kind + type: + scalar: string + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.AzureFilePersistentVolumeSource + map: + fields: + - name: readOnly + type: + scalar: boolean + - name: secretName + type: + scalar: string + default: "" + - name: secretNamespace + type: + scalar: string + - name: shareName + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.AzureFileVolumeSource + map: + fields: + - name: readOnly + type: + scalar: boolean + - name: secretName + type: + scalar: string + default: "" + - name: shareName + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.CSIPersistentVolumeSource + map: + fields: + - name: controllerExpandSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: controllerPublishSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: nodeExpandSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: nodePublishSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: nodeStageSecretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: readOnly + type: + scalar: boolean + - name: volumeAttributes + type: + map: + elementType: + scalar: string + - name: volumeHandle + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.CSIVolumeSource + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: nodePublishSecretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: readOnly + type: + scalar: boolean + - name: volumeAttributes + type: + map: + elementType: + scalar: string +- name: io.k8s.api.core.v1.Capabilities + map: + fields: + - name: add + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: drop + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.CephFSPersistentVolumeSource + map: + fields: + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: path + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretFile + type: + scalar: string + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.CephFSVolumeSource + map: + fields: + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: path + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretFile + type: + scalar: string + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.CinderPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.CinderVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ClaimSource + map: + fields: + - name: resourceClaimName + type: + scalar: string + - name: resourceClaimTemplateName + type: + scalar: string +- name: io.k8s.api.core.v1.ClientIPConfig + map: + fields: + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.core.v1.ClusterTrustBundleProjection + map: + fields: + - name: labelSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: name + type: + scalar: string + - name: optional + type: + scalar: boolean + - name: path + type: + scalar: string + default: "" + - name: signerName + type: + scalar: string +- name: io.k8s.api.core.v1.ComponentCondition + map: + fields: + - name: error + type: + scalar: string + - name: message + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ComponentStatus + map: + fields: + - name: apiVersion + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ComponentCondition + elementRelationship: associative + keys: + - type + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.api.core.v1.ConfigMap + map: + fields: + - name: apiVersion + type: + scalar: string + - name: binaryData + type: + map: + elementType: + scalar: string + - name: data + type: + map: + elementType: + scalar: string + - name: immutable + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} +- name: io.k8s.api.core.v1.ConfigMapEnvSource + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.ConfigMapKeySelector + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean + elementRelationship: atomic +- name: io.k8s.api.core.v1.ConfigMapNodeConfigSource + map: + fields: + - name: kubeletConfigKey + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: resourceVersion + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.api.core.v1.ConfigMapProjection + map: + fields: + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.ConfigMapVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.Container + map: + fields: + - name: args + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: command + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: env + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvVar + elementRelationship: associative + keys: + - name + - name: envFrom + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvFromSource + elementRelationship: atomic + - name: image + type: + scalar: string + - name: imagePullPolicy + type: + scalar: string + - name: lifecycle + type: + namedType: io.k8s.api.core.v1.Lifecycle + - name: livenessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: name + type: + scalar: string + default: "" + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerPort + elementRelationship: associative + keys: + - containerPort + - protocol + - name: readinessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: resizePolicy + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerResizePolicy + elementRelationship: atomic + - name: resources + type: + namedType: io.k8s.api.core.v1.ResourceRequirements + default: {} + - name: restartPolicy + type: + scalar: string + - name: securityContext + type: + namedType: io.k8s.api.core.v1.SecurityContext + - name: startupProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: stdin + type: + scalar: boolean + - name: stdinOnce + type: + scalar: boolean + - name: terminationMessagePath + type: + scalar: string + - name: terminationMessagePolicy + type: + scalar: string + - name: tty + type: + scalar: boolean + - name: volumeDevices + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeDevice + elementRelationship: associative + keys: + - devicePath + - name: volumeMounts + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeMount + elementRelationship: associative + keys: + - mountPath + - name: workingDir + type: + scalar: string +- name: io.k8s.api.core.v1.ContainerImage + map: + fields: + - name: names + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: sizeBytes + type: + scalar: numeric +- name: io.k8s.api.core.v1.ContainerPort + map: + fields: + - name: containerPort + type: + scalar: numeric + default: 0 + - name: hostIP + type: + scalar: string + - name: hostPort + type: + scalar: numeric + - name: name + type: + scalar: string + - name: protocol + type: + scalar: string + default: TCP +- name: io.k8s.api.core.v1.ContainerResizePolicy + map: + fields: + - name: resourceName + type: + scalar: string + default: "" + - name: restartPolicy + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ContainerState + map: + fields: + - name: running + type: + namedType: io.k8s.api.core.v1.ContainerStateRunning + - name: terminated + type: + namedType: io.k8s.api.core.v1.ContainerStateTerminated + - name: waiting + type: + namedType: io.k8s.api.core.v1.ContainerStateWaiting +- name: io.k8s.api.core.v1.ContainerStateRunning + map: + fields: + - name: startedAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.core.v1.ContainerStateTerminated + map: + fields: + - name: containerID + type: + scalar: string + - name: exitCode + type: + scalar: numeric + default: 0 + - name: finishedAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: signal + type: + scalar: numeric + - name: startedAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.core.v1.ContainerStateWaiting + map: + fields: + - name: message + type: + scalar: string + - name: reason + type: + scalar: string +- name: io.k8s.api.core.v1.ContainerStatus + map: + fields: + - name: allocatedResources + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: containerID + type: + scalar: string + - name: image + type: + scalar: string + default: "" + - name: imageID + type: + scalar: string + default: "" + - name: lastState + type: + namedType: io.k8s.api.core.v1.ContainerState + default: {} + - name: name + type: + scalar: string + default: "" + - name: ready + type: + scalar: boolean + default: false + - name: resources + type: + namedType: io.k8s.api.core.v1.ResourceRequirements + - name: restartCount + type: + scalar: numeric + default: 0 + - name: started + type: + scalar: boolean + - name: state + type: + namedType: io.k8s.api.core.v1.ContainerState + default: {} + - name: volumeMounts + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeMountStatus + elementRelationship: associative + keys: + - mountPath +- name: io.k8s.api.core.v1.DaemonEndpoint + map: + fields: + - name: Port + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.DownwardAPIProjection + map: + fields: + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.DownwardAPIVolumeFile + elementRelationship: atomic +- name: io.k8s.api.core.v1.DownwardAPIVolumeFile + map: + fields: + - name: fieldRef + type: + namedType: io.k8s.api.core.v1.ObjectFieldSelector + - name: mode + type: + scalar: numeric + - name: path + type: + scalar: string + default: "" + - name: resourceFieldRef + type: + namedType: io.k8s.api.core.v1.ResourceFieldSelector +- name: io.k8s.api.core.v1.DownwardAPIVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.DownwardAPIVolumeFile + elementRelationship: atomic +- name: io.k8s.api.core.v1.EmptyDirVolumeSource + map: + fields: + - name: medium + type: + scalar: string + - name: sizeLimit + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.EndpointAddress + map: + fields: + - name: hostname + type: + scalar: string + - name: ip + type: + scalar: string + default: "" + - name: nodeName + type: + scalar: string + - name: targetRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: atomic +- name: io.k8s.api.core.v1.EndpointPort + map: + fields: + - name: appProtocol + type: + scalar: string + - name: name + type: + scalar: string + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.EndpointSubset + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointAddress + elementRelationship: atomic + - name: notReadyAddresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointAddress + elementRelationship: atomic + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointPort + elementRelationship: atomic +- name: io.k8s.api.core.v1.Endpoints + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: subsets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EndpointSubset + elementRelationship: atomic +- name: io.k8s.api.core.v1.EnvFromSource + map: + fields: + - name: configMapRef + type: + namedType: io.k8s.api.core.v1.ConfigMapEnvSource + - name: prefix + type: + scalar: string + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretEnvSource +- name: io.k8s.api.core.v1.EnvVar + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + - name: valueFrom + type: + namedType: io.k8s.api.core.v1.EnvVarSource +- name: io.k8s.api.core.v1.EnvVarSource + map: + fields: + - name: configMapKeyRef + type: + namedType: io.k8s.api.core.v1.ConfigMapKeySelector + - name: fieldRef + type: + namedType: io.k8s.api.core.v1.ObjectFieldSelector + - name: resourceFieldRef + type: + namedType: io.k8s.api.core.v1.ResourceFieldSelector + - name: secretKeyRef + type: + namedType: io.k8s.api.core.v1.SecretKeySelector +- name: io.k8s.api.core.v1.EphemeralContainer + map: + fields: + - name: args + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: command + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: env + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvVar + elementRelationship: associative + keys: + - name + - name: envFrom + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EnvFromSource + elementRelationship: atomic + - name: image + type: + scalar: string + - name: imagePullPolicy + type: + scalar: string + - name: lifecycle + type: + namedType: io.k8s.api.core.v1.Lifecycle + - name: livenessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: name + type: + scalar: string + default: "" + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerPort + elementRelationship: associative + keys: + - containerPort + - protocol + - name: readinessProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: resizePolicy + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerResizePolicy + elementRelationship: atomic + - name: resources + type: + namedType: io.k8s.api.core.v1.ResourceRequirements + default: {} + - name: restartPolicy + type: + scalar: string + - name: securityContext + type: + namedType: io.k8s.api.core.v1.SecurityContext + - name: startupProbe + type: + namedType: io.k8s.api.core.v1.Probe + - name: stdin + type: + scalar: boolean + - name: stdinOnce + type: + scalar: boolean + - name: targetContainerName + type: + scalar: string + - name: terminationMessagePath + type: + scalar: string + - name: terminationMessagePolicy + type: + scalar: string + - name: tty + type: + scalar: boolean + - name: volumeDevices + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeDevice + elementRelationship: associative + keys: + - devicePath + - name: volumeMounts + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeMount + elementRelationship: associative + keys: + - mountPath + - name: workingDir + type: + scalar: string +- name: io.k8s.api.core.v1.EphemeralVolumeSource + map: + fields: + - name: volumeClaimTemplate + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimTemplate +- name: io.k8s.api.core.v1.Event + map: + fields: + - name: action + type: + scalar: string + - name: apiVersion + type: + scalar: string + - name: count + type: + scalar: numeric + - name: eventTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + - name: firstTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: involvedObject + type: + namedType: io.k8s.api.core.v1.ObjectReference + default: {} + - name: kind + type: + scalar: string + - name: lastTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: reason + type: + scalar: string + - name: related + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: reportingComponent + type: + scalar: string + default: "" + - name: reportingInstance + type: + scalar: string + default: "" + - name: series + type: + namedType: io.k8s.api.core.v1.EventSeries + - name: source + type: + namedType: io.k8s.api.core.v1.EventSource + default: {} + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.EventSeries + map: + fields: + - name: count + type: + scalar: numeric + - name: lastObservedTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime +- name: io.k8s.api.core.v1.EventSource + map: + fields: + - name: component + type: + scalar: string + - name: host + type: + scalar: string +- name: io.k8s.api.core.v1.ExecAction + map: + fields: + - name: command + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.FCVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: lun + type: + scalar: numeric + - name: readOnly + type: + scalar: boolean + - name: targetWWNs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: wwids + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.FlexPersistentVolumeSource + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: options + type: + map: + elementType: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference +- name: io.k8s.api.core.v1.FlexVolumeSource + map: + fields: + - name: driver + type: + scalar: string + default: "" + - name: fsType + type: + scalar: string + - name: options + type: + map: + elementType: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference +- name: io.k8s.api.core.v1.FlockerVolumeSource + map: + fields: + - name: datasetName + type: + scalar: string + - name: datasetUUID + type: + scalar: string +- name: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: partition + type: + scalar: numeric + - name: pdName + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.GRPCAction + map: + fields: + - name: port + type: + scalar: numeric + default: 0 + - name: service + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.GitRepoVolumeSource + map: + fields: + - name: directory + type: + scalar: string + - name: repository + type: + scalar: string + default: "" + - name: revision + type: + scalar: string +- name: io.k8s.api.core.v1.GlusterfsPersistentVolumeSource + map: + fields: + - name: endpoints + type: + scalar: string + default: "" + - name: endpointsNamespace + type: + scalar: string + - name: path + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.GlusterfsVolumeSource + map: + fields: + - name: endpoints + type: + scalar: string + default: "" + - name: path + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.HTTPGetAction + map: + fields: + - name: host + type: + scalar: string + - name: httpHeaders + type: + list: + elementType: + namedType: io.k8s.api.core.v1.HTTPHeader + elementRelationship: atomic + - name: path + type: + scalar: string + - name: port + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: scheme + type: + scalar: string +- name: io.k8s.api.core.v1.HTTPHeader + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.HostAlias + map: + fields: + - name: hostnames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: ip + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.HostIP + map: + fields: + - name: ip + type: + scalar: string +- name: io.k8s.api.core.v1.HostPathVolumeSource + map: + fields: + - name: path + type: + scalar: string + default: "" + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.ISCSIPersistentVolumeSource + map: + fields: + - name: chapAuthDiscovery + type: + scalar: boolean + - name: chapAuthSession + type: + scalar: boolean + - name: fsType + type: + scalar: string + - name: initiatorName + type: + scalar: string + - name: iqn + type: + scalar: string + default: "" + - name: iscsiInterface + type: + scalar: string + - name: lun + type: + scalar: numeric + default: 0 + - name: portals + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: targetPortal + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ISCSIVolumeSource + map: + fields: + - name: chapAuthDiscovery + type: + scalar: boolean + - name: chapAuthSession + type: + scalar: boolean + - name: fsType + type: + scalar: string + - name: initiatorName + type: + scalar: string + - name: iqn + type: + scalar: string + default: "" + - name: iscsiInterface + type: + scalar: string + - name: lun + type: + scalar: numeric + default: 0 + - name: portals + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: targetPortal + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.KeyToPath + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: mode + type: + scalar: numeric + - name: path + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Lifecycle + map: + fields: + - name: postStart + type: + namedType: io.k8s.api.core.v1.LifecycleHandler + - name: preStop + type: + namedType: io.k8s.api.core.v1.LifecycleHandler +- name: io.k8s.api.core.v1.LifecycleHandler + map: + fields: + - name: exec + type: + namedType: io.k8s.api.core.v1.ExecAction + - name: httpGet + type: + namedType: io.k8s.api.core.v1.HTTPGetAction + - name: sleep + type: + namedType: io.k8s.api.core.v1.SleepAction + - name: tcpSocket + type: + namedType: io.k8s.api.core.v1.TCPSocketAction +- name: io.k8s.api.core.v1.LimitRange + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.LimitRangeSpec + default: {} +- name: io.k8s.api.core.v1.LimitRangeItem + map: + fields: + - name: default + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: defaultRequest + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: max + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: maxLimitRequestRatio + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: min + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.LimitRangeSpec + map: + fields: + - name: limits + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LimitRangeItem + elementRelationship: atomic +- name: io.k8s.api.core.v1.LoadBalancerIngress + map: + fields: + - name: hostname + type: + scalar: string + - name: ip + type: + scalar: string + - name: ipMode + type: + scalar: string + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PortStatus + elementRelationship: atomic +- name: io.k8s.api.core.v1.LoadBalancerStatus + map: + fields: + - name: ingress + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LoadBalancerIngress + elementRelationship: atomic +- name: io.k8s.api.core.v1.LocalObjectReference + map: + fields: + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.LocalVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: path + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ModifyVolumeStatus + map: + fields: + - name: status + type: + scalar: string + default: "" + - name: targetVolumeAttributesClassName + type: + scalar: string +- name: io.k8s.api.core.v1.NFSVolumeSource + map: + fields: + - name: path + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean + - name: server + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Namespace + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.NamespaceSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.NamespaceStatus + default: {} +- name: io.k8s.api.core.v1.NamespaceCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NamespaceSpec + map: + fields: + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.NamespaceStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NamespaceCondition + elementRelationship: associative + keys: + - type + - name: phase + type: + scalar: string +- name: io.k8s.api.core.v1.Node + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.NodeSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.NodeStatus + default: {} +- name: io.k8s.api.core.v1.NodeAddress + map: + fields: + - name: address + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeAffinity + map: + fields: + - name: preferredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PreferredSchedulingTerm + elementRelationship: atomic + - name: requiredDuringSchedulingIgnoredDuringExecution + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.core.v1.NodeCondition + map: + fields: + - name: lastHeartbeatTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeConfigSource + map: + fields: + - name: configMap + type: + namedType: io.k8s.api.core.v1.ConfigMapNodeConfigSource +- name: io.k8s.api.core.v1.NodeConfigStatus + map: + fields: + - name: active + type: + namedType: io.k8s.api.core.v1.NodeConfigSource + - name: assigned + type: + namedType: io.k8s.api.core.v1.NodeConfigSource + - name: error + type: + scalar: string + - name: lastKnownGood + type: + namedType: io.k8s.api.core.v1.NodeConfigSource +- name: io.k8s.api.core.v1.NodeDaemonEndpoints + map: + fields: + - name: kubeletEndpoint + type: + namedType: io.k8s.api.core.v1.DaemonEndpoint + default: {} +- name: io.k8s.api.core.v1.NodeRuntimeHandler + map: + fields: + - name: features + type: + namedType: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.NodeRuntimeHandlerFeatures + map: + fields: + - name: recursiveReadOnlyMounts + type: + scalar: boolean +- name: io.k8s.api.core.v1.NodeSelector + map: + fields: + - name: nodeSelectorTerms + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeSelectorTerm + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSelectorTerm + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeSelectorRequirement + elementRelationship: atomic + - name: matchFields + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeSelectorRequirement + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSpec + map: + fields: + - name: configSource + type: + namedType: io.k8s.api.core.v1.NodeConfigSource + - name: externalID + type: + scalar: string + - name: podCIDR + type: + scalar: string + - name: podCIDRs + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: providerID + type: + scalar: string + - name: taints + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Taint + elementRelationship: atomic + - name: unschedulable + type: + scalar: boolean +- name: io.k8s.api.core.v1.NodeStatus + map: + fields: + - name: addresses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAddress + elementRelationship: associative + keys: + - type + - name: allocatable + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeCondition + elementRelationship: associative + keys: + - type + - name: config + type: + namedType: io.k8s.api.core.v1.NodeConfigStatus + - name: daemonEndpoints + type: + namedType: io.k8s.api.core.v1.NodeDaemonEndpoints + default: {} + - name: images + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerImage + elementRelationship: atomic + - name: nodeInfo + type: + namedType: io.k8s.api.core.v1.NodeSystemInfo + default: {} + - name: phase + type: + scalar: string + - name: runtimeHandlers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeRuntimeHandler + elementRelationship: atomic + - name: volumesAttached + type: + list: + elementType: + namedType: io.k8s.api.core.v1.AttachedVolume + elementRelationship: atomic + - name: volumesInUse + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.NodeSystemInfo + map: + fields: + - name: architecture + type: + scalar: string + default: "" + - name: bootID + type: + scalar: string + default: "" + - name: containerRuntimeVersion + type: + scalar: string + default: "" + - name: kernelVersion + type: + scalar: string + default: "" + - name: kubeProxyVersion + type: + scalar: string + default: "" + - name: kubeletVersion + type: + scalar: string + default: "" + - name: machineID + type: + scalar: string + default: "" + - name: operatingSystem + type: + scalar: string + default: "" + - name: osImage + type: + scalar: string + default: "" + - name: systemUUID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ObjectFieldSelector + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldPath + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.ObjectReference + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldPath + type: + scalar: string + - name: kind + type: + scalar: string + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: resourceVersion + type: + scalar: string + - name: uid + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.PersistentVolume + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.PersistentVolumeStatus + default: {} +- name: io.k8s.api.core.v1.PersistentVolumeClaim + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimStatus + default: {} +- name: io.k8s.api.core.v1.PersistentVolumeClaimCondition + map: + fields: + - name: lastProbeTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PersistentVolumeClaimSpec + map: + fields: + - name: accessModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: dataSource + type: + namedType: io.k8s.api.core.v1.TypedLocalObjectReference + - name: dataSourceRef + type: + namedType: io.k8s.api.core.v1.TypedObjectReference + - name: resources + type: + namedType: io.k8s.api.core.v1.VolumeResourceRequirements + default: {} + - name: selector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: storageClassName + type: + scalar: string + - name: volumeAttributesClassName + type: + scalar: string + - name: volumeMode + type: + scalar: string + - name: volumeName + type: + scalar: string +- name: io.k8s.api.core.v1.PersistentVolumeClaimStatus + map: + fields: + - name: accessModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: allocatedResourceStatuses + type: + map: + elementType: + scalar: string + elementRelationship: separable + - name: allocatedResources + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimCondition + elementRelationship: associative + keys: + - type + - name: currentVolumeAttributesClassName + type: + scalar: string + - name: modifyVolumeStatus + type: + namedType: io.k8s.api.core.v1.ModifyVolumeStatus + - name: phase + type: + scalar: string +- name: io.k8s.api.core.v1.PersistentVolumeClaimTemplate + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimSpec + default: {} +- name: io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource + map: + fields: + - name: claimName + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean +- name: io.k8s.api.core.v1.PersistentVolumeSpec + map: + fields: + - name: accessModes + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: awsElasticBlockStore + type: + namedType: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource + - name: azureDisk + type: + namedType: io.k8s.api.core.v1.AzureDiskVolumeSource + - name: azureFile + type: + namedType: io.k8s.api.core.v1.AzureFilePersistentVolumeSource + - name: capacity + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: cephfs + type: + namedType: io.k8s.api.core.v1.CephFSPersistentVolumeSource + - name: cinder + type: + namedType: io.k8s.api.core.v1.CinderPersistentVolumeSource + - name: claimRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: separable + - name: csi + type: + namedType: io.k8s.api.core.v1.CSIPersistentVolumeSource + - name: fc + type: + namedType: io.k8s.api.core.v1.FCVolumeSource + - name: flexVolume + type: + namedType: io.k8s.api.core.v1.FlexPersistentVolumeSource + - name: flocker + type: + namedType: io.k8s.api.core.v1.FlockerVolumeSource + - name: gcePersistentDisk + type: + namedType: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource + - name: glusterfs + type: + namedType: io.k8s.api.core.v1.GlusterfsPersistentVolumeSource + - name: hostPath + type: + namedType: io.k8s.api.core.v1.HostPathVolumeSource + - name: iscsi + type: + namedType: io.k8s.api.core.v1.ISCSIPersistentVolumeSource + - name: local + type: + namedType: io.k8s.api.core.v1.LocalVolumeSource + - name: mountOptions + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: nfs + type: + namedType: io.k8s.api.core.v1.NFSVolumeSource + - name: nodeAffinity + type: + namedType: io.k8s.api.core.v1.VolumeNodeAffinity + - name: persistentVolumeReclaimPolicy + type: + scalar: string + - name: photonPersistentDisk + type: + namedType: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource + - name: portworxVolume + type: + namedType: io.k8s.api.core.v1.PortworxVolumeSource + - name: quobyte + type: + namedType: io.k8s.api.core.v1.QuobyteVolumeSource + - name: rbd + type: + namedType: io.k8s.api.core.v1.RBDPersistentVolumeSource + - name: scaleIO + type: + namedType: io.k8s.api.core.v1.ScaleIOPersistentVolumeSource + - name: storageClassName + type: + scalar: string + - name: storageos + type: + namedType: io.k8s.api.core.v1.StorageOSPersistentVolumeSource + - name: volumeAttributesClassName + type: + scalar: string + - name: volumeMode + type: + scalar: string + - name: vsphereVolume + type: + namedType: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource +- name: io.k8s.api.core.v1.PersistentVolumeStatus + map: + fields: + - name: lastPhaseTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: phase + type: + scalar: string + - name: reason + type: + scalar: string +- name: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: pdID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.Pod + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PodSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.PodStatus + default: {} +- name: io.k8s.api.core.v1.PodAffinity + map: + fields: + - name: preferredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.WeightedPodAffinityTerm + elementRelationship: atomic + - name: requiredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodAffinityTerm + elementRelationship: atomic +- name: io.k8s.api.core.v1.PodAffinityTerm + map: + fields: + - name: labelSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: matchLabelKeys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: mismatchLabelKeys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: namespaceSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: namespaces + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: topologyKey + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodAntiAffinity + map: + fields: + - name: preferredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.WeightedPodAffinityTerm + elementRelationship: atomic + - name: requiredDuringSchedulingIgnoredDuringExecution + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodAffinityTerm + elementRelationship: atomic +- name: io.k8s.api.core.v1.PodCondition + map: + fields: + - name: lastProbeTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodDNSConfig + map: + fields: + - name: nameservers + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: options + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodDNSConfigOption + elementRelationship: atomic + - name: searches + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.PodDNSConfigOption + map: + fields: + - name: name + type: + scalar: string + - name: value + type: + scalar: string +- name: io.k8s.api.core.v1.PodIP + map: + fields: + - name: ip + type: + scalar: string +- name: io.k8s.api.core.v1.PodOS + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodReadinessGate + map: + fields: + - name: conditionType + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodResourceClaim + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: source + type: + namedType: io.k8s.api.core.v1.ClaimSource + default: {} +- name: io.k8s.api.core.v1.PodResourceClaimStatus + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string +- name: io.k8s.api.core.v1.PodSchedulingGate + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PodSecurityContext + map: + fields: + - name: appArmorProfile + type: + namedType: io.k8s.api.core.v1.AppArmorProfile + - name: fsGroup + type: + scalar: numeric + - name: fsGroupChangePolicy + type: + scalar: string + - name: runAsGroup + type: + scalar: numeric + - name: runAsNonRoot + type: + scalar: boolean + - name: runAsUser + type: + scalar: numeric + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions + - name: seccompProfile + type: + namedType: io.k8s.api.core.v1.SeccompProfile + - name: supplementalGroups + type: + list: + elementType: + scalar: numeric + elementRelationship: atomic + - name: sysctls + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Sysctl + elementRelationship: atomic + - name: windowsOptions + type: + namedType: io.k8s.api.core.v1.WindowsSecurityContextOptions +- name: io.k8s.api.core.v1.PodSpec + map: + fields: + - name: activeDeadlineSeconds + type: + scalar: numeric + - name: affinity + type: + namedType: io.k8s.api.core.v1.Affinity + - name: automountServiceAccountToken + type: + scalar: boolean + - name: containers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Container + elementRelationship: associative + keys: + - name + - name: dnsConfig + type: + namedType: io.k8s.api.core.v1.PodDNSConfig + - name: dnsPolicy + type: + scalar: string + - name: enableServiceLinks + type: + scalar: boolean + - name: ephemeralContainers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EphemeralContainer + elementRelationship: associative + keys: + - name + - name: hostAliases + type: + list: + elementType: + namedType: io.k8s.api.core.v1.HostAlias + elementRelationship: associative + keys: + - ip + - name: hostIPC + type: + scalar: boolean + - name: hostNetwork + type: + scalar: boolean + - name: hostPID + type: + scalar: boolean + - name: hostUsers + type: + scalar: boolean + - name: hostname + type: + scalar: string + - name: imagePullSecrets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LocalObjectReference + elementRelationship: associative + keys: + - name + - name: initContainers + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Container + elementRelationship: associative + keys: + - name + - name: nodeName + type: + scalar: string + - name: nodeSelector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: os + type: + namedType: io.k8s.api.core.v1.PodOS + - name: overhead + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: readinessGates + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodReadinessGate + elementRelationship: atomic + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodResourceClaim + elementRelationship: associative + keys: + - name + - name: restartPolicy + type: + scalar: string + - name: runtimeClassName + type: + scalar: string + - name: schedulerName + type: + scalar: string + - name: schedulingGates + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodSchedulingGate + elementRelationship: associative + keys: + - name + - name: securityContext + type: + namedType: io.k8s.api.core.v1.PodSecurityContext + - name: serviceAccount + type: + scalar: string + - name: serviceAccountName + type: + scalar: string + - name: setHostnameAsFQDN + type: + scalar: boolean + - name: shareProcessNamespace + type: + scalar: boolean + - name: subdomain + type: + scalar: string + - name: terminationGracePeriodSeconds + type: + scalar: numeric + - name: tolerations + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Toleration + elementRelationship: atomic + - name: topologySpreadConstraints + type: + list: + elementType: + namedType: io.k8s.api.core.v1.TopologySpreadConstraint + elementRelationship: associative + keys: + - topologyKey + - whenUnsatisfiable + - name: volumes + type: + list: + elementType: + namedType: io.k8s.api.core.v1.Volume + elementRelationship: associative + keys: + - name +- name: io.k8s.api.core.v1.PodStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodCondition + elementRelationship: associative + keys: + - type + - name: containerStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerStatus + elementRelationship: atomic + - name: ephemeralContainerStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerStatus + elementRelationship: atomic + - name: hostIP + type: + scalar: string + - name: hostIPs + type: + list: + elementType: + namedType: io.k8s.api.core.v1.HostIP + elementRelationship: atomic + - name: initContainerStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ContainerStatus + elementRelationship: atomic + - name: message + type: + scalar: string + - name: nominatedNodeName + type: + scalar: string + - name: phase + type: + scalar: string + - name: podIP + type: + scalar: string + - name: podIPs + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodIP + elementRelationship: associative + keys: + - ip + - name: qosClass + type: + scalar: string + - name: reason + type: + scalar: string + - name: resize + type: + scalar: string + - name: resourceClaimStatuses + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodResourceClaimStatus + elementRelationship: associative + keys: + - name + - name: startTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.core.v1.PodTemplate + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec + default: {} +- name: io.k8s.api.core.v1.PodTemplateSpec + map: + fields: + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.PodSpec + default: {} +- name: io.k8s.api.core.v1.PortStatus + map: + fields: + - name: error + type: + scalar: string + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PortworxVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: volumeID + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.PreferredSchedulingTerm + map: + fields: + - name: preference + type: + namedType: io.k8s.api.core.v1.NodeSelectorTerm + default: {} + - name: weight + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.Probe + map: + fields: + - name: exec + type: + namedType: io.k8s.api.core.v1.ExecAction + - name: failureThreshold + type: + scalar: numeric + - name: grpc + type: + namedType: io.k8s.api.core.v1.GRPCAction + - name: httpGet + type: + namedType: io.k8s.api.core.v1.HTTPGetAction + - name: initialDelaySeconds + type: + scalar: numeric + - name: periodSeconds + type: + scalar: numeric + - name: successThreshold + type: + scalar: numeric + - name: tcpSocket + type: + namedType: io.k8s.api.core.v1.TCPSocketAction + - name: terminationGracePeriodSeconds + type: + scalar: numeric + - name: timeoutSeconds + type: + scalar: numeric +- name: io.k8s.api.core.v1.ProjectedVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: sources + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeProjection + elementRelationship: atomic +- name: io.k8s.api.core.v1.QuobyteVolumeSource + map: + fields: + - name: group + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: registry + type: + scalar: string + default: "" + - name: tenant + type: + scalar: string + - name: user + type: + scalar: string + - name: volume + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.RBDPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: image + type: + scalar: string + default: "" + - name: keyring + type: + scalar: string + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: pool + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.RBDVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: image + type: + scalar: string + default: "" + - name: keyring + type: + scalar: string + - name: monitors + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: pool + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.ReplicationController + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.ReplicationControllerSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.ReplicationControllerStatus + default: {} +- name: io.k8s.api.core.v1.ReplicationControllerCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ReplicationControllerSpec + map: + fields: + - name: minReadySeconds + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + - name: selector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: template + type: + namedType: io.k8s.api.core.v1.PodTemplateSpec +- name: io.k8s.api.core.v1.ReplicationControllerStatus + map: + fields: + - name: availableReplicas + type: + scalar: numeric + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ReplicationControllerCondition + elementRelationship: associative + keys: + - type + - name: fullyLabeledReplicas + type: + scalar: numeric + - name: observedGeneration + type: + scalar: numeric + - name: readyReplicas + type: + scalar: numeric + - name: replicas + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.ResourceClaim + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ResourceFieldSelector + map: + fields: + - name: containerName + type: + scalar: string + - name: divisor + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: resource + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.ResourceQuota + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.ResourceQuotaSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.ResourceQuotaStatus + default: {} +- name: io.k8s.api.core.v1.ResourceQuotaSpec + map: + fields: + - name: hard + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: scopeSelector + type: + namedType: io.k8s.api.core.v1.ScopeSelector + - name: scopes + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.ResourceQuotaStatus + map: + fields: + - name: hard + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: used + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.ResourceRequirements + map: + fields: + - name: claims + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ResourceClaim + elementRelationship: associative + keys: + - name + - name: limits + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: requests + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.SELinuxOptions + map: + fields: + - name: level + type: + scalar: string + - name: role + type: + scalar: string + - name: type + type: + scalar: string + - name: user + type: + scalar: string +- name: io.k8s.api.core.v1.ScaleIOPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: gateway + type: + scalar: string + default: "" + - name: protectionDomain + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.SecretReference + - name: sslEnabled + type: + scalar: boolean + - name: storageMode + type: + scalar: string + - name: storagePool + type: + scalar: string + - name: system + type: + scalar: string + default: "" + - name: volumeName + type: + scalar: string +- name: io.k8s.api.core.v1.ScaleIOVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: gateway + type: + scalar: string + default: "" + - name: protectionDomain + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: sslEnabled + type: + scalar: boolean + - name: storageMode + type: + scalar: string + - name: storagePool + type: + scalar: string + - name: system + type: + scalar: string + default: "" + - name: volumeName + type: + scalar: string +- name: io.k8s.api.core.v1.ScopeSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ScopedResourceSelectorRequirement + elementRelationship: atomic + elementRelationship: atomic +- name: io.k8s.api.core.v1.ScopedResourceSelectorRequirement + map: + fields: + - name: operator + type: + scalar: string + default: "" + - name: scopeName + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.SeccompProfile + map: + fields: + - name: localhostProfile + type: + scalar: string + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: localhostProfile + discriminatorValue: LocalhostProfile +- name: io.k8s.api.core.v1.Secret + map: + fields: + - name: apiVersion + type: + scalar: string + - name: data + type: + map: + elementType: + scalar: string + - name: immutable + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: stringData + type: + map: + elementType: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.SecretEnvSource + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.SecretKeySelector + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean + elementRelationship: atomic +- name: io.k8s.api.core.v1.SecretProjection + map: + fields: + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" + - name: optional + type: + scalar: boolean +- name: io.k8s.api.core.v1.SecretReference + map: + fields: + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + elementRelationship: atomic +- name: io.k8s.api.core.v1.SecretVolumeSource + map: + fields: + - name: defaultMode + type: + scalar: numeric + - name: items + type: + list: + elementType: + namedType: io.k8s.api.core.v1.KeyToPath + elementRelationship: atomic + - name: optional + type: + scalar: boolean + - name: secretName + type: + scalar: string +- name: io.k8s.api.core.v1.SecurityContext + map: + fields: + - name: allowPrivilegeEscalation + type: + scalar: boolean + - name: appArmorProfile + type: + namedType: io.k8s.api.core.v1.AppArmorProfile + - name: capabilities + type: + namedType: io.k8s.api.core.v1.Capabilities + - name: privileged + type: + scalar: boolean + - name: procMount + type: + scalar: string + - name: readOnlyRootFilesystem + type: + scalar: boolean + - name: runAsGroup + type: + scalar: numeric + - name: runAsNonRoot + type: + scalar: boolean + - name: runAsUser + type: + scalar: numeric + - name: seLinuxOptions + type: + namedType: io.k8s.api.core.v1.SELinuxOptions + - name: seccompProfile + type: + namedType: io.k8s.api.core.v1.SeccompProfile + - name: windowsOptions + type: + namedType: io.k8s.api.core.v1.WindowsSecurityContextOptions +- name: io.k8s.api.core.v1.Service + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.core.v1.ServiceSpec + default: {} + - name: status + type: + namedType: io.k8s.api.core.v1.ServiceStatus + default: {} +- name: io.k8s.api.core.v1.ServiceAccount + map: + fields: + - name: apiVersion + type: + scalar: string + - name: automountServiceAccountToken + type: + scalar: boolean + - name: imagePullSecrets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.LocalObjectReference + elementRelationship: atomic + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: secrets + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ObjectReference + elementRelationship: associative + keys: + - name +- name: io.k8s.api.core.v1.ServiceAccountTokenProjection + map: + fields: + - name: audience + type: + scalar: string + - name: expirationSeconds + type: + scalar: numeric + - name: path + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.ServicePort + map: + fields: + - name: appProtocol + type: + scalar: string + - name: name + type: + scalar: string + - name: nodePort + type: + scalar: numeric + - name: port + type: + scalar: numeric + default: 0 + - name: protocol + type: + scalar: string + default: TCP + - name: targetPort + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.core.v1.ServiceSpec + map: + fields: + - name: allocateLoadBalancerNodePorts + type: + scalar: boolean + - name: clusterIP + type: + scalar: string + - name: clusterIPs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: externalIPs + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: externalName + type: + scalar: string + - name: externalTrafficPolicy + type: + scalar: string + - name: healthCheckNodePort + type: + scalar: numeric + - name: internalTrafficPolicy + type: + scalar: string + - name: ipFamilies + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: ipFamilyPolicy + type: + scalar: string + - name: loadBalancerClass + type: + scalar: string + - name: loadBalancerIP + type: + scalar: string + - name: loadBalancerSourceRanges + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: ports + type: + list: + elementType: + namedType: io.k8s.api.core.v1.ServicePort + elementRelationship: associative + keys: + - port + - protocol + - name: publishNotReadyAddresses + type: + scalar: boolean + - name: selector + type: + map: + elementType: + scalar: string + elementRelationship: atomic + - name: sessionAffinity + type: + scalar: string + - name: sessionAffinityConfig + type: + namedType: io.k8s.api.core.v1.SessionAffinityConfig + - name: trafficDistribution + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.core.v1.ServiceStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: loadBalancer + type: + namedType: io.k8s.api.core.v1.LoadBalancerStatus + default: {} +- name: io.k8s.api.core.v1.SessionAffinityConfig + map: + fields: + - name: clientIP + type: + namedType: io.k8s.api.core.v1.ClientIPConfig +- name: io.k8s.api.core.v1.SleepAction + map: + fields: + - name: seconds + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.StorageOSPersistentVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.ObjectReference + - name: volumeName + type: + scalar: string + - name: volumeNamespace + type: + scalar: string +- name: io.k8s.api.core.v1.StorageOSVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: readOnly + type: + scalar: boolean + - name: secretRef + type: + namedType: io.k8s.api.core.v1.LocalObjectReference + - name: volumeName + type: + scalar: string + - name: volumeNamespace + type: + scalar: string +- name: io.k8s.api.core.v1.Sysctl + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: value + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.TCPSocketAction + map: + fields: + - name: host + type: + scalar: string + - name: port + type: + namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString +- name: io.k8s.api.core.v1.Taint + map: + fields: + - name: effect + type: + scalar: string + default: "" + - name: key + type: + scalar: string + default: "" + - name: timeAdded + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: value + type: + scalar: string +- name: io.k8s.api.core.v1.Toleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + - name: tolerationSeconds + type: + scalar: numeric + - name: value + type: + scalar: string +- name: io.k8s.api.core.v1.TopologySpreadConstraint + map: + fields: + - name: labelSelector + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + - name: matchLabelKeys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: maxSkew + type: + scalar: numeric + default: 0 + - name: minDomains + type: + scalar: numeric + - name: nodeAffinityPolicy + type: + scalar: string + - name: nodeTaintsPolicy + type: + scalar: string + - name: topologyKey + type: + scalar: string + default: "" + - name: whenUnsatisfiable + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.TypedLocalObjectReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.core.v1.TypedObjectReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string +- name: io.k8s.api.core.v1.Volume + map: + fields: + - name: awsElasticBlockStore + type: + namedType: io.k8s.api.core.v1.AWSElasticBlockStoreVolumeSource + - name: azureDisk + type: + namedType: io.k8s.api.core.v1.AzureDiskVolumeSource + - name: azureFile + type: + namedType: io.k8s.api.core.v1.AzureFileVolumeSource + - name: cephfs + type: + namedType: io.k8s.api.core.v1.CephFSVolumeSource + - name: cinder + type: + namedType: io.k8s.api.core.v1.CinderVolumeSource + - name: configMap + type: + namedType: io.k8s.api.core.v1.ConfigMapVolumeSource + - name: csi + type: + namedType: io.k8s.api.core.v1.CSIVolumeSource + - name: downwardAPI + type: + namedType: io.k8s.api.core.v1.DownwardAPIVolumeSource + - name: emptyDir + type: + namedType: io.k8s.api.core.v1.EmptyDirVolumeSource + - name: ephemeral + type: + namedType: io.k8s.api.core.v1.EphemeralVolumeSource + - name: fc + type: + namedType: io.k8s.api.core.v1.FCVolumeSource + - name: flexVolume + type: + namedType: io.k8s.api.core.v1.FlexVolumeSource + - name: flocker + type: + namedType: io.k8s.api.core.v1.FlockerVolumeSource + - name: gcePersistentDisk + type: + namedType: io.k8s.api.core.v1.GCEPersistentDiskVolumeSource + - name: gitRepo + type: + namedType: io.k8s.api.core.v1.GitRepoVolumeSource + - name: glusterfs + type: + namedType: io.k8s.api.core.v1.GlusterfsVolumeSource + - name: hostPath + type: + namedType: io.k8s.api.core.v1.HostPathVolumeSource + - name: iscsi + type: + namedType: io.k8s.api.core.v1.ISCSIVolumeSource + - name: name + type: + scalar: string + default: "" + - name: nfs + type: + namedType: io.k8s.api.core.v1.NFSVolumeSource + - name: persistentVolumeClaim + type: + namedType: io.k8s.api.core.v1.PersistentVolumeClaimVolumeSource + - name: photonPersistentDisk + type: + namedType: io.k8s.api.core.v1.PhotonPersistentDiskVolumeSource + - name: portworxVolume + type: + namedType: io.k8s.api.core.v1.PortworxVolumeSource + - name: projected + type: + namedType: io.k8s.api.core.v1.ProjectedVolumeSource + - name: quobyte + type: + namedType: io.k8s.api.core.v1.QuobyteVolumeSource + - name: rbd + type: + namedType: io.k8s.api.core.v1.RBDVolumeSource + - name: scaleIO + type: + namedType: io.k8s.api.core.v1.ScaleIOVolumeSource + - name: secret + type: + namedType: io.k8s.api.core.v1.SecretVolumeSource + - name: storageos + type: + namedType: io.k8s.api.core.v1.StorageOSVolumeSource + - name: vsphereVolume + type: + namedType: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource +- name: io.k8s.api.core.v1.VolumeDevice + map: + fields: + - name: devicePath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.VolumeMount + map: + fields: + - name: mountPath + type: + scalar: string + default: "" + - name: mountPropagation + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean + - name: recursiveReadOnly + type: + scalar: string + - name: subPath + type: + scalar: string + - name: subPathExpr + type: + scalar: string +- name: io.k8s.api.core.v1.VolumeMountStatus + map: + fields: + - name: mountPath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: readOnly + type: + scalar: boolean + - name: recursiveReadOnly + type: + scalar: string +- name: io.k8s.api.core.v1.VolumeNodeAffinity + map: + fields: + - name: required + type: + namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.core.v1.VolumeProjection + map: + fields: + - name: clusterTrustBundle + type: + namedType: io.k8s.api.core.v1.ClusterTrustBundleProjection + - name: configMap + type: + namedType: io.k8s.api.core.v1.ConfigMapProjection + - name: downwardAPI + type: + namedType: io.k8s.api.core.v1.DownwardAPIProjection + - name: secret + type: + namedType: io.k8s.api.core.v1.SecretProjection + - name: serviceAccountToken + type: + namedType: io.k8s.api.core.v1.ServiceAccountTokenProjection +- name: io.k8s.api.core.v1.VolumeResourceRequirements + map: + fields: + - name: limits + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: requests + type: + map: + elementType: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.VsphereVirtualDiskVolumeSource + map: + fields: + - name: fsType + type: + scalar: string + - name: storagePolicyID + type: + scalar: string + - name: storagePolicyName + type: + scalar: string + - name: volumePath + type: + scalar: string + default: "" +- name: io.k8s.api.core.v1.WeightedPodAffinityTerm + map: + fields: + - name: podAffinityTerm + type: + namedType: io.k8s.api.core.v1.PodAffinityTerm + default: {} + - name: weight + type: + scalar: numeric + default: 0 +- name: io.k8s.api.core.v1.WindowsSecurityContextOptions + map: + fields: + - name: gmsaCredentialSpec + type: + scalar: string + - name: gmsaCredentialSpecName + type: + scalar: string + - name: hostProcess + type: + scalar: boolean + - name: runAsUserName + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1.ExemptPriorityLevelConfiguration + map: + fields: + - name: lendablePercent + type: + scalar: numeric + - name: nominalConcurrencyShares + type: + scalar: numeric +- name: io.k8s.api.flowcontrol.v1.FlowDistinguisherMethod + map: + fields: + - name: type + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1.FlowSchema + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.flowcontrol.v1.FlowSchemaSpec + default: {} + - name: status + type: + namedType: io.k8s.api.flowcontrol.v1.FlowSchemaStatus + default: {} +- name: io.k8s.api.flowcontrol.v1.FlowSchemaCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1.FlowSchemaSpec + map: + fields: + - name: distinguisherMethod + type: + namedType: io.k8s.api.flowcontrol.v1.FlowDistinguisherMethod + - name: matchingPrecedence + type: + scalar: numeric + default: 0 + - name: priorityLevelConfiguration + type: + namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationReference + default: {} + - name: rules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1.PolicyRulesWithSubjects + elementRelationship: atomic +- name: io.k8s.api.flowcontrol.v1.FlowSchemaStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1.FlowSchemaCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.flowcontrol.v1.GroupSubject + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1.LimitResponse + map: + fields: + - name: queuing + type: + namedType: io.k8s.api.flowcontrol.v1.QueuingConfiguration + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: queuing + discriminatorValue: Queuing +- name: io.k8s.api.flowcontrol.v1.LimitedPriorityLevelConfiguration + map: + fields: + - name: borrowingLimitPercent + type: + scalar: numeric + - name: lendablePercent + type: + scalar: numeric + - name: limitResponse + type: + namedType: io.k8s.api.flowcontrol.v1.LimitResponse + default: {} + - name: nominalConcurrencyShares + type: + scalar: numeric +- name: io.k8s.api.flowcontrol.v1.NonResourcePolicyRule + map: + fields: + - name: nonResourceURLs + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.flowcontrol.v1.PolicyRulesWithSubjects + map: + fields: + - name: nonResourceRules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1.NonResourcePolicyRule + elementRelationship: atomic + - name: resourceRules + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1.ResourcePolicyRule + elementRelationship: atomic + - name: subjects + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1.Subject + elementRelationship: atomic +- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfiguration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationSpec + default: {} + - name: status + type: + namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationStatus + default: {} +- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + - name: type + type: + scalar: string +- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationReference + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationSpec + map: + fields: + - name: exempt + type: + namedType: io.k8s.api.flowcontrol.v1.ExemptPriorityLevelConfiguration + - name: limited + type: + namedType: io.k8s.api.flowcontrol.v1.LimitedPriorityLevelConfiguration + - name: type + type: + scalar: string + default: "" + unions: + - discriminator: type + fields: + - fieldName: exempt + discriminatorValue: Exempt + - fieldName: limited + discriminatorValue: Limited +- name: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.api.flowcontrol.v1.PriorityLevelConfigurationCondition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.flowcontrol.v1.QueuingConfiguration + map: + fields: + - name: handSize + type: + scalar: numeric + default: 0 + - name: queueLengthLimit + type: + scalar: numeric + default: 0 + - name: queues + type: + scalar: numeric + default: 0 +- name: io.k8s.api.flowcontrol.v1.ResourcePolicyRule + map: + fields: + - name: apiGroups + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: clusterScope + type: + scalar: boolean + - name: namespaces + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: resources + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: verbs + type: + list: + elementType: + scalar: string + elementRelationship: associative +- name: io.k8s.api.flowcontrol.v1.ServiceAccountSubject + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" +- name: io.k8s.api.flowcontrol.v1.Subject + map: + fields: + - name: group + type: + namedType: io.k8s.api.flowcontrol.v1.GroupSubject + - name: kind + type: + scalar: string + default: "" + - name: serviceAccount + type: + namedType: io.k8s.api.flowcontrol.v1.ServiceAccountSubject + - name: user + type: + namedType: io.k8s.api.flowcontrol.v1.UserSubject + unions: + - discriminator: kind + fields: + - fieldName: group + discriminatorValue: Group + - fieldName: serviceAccount + discriminatorValue: ServiceAccount + - fieldName: user + discriminatorValue: User +- name: io.k8s.api.flowcontrol.v1.UserSubject + map: + fields: + - name: name + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceColumnDefinition + map: + fields: + - name: description + type: + scalar: string + - name: format + type: + scalar: string + - name: jsonPath + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceConversion + map: + fields: + - name: strategy + type: + scalar: string + default: "" + - name: webhook + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinition + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec + default: {} + - name: status + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionStatus + default: {} +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionCondition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionNames + map: + fields: + - name: categories + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: kind + type: + scalar: string + default: "" + - name: listKind + type: + scalar: string + - name: plural + type: + scalar: string + default: "" + - name: shortNames + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: singular + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec + map: + fields: + - name: conversion + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceConversion + - name: group + type: + scalar: string + default: "" + - name: names + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionNames + default: {} + - name: preserveUnknownFields + type: + scalar: boolean + - name: scope + type: + scalar: string + default: "" + - name: versions + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionStatus + map: + fields: + - name: acceptedNames + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionNames + default: {} + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionCondition + elementRelationship: associative + keys: + - type + - name: storedVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionVersion + map: + fields: + - name: additionalPrinterColumns + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceColumnDefinition + elementRelationship: atomic + - name: deprecated + type: + scalar: boolean + - name: deprecationWarning + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: schema + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceValidation + - name: selectableFields + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.SelectableField + elementRelationship: atomic + - name: served + type: + scalar: boolean + default: false + - name: storage + type: + scalar: boolean + default: false + - name: subresources + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresources +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceScale + map: + fields: + - name: labelSelectorPath + type: + scalar: string + - name: specReplicasPath + type: + scalar: string + default: "" + - name: statusReplicasPath + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceStatus + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresources + map: + fields: + - name: scale + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceScale + - name: status + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceSubresourceStatus +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceValidation + map: + fields: + - name: openAPIV3Schema + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ExternalDocumentation + map: + fields: + - name: description + type: + scalar: string + - name: url + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + map: + fields: + - name: $ref + type: + scalar: string + - name: $schema + type: + scalar: string + - name: additionalItems + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool + - name: additionalProperties + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool + - name: allOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + elementRelationship: atomic + - name: anyOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + elementRelationship: atomic + - name: default + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + - name: definitions + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: dependencies + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray + - name: description + type: + scalar: string + - name: enum + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + elementRelationship: atomic + - name: example + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSON + - name: exclusiveMaximum + type: + scalar: boolean + - name: exclusiveMinimum + type: + scalar: boolean + - name: externalDocs + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ExternalDocumentation + - name: format + type: + scalar: string + - name: id + type: + scalar: string + - name: items + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrArray + - name: maxItems + type: + scalar: numeric + - name: maxLength + type: + scalar: numeric + - name: maxProperties + type: + scalar: numeric + - name: maximum + type: + scalar: numeric + - name: minItems + type: + scalar: numeric + - name: minLength + type: + scalar: numeric + - name: minProperties + type: + scalar: numeric + - name: minimum + type: + scalar: numeric + - name: multipleOf + type: + scalar: numeric + - name: not + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: nullable + type: + scalar: boolean + - name: oneOf + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + elementRelationship: atomic + - name: pattern + type: + scalar: string + - name: patternProperties + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: properties + type: + map: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps + - name: required + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: title + type: + scalar: string + - name: type + type: + scalar: string + - name: uniqueItems + type: + scalar: boolean + - name: x-kubernetes-embedded-resource + type: + scalar: boolean + - name: x-kubernetes-int-or-string + type: + scalar: boolean + - name: x-kubernetes-list-map-keys + type: + list: + elementType: + scalar: string + elementRelationship: atomic + - name: x-kubernetes-list-type + type: + scalar: string + - name: x-kubernetes-map-type + type: + scalar: string + - name: x-kubernetes-preserve-unknown-fields + type: + scalar: boolean + - name: x-kubernetes-validations + type: + list: + elementType: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ValidationRule + elementRelationship: associative + keys: + - rule +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrArray + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrBool + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaPropsOrStringArray + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.SelectableField + map: + fields: + - name: jsonPath + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ServiceReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: namespace + type: + scalar: string + default: "" + - name: path + type: + scalar: string + - name: port + type: + scalar: numeric +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ValidationRule + map: + fields: + - name: fieldPath + type: + scalar: string + - name: message + type: + scalar: string + - name: messageExpression + type: + scalar: string + - name: optionalOldSelf + type: + scalar: boolean + - name: reason + type: + scalar: string + - name: rule + type: + scalar: string + default: "" +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig + map: + fields: + - name: caBundle + type: + scalar: string + - name: service + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.ServiceReference + - name: url + type: + scalar: string +- name: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookConversion + map: + fields: + - name: clientConfig + type: + namedType: io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.WebhookClientConfig + - name: conversionReviewVersions + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.api.resource.Quantity + scalar: untyped +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + map: + fields: + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + default: "" + - name: observedGeneration + type: + scalar: numeric + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: type + type: + scalar: string + default: "" +- name: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector + map: + fields: + - name: matchExpressions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + elementRelationship: atomic + - name: matchLabels + type: + map: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelectorRequirement + map: + fields: + - name: key + type: + scalar: string + default: "" + - name: operator + type: + scalar: string + default: "" + - name: values + type: + list: + elementType: + scalar: string + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + map: + fields: + - name: apiVersion + type: + scalar: string + - name: fieldsType + type: + scalar: string + - name: fieldsV1 + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.FieldsV1 + - name: manager + type: + scalar: string + - name: operation + type: + scalar: string + - name: subresource + type: + scalar: string + - name: time + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime + scalar: untyped +- name: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + map: + fields: + - name: annotations + type: + map: + elementType: + scalar: string + - name: creationTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: deletionGracePeriodSeconds + type: + scalar: numeric + - name: deletionTimestamp + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: finalizers + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: generateName + type: + scalar: string + - name: generation + type: + scalar: numeric + - name: labels + type: + map: + elementType: + scalar: string + - name: managedFields + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ManagedFieldsEntry + elementRelationship: atomic + - name: name + type: + scalar: string + - name: namespace + type: + scalar: string + - name: ownerReferences + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + elementRelationship: associative + keys: + - uid + - name: resourceVersion + type: + scalar: string + - name: selfLink + type: + scalar: string + - name: uid + type: + scalar: string +- name: io.k8s.apimachinery.pkg.apis.meta.v1.OwnerReference + map: + fields: + - name: apiVersion + type: + scalar: string + default: "" + - name: blockOwnerDeletion + type: + scalar: boolean + - name: controller + type: + scalar: boolean + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.apimachinery.pkg.apis.meta.v1.Time + scalar: untyped +- name: io.k8s.apimachinery.pkg.util.intstr.IntOrString + scalar: untyped +- name: __untyped_atomic_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic +- name: __untyped_deduced_ + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +`) diff --git a/pkg/generated/applyconfigurations/meta/v1/condition.go b/pkg/generated/applyconfigurations/meta/v1/condition.go new file mode 100644 index 00000000000..02a28f7c9fb --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/condition.go @@ -0,0 +1,77 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ConditionApplyConfiguration represents an declarative configuration of the Condition type for use +// with apply. +type ConditionApplyConfiguration struct { + Type *string `json:"type,omitempty"` + Status *v1.ConditionStatus `json:"status,omitempty"` + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + LastTransitionTime *v1.Time `json:"lastTransitionTime,omitempty"` + Reason *string `json:"reason,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ConditionApplyConfiguration constructs an declarative configuration of the Condition type for use with +// apply. +func Condition() *ConditionApplyConfiguration { + return &ConditionApplyConfiguration{} +} + +// WithType sets the Type field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Type field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithType(value string) *ConditionApplyConfiguration { + b.Type = &value + return b +} + +// WithStatus sets the Status field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Status field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithStatus(value v1.ConditionStatus) *ConditionApplyConfiguration { + b.Status = &value + return b +} + +// WithObservedGeneration sets the ObservedGeneration field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ObservedGeneration field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithObservedGeneration(value int64) *ConditionApplyConfiguration { + b.ObservedGeneration = &value + return b +} + +// WithLastTransitionTime sets the LastTransitionTime field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the LastTransitionTime field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithLastTransitionTime(value v1.Time) *ConditionApplyConfiguration { + b.LastTransitionTime = &value + return b +} + +// WithReason sets the Reason field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Reason field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithReason(value string) *ConditionApplyConfiguration { + b.Reason = &value + return b +} + +// WithMessage sets the Message field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Message field is set to the value of the last call. +func (b *ConditionApplyConfiguration) WithMessage(value string) *ConditionApplyConfiguration { + b.Message = &value + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/deleteoptions.go b/pkg/generated/applyconfigurations/meta/v1/deleteoptions.go new file mode 100644 index 00000000000..04beeca460f --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/deleteoptions.go @@ -0,0 +1,90 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// DeleteOptionsApplyConfiguration represents an declarative configuration of the DeleteOptions type for use +// with apply. +type DeleteOptionsApplyConfiguration struct { + TypeMetaApplyConfiguration `json:",inline"` + GracePeriodSeconds *int64 `json:"gracePeriodSeconds,omitempty"` + Preconditions *metav1.Preconditions `json:"preconditions,omitempty"` + OrphanDependents *bool `json:"orphanDependents,omitempty"` + PropagationPolicy *metav1.DeletionPropagation `json:"propagationPolicy,omitempty"` + DryRun []string `json:"dryRun,omitempty"` +} + +// DeleteOptionsApplyConfiguration constructs an declarative configuration of the DeleteOptions type for use with +// apply. +func DeleteOptions() *DeleteOptionsApplyConfiguration { + b := &DeleteOptionsApplyConfiguration{} + b.WithKind("DeleteOptions") + b.WithAPIVersion("meta.k8s.io/v1") + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *DeleteOptionsApplyConfiguration) WithKind(value string) *DeleteOptionsApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *DeleteOptionsApplyConfiguration) WithAPIVersion(value string) *DeleteOptionsApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithGracePeriodSeconds sets the GracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GracePeriodSeconds field is set to the value of the last call. +func (b *DeleteOptionsApplyConfiguration) WithGracePeriodSeconds(value int64) *DeleteOptionsApplyConfiguration { + b.GracePeriodSeconds = &value + return b +} + +// WithPreconditions sets the Preconditions field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Preconditions field is set to the value of the last call. +func (b *DeleteOptionsApplyConfiguration) WithPreconditions(value metav1.Preconditions) *DeleteOptionsApplyConfiguration { + b.Preconditions = &value + return b +} + +// WithOrphanDependents sets the OrphanDependents field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the OrphanDependents field is set to the value of the last call. +func (b *DeleteOptionsApplyConfiguration) WithOrphanDependents(value bool) *DeleteOptionsApplyConfiguration { + b.OrphanDependents = &value + return b +} + +// WithPropagationPolicy sets the PropagationPolicy field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the PropagationPolicy field is set to the value of the last call. +func (b *DeleteOptionsApplyConfiguration) WithPropagationPolicy(value metav1.DeletionPropagation) *DeleteOptionsApplyConfiguration { + b.PropagationPolicy = &value + return b +} + +// WithDryRun adds the given value to the DryRun field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the DryRun field. +func (b *DeleteOptionsApplyConfiguration) WithDryRun(values ...string) *DeleteOptionsApplyConfiguration { + for i := range values { + b.DryRun = append(b.DryRun, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/labelselector.go b/pkg/generated/applyconfigurations/meta/v1/labelselector.go new file mode 100644 index 00000000000..c5e7011ec05 --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/labelselector.go @@ -0,0 +1,48 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// LabelSelectorApplyConfiguration represents an declarative configuration of the LabelSelector type for use +// with apply. +type LabelSelectorApplyConfiguration struct { + MatchLabels map[string]string `json:"matchLabels,omitempty"` + MatchExpressions []LabelSelectorRequirementApplyConfiguration `json:"matchExpressions,omitempty"` +} + +// LabelSelectorApplyConfiguration constructs an declarative configuration of the LabelSelector type for use with +// apply. +func LabelSelector() *LabelSelectorApplyConfiguration { + return &LabelSelectorApplyConfiguration{} +} + +// WithMatchLabels puts the entries into the MatchLabels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the MatchLabels field, +// overwriting an existing map entries in MatchLabels field with the same key. +func (b *LabelSelectorApplyConfiguration) WithMatchLabels(entries map[string]string) *LabelSelectorApplyConfiguration { + if b.MatchLabels == nil && len(entries) > 0 { + b.MatchLabels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.MatchLabels[k] = v + } + return b +} + +// WithMatchExpressions adds the given value to the MatchExpressions field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the MatchExpressions field. +func (b *LabelSelectorApplyConfiguration) WithMatchExpressions(values ...*LabelSelectorRequirementApplyConfiguration) *LabelSelectorApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithMatchExpressions") + } + b.MatchExpressions = append(b.MatchExpressions, *values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/labelselectorrequirement.go b/pkg/generated/applyconfigurations/meta/v1/labelselectorrequirement.go new file mode 100644 index 00000000000..561b0ea4a74 --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/labelselectorrequirement.go @@ -0,0 +1,52 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// LabelSelectorRequirementApplyConfiguration represents an declarative configuration of the LabelSelectorRequirement type for use +// with apply. +type LabelSelectorRequirementApplyConfiguration struct { + Key *string `json:"key,omitempty"` + Operator *v1.LabelSelectorOperator `json:"operator,omitempty"` + Values []string `json:"values,omitempty"` +} + +// LabelSelectorRequirementApplyConfiguration constructs an declarative configuration of the LabelSelectorRequirement type for use with +// apply. +func LabelSelectorRequirement() *LabelSelectorRequirementApplyConfiguration { + return &LabelSelectorRequirementApplyConfiguration{} +} + +// WithKey sets the Key field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Key field is set to the value of the last call. +func (b *LabelSelectorRequirementApplyConfiguration) WithKey(value string) *LabelSelectorRequirementApplyConfiguration { + b.Key = &value + return b +} + +// WithOperator sets the Operator field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operator field is set to the value of the last call. +func (b *LabelSelectorRequirementApplyConfiguration) WithOperator(value v1.LabelSelectorOperator) *LabelSelectorRequirementApplyConfiguration { + b.Operator = &value + return b +} + +// WithValues adds the given value to the Values field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Values field. +func (b *LabelSelectorRequirementApplyConfiguration) WithValues(values ...string) *LabelSelectorRequirementApplyConfiguration { + for i := range values { + b.Values = append(b.Values, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/managedfieldsentry.go b/pkg/generated/applyconfigurations/meta/v1/managedfieldsentry.go new file mode 100644 index 00000000000..802ded55e9b --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/managedfieldsentry.go @@ -0,0 +1,86 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ManagedFieldsEntryApplyConfiguration represents an declarative configuration of the ManagedFieldsEntry type for use +// with apply. +type ManagedFieldsEntryApplyConfiguration struct { + Manager *string `json:"manager,omitempty"` + Operation *v1.ManagedFieldsOperationType `json:"operation,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` + Time *v1.Time `json:"time,omitempty"` + FieldsType *string `json:"fieldsType,omitempty"` + FieldsV1 *v1.FieldsV1 `json:"fieldsV1,omitempty"` + Subresource *string `json:"subresource,omitempty"` +} + +// ManagedFieldsEntryApplyConfiguration constructs an declarative configuration of the ManagedFieldsEntry type for use with +// apply. +func ManagedFieldsEntry() *ManagedFieldsEntryApplyConfiguration { + return &ManagedFieldsEntryApplyConfiguration{} +} + +// WithManager sets the Manager field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Manager field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithManager(value string) *ManagedFieldsEntryApplyConfiguration { + b.Manager = &value + return b +} + +// WithOperation sets the Operation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Operation field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithOperation(value v1.ManagedFieldsOperationType) *ManagedFieldsEntryApplyConfiguration { + b.Operation = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithAPIVersion(value string) *ManagedFieldsEntryApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithTime sets the Time field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Time field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithTime(value v1.Time) *ManagedFieldsEntryApplyConfiguration { + b.Time = &value + return b +} + +// WithFieldsType sets the FieldsType field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldsType field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsType(value string) *ManagedFieldsEntryApplyConfiguration { + b.FieldsType = &value + return b +} + +// WithFieldsV1 sets the FieldsV1 field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the FieldsV1 field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithFieldsV1(value v1.FieldsV1) *ManagedFieldsEntryApplyConfiguration { + b.FieldsV1 = &value + return b +} + +// WithSubresource sets the Subresource field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Subresource field is set to the value of the last call. +func (b *ManagedFieldsEntryApplyConfiguration) WithSubresource(value string) *ManagedFieldsEntryApplyConfiguration { + b.Subresource = &value + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/objectmeta.go b/pkg/generated/applyconfigurations/meta/v1/objectmeta.go new file mode 100644 index 00000000000..1fd9c158398 --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/objectmeta.go @@ -0,0 +1,160 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" +) + +// ObjectMetaApplyConfiguration represents an declarative configuration of the ObjectMeta type for use +// with apply. +type ObjectMetaApplyConfiguration struct { + Name *string `json:"name,omitempty"` + GenerateName *string `json:"generateName,omitempty"` + Namespace *string `json:"namespace,omitempty"` + UID *types.UID `json:"uid,omitempty"` + ResourceVersion *string `json:"resourceVersion,omitempty"` + Generation *int64 `json:"generation,omitempty"` + CreationTimestamp *v1.Time `json:"creationTimestamp,omitempty"` + DeletionTimestamp *v1.Time `json:"deletionTimestamp,omitempty"` + DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"` + Labels map[string]string `json:"labels,omitempty"` + Annotations map[string]string `json:"annotations,omitempty"` + OwnerReferences []OwnerReferenceApplyConfiguration `json:"ownerReferences,omitempty"` + Finalizers []string `json:"finalizers,omitempty"` +} + +// ObjectMetaApplyConfiguration constructs an declarative configuration of the ObjectMeta type for use with +// apply. +func ObjectMeta() *ObjectMetaApplyConfiguration { + return &ObjectMetaApplyConfiguration{} +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithName(value string) *ObjectMetaApplyConfiguration { + b.Name = &value + return b +} + +// WithGenerateName sets the GenerateName field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the GenerateName field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithGenerateName(value string) *ObjectMetaApplyConfiguration { + b.GenerateName = &value + return b +} + +// WithNamespace sets the Namespace field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Namespace field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithNamespace(value string) *ObjectMetaApplyConfiguration { + b.Namespace = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithUID(value types.UID) *ObjectMetaApplyConfiguration { + b.UID = &value + return b +} + +// WithResourceVersion sets the ResourceVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the ResourceVersion field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithResourceVersion(value string) *ObjectMetaApplyConfiguration { + b.ResourceVersion = &value + return b +} + +// WithGeneration sets the Generation field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Generation field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithGeneration(value int64) *ObjectMetaApplyConfiguration { + b.Generation = &value + return b +} + +// WithCreationTimestamp sets the CreationTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the CreationTimestamp field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithCreationTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { + b.CreationTimestamp = &value + return b +} + +// WithDeletionTimestamp sets the DeletionTimestamp field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionTimestamp field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithDeletionTimestamp(value v1.Time) *ObjectMetaApplyConfiguration { + b.DeletionTimestamp = &value + return b +} + +// WithDeletionGracePeriodSeconds sets the DeletionGracePeriodSeconds field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the DeletionGracePeriodSeconds field is set to the value of the last call. +func (b *ObjectMetaApplyConfiguration) WithDeletionGracePeriodSeconds(value int64) *ObjectMetaApplyConfiguration { + b.DeletionGracePeriodSeconds = &value + return b +} + +// WithLabels puts the entries into the Labels field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Labels field, +// overwriting an existing map entries in Labels field with the same key. +func (b *ObjectMetaApplyConfiguration) WithLabels(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Labels == nil && len(entries) > 0 { + b.Labels = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Labels[k] = v + } + return b +} + +// WithAnnotations puts the entries into the Annotations field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, the entries provided by each call will be put on the Annotations field, +// overwriting an existing map entries in Annotations field with the same key. +func (b *ObjectMetaApplyConfiguration) WithAnnotations(entries map[string]string) *ObjectMetaApplyConfiguration { + if b.Annotations == nil && len(entries) > 0 { + b.Annotations = make(map[string]string, len(entries)) + } + for k, v := range entries { + b.Annotations[k] = v + } + return b +} + +// WithOwnerReferences adds the given value to the OwnerReferences field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the OwnerReferences field. +func (b *ObjectMetaApplyConfiguration) WithOwnerReferences(values ...*OwnerReferenceApplyConfiguration) *ObjectMetaApplyConfiguration { + for i := range values { + if values[i] == nil { + panic("nil value passed to WithOwnerReferences") + } + b.OwnerReferences = append(b.OwnerReferences, *values[i]) + } + return b +} + +// WithFinalizers adds the given value to the Finalizers field in the declarative configuration +// and returns the receiver, so that objects can be build by chaining "With" function invocations. +// If called multiple times, values provided by each call will be appended to the Finalizers field. +func (b *ObjectMetaApplyConfiguration) WithFinalizers(values ...string) *ObjectMetaApplyConfiguration { + for i := range values { + b.Finalizers = append(b.Finalizers, values[i]) + } + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/ownerreference.go b/pkg/generated/applyconfigurations/meta/v1/ownerreference.go new file mode 100644 index 00000000000..9aabbfdf562 --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/ownerreference.go @@ -0,0 +1,77 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +import ( + types "k8s.io/apimachinery/pkg/types" +) + +// OwnerReferenceApplyConfiguration represents an declarative configuration of the OwnerReference type for use +// with apply. +type OwnerReferenceApplyConfiguration struct { + APIVersion *string `json:"apiVersion,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + UID *types.UID `json:"uid,omitempty"` + Controller *bool `json:"controller,omitempty"` + BlockOwnerDeletion *bool `json:"blockOwnerDeletion,omitempty"` +} + +// OwnerReferenceApplyConfiguration constructs an declarative configuration of the OwnerReference type for use with +// apply. +func OwnerReference() *OwnerReferenceApplyConfiguration { + return &OwnerReferenceApplyConfiguration{} +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithAPIVersion(value string) *OwnerReferenceApplyConfiguration { + b.APIVersion = &value + return b +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithKind(value string) *OwnerReferenceApplyConfiguration { + b.Kind = &value + return b +} + +// WithName sets the Name field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Name field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithName(value string) *OwnerReferenceApplyConfiguration { + b.Name = &value + return b +} + +// WithUID sets the UID field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the UID field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithUID(value types.UID) *OwnerReferenceApplyConfiguration { + b.UID = &value + return b +} + +// WithController sets the Controller field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Controller field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithController(value bool) *OwnerReferenceApplyConfiguration { + b.Controller = &value + return b +} + +// WithBlockOwnerDeletion sets the BlockOwnerDeletion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the BlockOwnerDeletion field is set to the value of the last call. +func (b *OwnerReferenceApplyConfiguration) WithBlockOwnerDeletion(value bool) *OwnerReferenceApplyConfiguration { + b.BlockOwnerDeletion = &value + return b +} diff --git a/pkg/generated/applyconfigurations/meta/v1/typemeta.go b/pkg/generated/applyconfigurations/meta/v1/typemeta.go new file mode 100644 index 00000000000..0b30f8ed398 --- /dev/null +++ b/pkg/generated/applyconfigurations/meta/v1/typemeta.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package v1 + +// TypeMetaApplyConfiguration represents an declarative configuration of the TypeMeta type for use +// with apply. +type TypeMetaApplyConfiguration struct { + Kind *string `json:"kind,omitempty"` + APIVersion *string `json:"apiVersion,omitempty"` +} + +// TypeMetaApplyConfiguration constructs an declarative configuration of the TypeMeta type for use with +// apply. +func TypeMeta() *TypeMetaApplyConfiguration { + return &TypeMetaApplyConfiguration{} +} + +// WithKind sets the Kind field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the Kind field is set to the value of the last call. +func (b *TypeMetaApplyConfiguration) WithKind(value string) *TypeMetaApplyConfiguration { + b.Kind = &value + return b +} + +// WithAPIVersion sets the APIVersion field in the declarative configuration to the given value +// and returns the receiver, so that objects can be built by chaining "With" function invocations. +// If called multiple times, the APIVersion field is set to the value of the last call. +func (b *TypeMetaApplyConfiguration) WithAPIVersion(value string) *TypeMetaApplyConfiguration { + b.APIVersion = &value + return b +} diff --git a/pkg/generated/applyconfigurations/utils.go b/pkg/generated/applyconfigurations/utils.go new file mode 100644 index 00000000000..fe6fa517b94 --- /dev/null +++ b/pkg/generated/applyconfigurations/utils.go @@ -0,0 +1,577 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by applyconfiguration-gen. DO NOT EDIT. + +package applyconfigurations + +import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + apiextensionsv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apiextensions/v1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" + applyconfigurationsautoscalingv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/autoscaling/v1" + applyconfigurationscoordinationv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/coordination/v1" + applyconfigurationscorev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" + applyconfigurationsflowcontrolv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/flowcontrol/v1" + applyconfigurationsmetav1 "github.com/superproj/onex/pkg/generated/applyconfigurations/meta/v1" + autoscalingv1 "k8s.io/api/autoscaling/v1" + coordinationv1 "k8s.io/api/coordination/v1" + corev1 "k8s.io/api/core/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + clientgoapplyconfigurationsmetav1 "k8s.io/client-go/applyconfigurations/meta/v1" +) + +// ForKind returns an apply configuration type for the given GroupVersionKind, or nil if no +// apply configuration type exists for the given GroupVersionKind. +func ForKind(kind schema.GroupVersionKind) interface{} { + switch kind { + // Group=apiextensions.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithKind("CustomResourceColumnDefinition"): + return &apiextensionsv1.CustomResourceColumnDefinitionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceConversion"): + return &apiextensionsv1.CustomResourceConversionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceDefinition"): + return &apiextensionsv1.CustomResourceDefinitionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceDefinitionCondition"): + return &apiextensionsv1.CustomResourceDefinitionConditionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceDefinitionNames"): + return &apiextensionsv1.CustomResourceDefinitionNamesApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceDefinitionSpec"): + return &apiextensionsv1.CustomResourceDefinitionSpecApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceDefinitionStatus"): + return &apiextensionsv1.CustomResourceDefinitionStatusApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceDefinitionVersion"): + return &apiextensionsv1.CustomResourceDefinitionVersionApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceSubresources"): + return &apiextensionsv1.CustomResourceSubresourcesApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceSubresourceScale"): + return &apiextensionsv1.CustomResourceSubresourceScaleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("CustomResourceValidation"): + return &apiextensionsv1.CustomResourceValidationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ExternalDocumentation"): + return &apiextensionsv1.ExternalDocumentationApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("JSONSchemaProps"): + return &apiextensionsv1.JSONSchemaPropsApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("SelectableField"): + return &apiextensionsv1.SelectableFieldApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ServiceReference"): + return &apiextensionsv1.ServiceReferenceApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("ValidationRule"): + return &apiextensionsv1.ValidationRuleApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("WebhookClientConfig"): + return &apiextensionsv1.WebhookClientConfigApplyConfiguration{} + case v1.SchemeGroupVersion.WithKind("WebhookConversion"): + return &apiextensionsv1.WebhookConversionApplyConfiguration{} + + // Group=apps.onex.io, Version=v1beta1 + case v1beta1.SchemeGroupVersion.WithKind("Chain"): + return &appsv1beta1.ChainApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ChainSpec"): + return &appsv1beta1.ChainSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ChainStatus"): + return &appsv1beta1.ChainStatusApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ChargeRequest"): + return &appsv1beta1.ChargeRequestApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ChargeRequestSpec"): + return &appsv1beta1.ChargeRequestSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ChargeRequestStatus"): + return &appsv1beta1.ChargeRequestStatusApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("Condition"): + return &appsv1beta1.ConditionApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("LocalObjectReference"): + return &appsv1beta1.LocalObjectReferenceApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("Miner"): + return &appsv1beta1.MinerApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerAddress"): + return &appsv1beta1.MinerAddressApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerSet"): + return &appsv1beta1.MinerSetApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerSetSpec"): + return &appsv1beta1.MinerSetSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerSetStatus"): + return &appsv1beta1.MinerSetStatusApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerSpec"): + return &appsv1beta1.MinerSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerStatus"): + return &appsv1beta1.MinerStatusApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("MinerTemplateSpec"): + return &appsv1beta1.MinerTemplateSpecApplyConfiguration{} + case v1beta1.SchemeGroupVersion.WithKind("ObjectMeta"): + return &appsv1beta1.ObjectMetaApplyConfiguration{} + + // Group=autoscaling, Version=v1 + case autoscalingv1.SchemeGroupVersion.WithKind("CrossVersionObjectReference"): + return &applyconfigurationsautoscalingv1.CrossVersionObjectReferenceApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscaler"): + return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerSpec"): + return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerSpecApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("HorizontalPodAutoscalerStatus"): + return &applyconfigurationsautoscalingv1.HorizontalPodAutoscalerStatusApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("Scale"): + return &applyconfigurationsautoscalingv1.ScaleApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("ScaleSpec"): + return &applyconfigurationsautoscalingv1.ScaleSpecApplyConfiguration{} + case autoscalingv1.SchemeGroupVersion.WithKind("ScaleStatus"): + return &applyconfigurationsautoscalingv1.ScaleStatusApplyConfiguration{} + + // Group=coordination.k8s.io, Version=v1 + case coordinationv1.SchemeGroupVersion.WithKind("Lease"): + return &applyconfigurationscoordinationv1.LeaseApplyConfiguration{} + case coordinationv1.SchemeGroupVersion.WithKind("LeaseSpec"): + return &applyconfigurationscoordinationv1.LeaseSpecApplyConfiguration{} + + // Group=core, Version=v1 + case corev1.SchemeGroupVersion.WithKind("Affinity"): + return &applyconfigurationscorev1.AffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AppArmorProfile"): + return &applyconfigurationscorev1.AppArmorProfileApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AttachedVolume"): + return &applyconfigurationscorev1.AttachedVolumeApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AWSElasticBlockStoreVolumeSource"): + return &applyconfigurationscorev1.AWSElasticBlockStoreVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AzureDiskVolumeSource"): + return &applyconfigurationscorev1.AzureDiskVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AzureFilePersistentVolumeSource"): + return &applyconfigurationscorev1.AzureFilePersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("AzureFileVolumeSource"): + return &applyconfigurationscorev1.AzureFileVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Capabilities"): + return &applyconfigurationscorev1.CapabilitiesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("CephFSPersistentVolumeSource"): + return &applyconfigurationscorev1.CephFSPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("CephFSVolumeSource"): + return &applyconfigurationscorev1.CephFSVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("CinderPersistentVolumeSource"): + return &applyconfigurationscorev1.CinderPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("CinderVolumeSource"): + return &applyconfigurationscorev1.CinderVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ClaimSource"): + return &applyconfigurationscorev1.ClaimSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ClientIPConfig"): + return &applyconfigurationscorev1.ClientIPConfigApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ClusterTrustBundleProjection"): + return &applyconfigurationscorev1.ClusterTrustBundleProjectionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ComponentCondition"): + return &applyconfigurationscorev1.ComponentConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ComponentStatus"): + return &applyconfigurationscorev1.ComponentStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ConfigMap"): + return &applyconfigurationscorev1.ConfigMapApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ConfigMapEnvSource"): + return &applyconfigurationscorev1.ConfigMapEnvSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ConfigMapKeySelector"): + return &applyconfigurationscorev1.ConfigMapKeySelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ConfigMapNodeConfigSource"): + return &applyconfigurationscorev1.ConfigMapNodeConfigSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ConfigMapProjection"): + return &applyconfigurationscorev1.ConfigMapProjectionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ConfigMapVolumeSource"): + return &applyconfigurationscorev1.ConfigMapVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Container"): + return &applyconfigurationscorev1.ContainerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerImage"): + return &applyconfigurationscorev1.ContainerImageApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerPort"): + return &applyconfigurationscorev1.ContainerPortApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerResizePolicy"): + return &applyconfigurationscorev1.ContainerResizePolicyApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerState"): + return &applyconfigurationscorev1.ContainerStateApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerStateRunning"): + return &applyconfigurationscorev1.ContainerStateRunningApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerStateTerminated"): + return &applyconfigurationscorev1.ContainerStateTerminatedApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerStateWaiting"): + return &applyconfigurationscorev1.ContainerStateWaitingApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ContainerStatus"): + return &applyconfigurationscorev1.ContainerStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("CSIPersistentVolumeSource"): + return &applyconfigurationscorev1.CSIPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("CSIVolumeSource"): + return &applyconfigurationscorev1.CSIVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("DaemonEndpoint"): + return &applyconfigurationscorev1.DaemonEndpointApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("DownwardAPIProjection"): + return &applyconfigurationscorev1.DownwardAPIProjectionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("DownwardAPIVolumeFile"): + return &applyconfigurationscorev1.DownwardAPIVolumeFileApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("DownwardAPIVolumeSource"): + return &applyconfigurationscorev1.DownwardAPIVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EmptyDirVolumeSource"): + return &applyconfigurationscorev1.EmptyDirVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EndpointAddress"): + return &applyconfigurationscorev1.EndpointAddressApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EndpointPort"): + return &applyconfigurationscorev1.EndpointPortApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Endpoints"): + return &applyconfigurationscorev1.EndpointsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EndpointSubset"): + return &applyconfigurationscorev1.EndpointSubsetApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EnvFromSource"): + return &applyconfigurationscorev1.EnvFromSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EnvVar"): + return &applyconfigurationscorev1.EnvVarApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EnvVarSource"): + return &applyconfigurationscorev1.EnvVarSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EphemeralContainer"): + return &applyconfigurationscorev1.EphemeralContainerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EphemeralContainerCommon"): + return &applyconfigurationscorev1.EphemeralContainerCommonApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EphemeralVolumeSource"): + return &applyconfigurationscorev1.EphemeralVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Event"): + return &applyconfigurationscorev1.EventApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EventSeries"): + return &applyconfigurationscorev1.EventSeriesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("EventSource"): + return &applyconfigurationscorev1.EventSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ExecAction"): + return &applyconfigurationscorev1.ExecActionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("FCVolumeSource"): + return &applyconfigurationscorev1.FCVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("FlexPersistentVolumeSource"): + return &applyconfigurationscorev1.FlexPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("FlexVolumeSource"): + return &applyconfigurationscorev1.FlexVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("FlockerVolumeSource"): + return &applyconfigurationscorev1.FlockerVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("GCEPersistentDiskVolumeSource"): + return &applyconfigurationscorev1.GCEPersistentDiskVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("GitRepoVolumeSource"): + return &applyconfigurationscorev1.GitRepoVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("GlusterfsPersistentVolumeSource"): + return &applyconfigurationscorev1.GlusterfsPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("GlusterfsVolumeSource"): + return &applyconfigurationscorev1.GlusterfsVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("GRPCAction"): + return &applyconfigurationscorev1.GRPCActionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("HostAlias"): + return &applyconfigurationscorev1.HostAliasApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("HostIP"): + return &applyconfigurationscorev1.HostIPApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("HostPathVolumeSource"): + return &applyconfigurationscorev1.HostPathVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("HTTPGetAction"): + return &applyconfigurationscorev1.HTTPGetActionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("HTTPHeader"): + return &applyconfigurationscorev1.HTTPHeaderApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ISCSIPersistentVolumeSource"): + return &applyconfigurationscorev1.ISCSIPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ISCSIVolumeSource"): + return &applyconfigurationscorev1.ISCSIVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("KeyToPath"): + return &applyconfigurationscorev1.KeyToPathApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Lifecycle"): + return &applyconfigurationscorev1.LifecycleApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LifecycleHandler"): + return &applyconfigurationscorev1.LifecycleHandlerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LimitRange"): + return &applyconfigurationscorev1.LimitRangeApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LimitRangeItem"): + return &applyconfigurationscorev1.LimitRangeItemApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LimitRangeSpec"): + return &applyconfigurationscorev1.LimitRangeSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LoadBalancerIngress"): + return &applyconfigurationscorev1.LoadBalancerIngressApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LoadBalancerStatus"): + return &applyconfigurationscorev1.LoadBalancerStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LocalObjectReference"): + return &applyconfigurationscorev1.LocalObjectReferenceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("LocalVolumeSource"): + return &applyconfigurationscorev1.LocalVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ModifyVolumeStatus"): + return &applyconfigurationscorev1.ModifyVolumeStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Namespace"): + return &applyconfigurationscorev1.NamespaceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NamespaceCondition"): + return &applyconfigurationscorev1.NamespaceConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NamespaceSpec"): + return &applyconfigurationscorev1.NamespaceSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NamespaceStatus"): + return &applyconfigurationscorev1.NamespaceStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NFSVolumeSource"): + return &applyconfigurationscorev1.NFSVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Node"): + return &applyconfigurationscorev1.NodeApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeAddress"): + return &applyconfigurationscorev1.NodeAddressApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeAffinity"): + return &applyconfigurationscorev1.NodeAffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeCondition"): + return &applyconfigurationscorev1.NodeConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeConfigSource"): + return &applyconfigurationscorev1.NodeConfigSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeConfigStatus"): + return &applyconfigurationscorev1.NodeConfigStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeDaemonEndpoints"): + return &applyconfigurationscorev1.NodeDaemonEndpointsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandler"): + return &applyconfigurationscorev1.NodeRuntimeHandlerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeRuntimeHandlerFeatures"): + return &applyconfigurationscorev1.NodeRuntimeHandlerFeaturesApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeSelector"): + return &applyconfigurationscorev1.NodeSelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeSelectorRequirement"): + return &applyconfigurationscorev1.NodeSelectorRequirementApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeSelectorTerm"): + return &applyconfigurationscorev1.NodeSelectorTermApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeSpec"): + return &applyconfigurationscorev1.NodeSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeStatus"): + return &applyconfigurationscorev1.NodeStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("NodeSystemInfo"): + return &applyconfigurationscorev1.NodeSystemInfoApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ObjectFieldSelector"): + return &applyconfigurationscorev1.ObjectFieldSelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ObjectReference"): + return &applyconfigurationscorev1.ObjectReferenceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolume"): + return &applyconfigurationscorev1.PersistentVolumeApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaim"): + return &applyconfigurationscorev1.PersistentVolumeClaimApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimCondition"): + return &applyconfigurationscorev1.PersistentVolumeClaimConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimSpec"): + return &applyconfigurationscorev1.PersistentVolumeClaimSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimStatus"): + return &applyconfigurationscorev1.PersistentVolumeClaimStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimTemplate"): + return &applyconfigurationscorev1.PersistentVolumeClaimTemplateApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeClaimVolumeSource"): + return &applyconfigurationscorev1.PersistentVolumeClaimVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeSource"): + return &applyconfigurationscorev1.PersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeSpec"): + return &applyconfigurationscorev1.PersistentVolumeSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PersistentVolumeStatus"): + return &applyconfigurationscorev1.PersistentVolumeStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PhotonPersistentDiskVolumeSource"): + return &applyconfigurationscorev1.PhotonPersistentDiskVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Pod"): + return &applyconfigurationscorev1.PodApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodAffinity"): + return &applyconfigurationscorev1.PodAffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodAffinityTerm"): + return &applyconfigurationscorev1.PodAffinityTermApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodAntiAffinity"): + return &applyconfigurationscorev1.PodAntiAffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodCondition"): + return &applyconfigurationscorev1.PodConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodDNSConfig"): + return &applyconfigurationscorev1.PodDNSConfigApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodDNSConfigOption"): + return &applyconfigurationscorev1.PodDNSConfigOptionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodIP"): + return &applyconfigurationscorev1.PodIPApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodOS"): + return &applyconfigurationscorev1.PodOSApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodReadinessGate"): + return &applyconfigurationscorev1.PodReadinessGateApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodResourceClaim"): + return &applyconfigurationscorev1.PodResourceClaimApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodResourceClaimStatus"): + return &applyconfigurationscorev1.PodResourceClaimStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodSchedulingGate"): + return &applyconfigurationscorev1.PodSchedulingGateApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodSecurityContext"): + return &applyconfigurationscorev1.PodSecurityContextApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodSpec"): + return &applyconfigurationscorev1.PodSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodStatus"): + return &applyconfigurationscorev1.PodStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodTemplate"): + return &applyconfigurationscorev1.PodTemplateApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PodTemplateSpec"): + return &applyconfigurationscorev1.PodTemplateSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PortStatus"): + return &applyconfigurationscorev1.PortStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PortworxVolumeSource"): + return &applyconfigurationscorev1.PortworxVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("PreferredSchedulingTerm"): + return &applyconfigurationscorev1.PreferredSchedulingTermApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Probe"): + return &applyconfigurationscorev1.ProbeApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ProbeHandler"): + return &applyconfigurationscorev1.ProbeHandlerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ProjectedVolumeSource"): + return &applyconfigurationscorev1.ProjectedVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("QuobyteVolumeSource"): + return &applyconfigurationscorev1.QuobyteVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("RBDPersistentVolumeSource"): + return &applyconfigurationscorev1.RBDPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("RBDVolumeSource"): + return &applyconfigurationscorev1.RBDVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ReplicationController"): + return &applyconfigurationscorev1.ReplicationControllerApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ReplicationControllerCondition"): + return &applyconfigurationscorev1.ReplicationControllerConditionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ReplicationControllerSpec"): + return &applyconfigurationscorev1.ReplicationControllerSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ReplicationControllerStatus"): + return &applyconfigurationscorev1.ReplicationControllerStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceClaim"): + return &applyconfigurationscorev1.ResourceClaimApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceFieldSelector"): + return &applyconfigurationscorev1.ResourceFieldSelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceQuota"): + return &applyconfigurationscorev1.ResourceQuotaApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceQuotaSpec"): + return &applyconfigurationscorev1.ResourceQuotaSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceQuotaStatus"): + return &applyconfigurationscorev1.ResourceQuotaStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ResourceRequirements"): + return &applyconfigurationscorev1.ResourceRequirementsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ScaleIOPersistentVolumeSource"): + return &applyconfigurationscorev1.ScaleIOPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ScaleIOVolumeSource"): + return &applyconfigurationscorev1.ScaleIOVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ScopedResourceSelectorRequirement"): + return &applyconfigurationscorev1.ScopedResourceSelectorRequirementApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ScopeSelector"): + return &applyconfigurationscorev1.ScopeSelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SeccompProfile"): + return &applyconfigurationscorev1.SeccompProfileApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Secret"): + return &applyconfigurationscorev1.SecretApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SecretEnvSource"): + return &applyconfigurationscorev1.SecretEnvSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SecretKeySelector"): + return &applyconfigurationscorev1.SecretKeySelectorApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SecretProjection"): + return &applyconfigurationscorev1.SecretProjectionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SecretReference"): + return &applyconfigurationscorev1.SecretReferenceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SecretVolumeSource"): + return &applyconfigurationscorev1.SecretVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SecurityContext"): + return &applyconfigurationscorev1.SecurityContextApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SELinuxOptions"): + return &applyconfigurationscorev1.SELinuxOptionsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Service"): + return &applyconfigurationscorev1.ServiceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ServiceAccount"): + return &applyconfigurationscorev1.ServiceAccountApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ServiceAccountTokenProjection"): + return &applyconfigurationscorev1.ServiceAccountTokenProjectionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ServicePort"): + return &applyconfigurationscorev1.ServicePortApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ServiceSpec"): + return &applyconfigurationscorev1.ServiceSpecApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("ServiceStatus"): + return &applyconfigurationscorev1.ServiceStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SessionAffinityConfig"): + return &applyconfigurationscorev1.SessionAffinityConfigApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("SleepAction"): + return &applyconfigurationscorev1.SleepActionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("StorageOSPersistentVolumeSource"): + return &applyconfigurationscorev1.StorageOSPersistentVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("StorageOSVolumeSource"): + return &applyconfigurationscorev1.StorageOSVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Sysctl"): + return &applyconfigurationscorev1.SysctlApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Taint"): + return &applyconfigurationscorev1.TaintApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("TCPSocketAction"): + return &applyconfigurationscorev1.TCPSocketActionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Toleration"): + return &applyconfigurationscorev1.TolerationApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("TopologySpreadConstraint"): + return &applyconfigurationscorev1.TopologySpreadConstraintApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("TypedLocalObjectReference"): + return &applyconfigurationscorev1.TypedLocalObjectReferenceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("TypedObjectReference"): + return &applyconfigurationscorev1.TypedObjectReferenceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("Volume"): + return &applyconfigurationscorev1.VolumeApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeDevice"): + return &applyconfigurationscorev1.VolumeDeviceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeMount"): + return &applyconfigurationscorev1.VolumeMountApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeMountStatus"): + return &applyconfigurationscorev1.VolumeMountStatusApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeNodeAffinity"): + return &applyconfigurationscorev1.VolumeNodeAffinityApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeProjection"): + return &applyconfigurationscorev1.VolumeProjectionApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeResourceRequirements"): + return &applyconfigurationscorev1.VolumeResourceRequirementsApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VolumeSource"): + return &applyconfigurationscorev1.VolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("VsphereVirtualDiskVolumeSource"): + return &applyconfigurationscorev1.VsphereVirtualDiskVolumeSourceApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("WeightedPodAffinityTerm"): + return &applyconfigurationscorev1.WeightedPodAffinityTermApplyConfiguration{} + case corev1.SchemeGroupVersion.WithKind("WindowsSecurityContextOptions"): + return &applyconfigurationscorev1.WindowsSecurityContextOptionsApplyConfiguration{} + + // Group=flowcontrol.apiserver.k8s.io, Version=v1 + case flowcontrolv1.SchemeGroupVersion.WithKind("ExemptPriorityLevelConfiguration"): + return &applyconfigurationsflowcontrolv1.ExemptPriorityLevelConfigurationApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("FlowDistinguisherMethod"): + return &applyconfigurationsflowcontrolv1.FlowDistinguisherMethodApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchema"): + return &applyconfigurationsflowcontrolv1.FlowSchemaApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaCondition"): + return &applyconfigurationsflowcontrolv1.FlowSchemaConditionApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaSpec"): + return &applyconfigurationsflowcontrolv1.FlowSchemaSpecApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("FlowSchemaStatus"): + return &applyconfigurationsflowcontrolv1.FlowSchemaStatusApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("GroupSubject"): + return &applyconfigurationsflowcontrolv1.GroupSubjectApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("LimitedPriorityLevelConfiguration"): + return &applyconfigurationsflowcontrolv1.LimitedPriorityLevelConfigurationApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("LimitResponse"): + return &applyconfigurationsflowcontrolv1.LimitResponseApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("NonResourcePolicyRule"): + return &applyconfigurationsflowcontrolv1.NonResourcePolicyRuleApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("PolicyRulesWithSubjects"): + return &applyconfigurationsflowcontrolv1.PolicyRulesWithSubjectsApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration"): + return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationCondition"): + return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationConditionApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationReference"): + return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationReferenceApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationSpec"): + return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationSpecApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("PriorityLevelConfigurationStatus"): + return &applyconfigurationsflowcontrolv1.PriorityLevelConfigurationStatusApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("QueuingConfiguration"): + return &applyconfigurationsflowcontrolv1.QueuingConfigurationApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("ResourcePolicyRule"): + return &applyconfigurationsflowcontrolv1.ResourcePolicyRuleApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("ServiceAccountSubject"): + return &applyconfigurationsflowcontrolv1.ServiceAccountSubjectApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("Subject"): + return &applyconfigurationsflowcontrolv1.SubjectApplyConfiguration{} + case flowcontrolv1.SchemeGroupVersion.WithKind("UserSubject"): + return &applyconfigurationsflowcontrolv1.UserSubjectApplyConfiguration{} + + // Group=meta.k8s.io, Version=v1 + case metav1.SchemeGroupVersion.WithKind("Condition"): + return &applyconfigurationsmetav1.ConditionApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("DeleteOptions"): + return &clientgoapplyconfigurationsmetav1.DeleteOptionsApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("LabelSelector"): + return &applyconfigurationsmetav1.LabelSelectorApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("LabelSelectorRequirement"): + return &applyconfigurationsmetav1.LabelSelectorRequirementApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("ManagedFieldsEntry"): + return &applyconfigurationsmetav1.ManagedFieldsEntryApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("ObjectMeta"): + return &applyconfigurationsmetav1.ObjectMetaApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("OwnerReference"): + return &applyconfigurationsmetav1.OwnerReferenceApplyConfiguration{} + case metav1.SchemeGroupVersion.WithKind("TypeMeta"): + return &applyconfigurationsmetav1.TypeMetaApplyConfiguration{} + + } + return nil +} diff --git a/pkg/generated/clientset/versioned/clientset.go b/pkg/generated/clientset/versioned/clientset.go index 0f87bcb9c87..8efbbb4d663 100644 --- a/pkg/generated/clientset/versioned/clientset.go +++ b/pkg/generated/clientset/versioned/clientset.go @@ -11,28 +11,38 @@ import ( "fmt" "net/http" - discovery "k8s.io/client-go/discovery" - rest "k8s.io/client-go/rest" - flowcontrol "k8s.io/client-go/util/flowcontrol" - + apiextensionsv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apiextensions/v1" appsv1beta1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apps/v1beta1" coordinationv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/coordination/v1" corev1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/core/v1" + flowcontrolv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1" + discovery "k8s.io/client-go/discovery" + rest "k8s.io/client-go/rest" + flowcontrol "k8s.io/client-go/util/flowcontrol" ) type Interface interface { Discovery() discovery.DiscoveryInterface + ApiextensionsV1() apiextensionsv1.ApiextensionsV1Interface AppsV1beta1() appsv1beta1.AppsV1beta1Interface CoordinationV1() coordinationv1.CoordinationV1Interface CoreV1() corev1.CoreV1Interface + FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface } // Clientset contains the clients for groups. type Clientset struct { *discovery.DiscoveryClient - appsV1beta1 *appsv1beta1.AppsV1beta1Client - coordinationV1 *coordinationv1.CoordinationV1Client - coreV1 *corev1.CoreV1Client + apiextensionsV1 *apiextensionsv1.ApiextensionsV1Client + appsV1beta1 *appsv1beta1.AppsV1beta1Client + coordinationV1 *coordinationv1.CoordinationV1Client + coreV1 *corev1.CoreV1Client + flowcontrolV1 *flowcontrolv1.FlowcontrolV1Client +} + +// ApiextensionsV1 retrieves the ApiextensionsV1Client +func (c *Clientset) ApiextensionsV1() apiextensionsv1.ApiextensionsV1Interface { + return c.apiextensionsV1 } // AppsV1beta1 retrieves the AppsV1beta1Client @@ -50,6 +60,11 @@ func (c *Clientset) CoreV1() corev1.CoreV1Interface { return c.coreV1 } +// FlowcontrolV1 retrieves the FlowcontrolV1Client +func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { + return c.flowcontrolV1 +} + // Discovery retrieves the DiscoveryClient func (c *Clientset) Discovery() discovery.DiscoveryInterface { if c == nil { @@ -94,6 +109,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, var cs Clientset var err error + cs.apiextensionsV1, err = apiextensionsv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.appsV1beta1, err = appsv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -106,6 +125,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.flowcontrolV1, err = flowcontrolv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) if err != nil { @@ -127,9 +150,11 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.apiextensionsV1 = apiextensionsv1.New(c) cs.appsV1beta1 = appsv1beta1.New(c) cs.coordinationV1 = coordinationv1.New(c) cs.coreV1 = corev1.New(c) + cs.flowcontrolV1 = flowcontrolv1.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/generated/clientset/versioned/fake/clientset_generated.go b/pkg/generated/clientset/versioned/fake/clientset_generated.go index 38965159b37..7bf3633e0aa 100644 --- a/pkg/generated/clientset/versioned/fake/clientset_generated.go +++ b/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -8,19 +8,22 @@ 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 "github.com/superproj/onex/pkg/generated/clientset/versioned" + apiextensionsv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apiextensions/v1" + fakeapiextensionsv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake" appsv1beta1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apps/v1beta1" fakeappsv1beta1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake" coordinationv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/coordination/v1" fakecoordinationv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/coordination/v1/fake" corev1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/core/v1" fakecorev1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/core/v1/fake" + flowcontrolv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1" + fakeflowcontrolv1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -73,6 +76,11 @@ var ( _ testing.FakeClient = &Clientset{} ) +// ApiextensionsV1 retrieves the ApiextensionsV1Client +func (c *Clientset) ApiextensionsV1() apiextensionsv1.ApiextensionsV1Interface { + return &fakeapiextensionsv1.FakeApiextensionsV1{Fake: &c.Fake} +} + // AppsV1beta1 retrieves the AppsV1beta1Client func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface { return &fakeappsv1beta1.FakeAppsV1beta1{Fake: &c.Fake} @@ -87,3 +95,8 @@ func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface { func (c *Clientset) CoreV1() corev1.CoreV1Interface { return &fakecorev1.FakeCoreV1{Fake: &c.Fake} } + +// FlowcontrolV1 retrieves the FlowcontrolV1Client +func (c *Clientset) FlowcontrolV1() flowcontrolv1.FlowcontrolV1Interface { + return &fakeflowcontrolv1.FakeFlowcontrolV1{Fake: &c.Fake} +} diff --git a/pkg/generated/clientset/versioned/fake/register.go b/pkg/generated/clientset/versioned/fake/register.go index 508354d56c7..d6e245ccda1 100644 --- a/pkg/generated/clientset/versioned/fake/register.go +++ b/pkg/generated/clientset/versioned/fake/register.go @@ -8,26 +8,27 @@ package fake import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" 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" - - appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" ) -var ( - scheme = runtime.NewScheme() - codecs = serializer.NewCodecFactory(scheme) -) +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ + apiextensionsv1.AddToScheme, appsv1beta1.AddToScheme, coordinationv1.AddToScheme, corev1.AddToScheme, + flowcontrolv1.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/generated/clientset/versioned/scheme/register.go b/pkg/generated/clientset/versioned/scheme/register.go index 93a76c37bb6..43c593a61ff 100644 --- a/pkg/generated/clientset/versioned/scheme/register.go +++ b/pkg/generated/clientset/versioned/scheme/register.go @@ -8,27 +8,28 @@ package scheme import ( + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" 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" - - appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" ) -var ( - Scheme = runtime.NewScheme() - Codecs = serializer.NewCodecFactory(Scheme) - ParameterCodec = runtime.NewParameterCodec(Scheme) - localSchemeBuilder = runtime.SchemeBuilder{ - appsv1beta1.AddToScheme, - coordinationv1.AddToScheme, - corev1.AddToScheme, - } -) +var Scheme = runtime.NewScheme() +var Codecs = serializer.NewCodecFactory(Scheme) +var ParameterCodec = runtime.NewParameterCodec(Scheme) +var localSchemeBuilder = runtime.SchemeBuilder{ + apiextensionsv1.AddToScheme, + appsv1beta1.AddToScheme, + coordinationv1.AddToScheme, + corev1.AddToScheme, + flowcontrolv1.AddToScheme, +} // AddToScheme adds all types of this clientset into the given scheme. This allows composition // of clientsets, like in: diff --git a/pkg/generated/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go new file mode 100644 index 00000000000..71d268e16af --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/apiextensions_client.go @@ -0,0 +1,96 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + rest "k8s.io/client-go/rest" +) + +type ApiextensionsV1Interface interface { + RESTClient() rest.Interface + CustomResourceDefinitionsGetter +} + +// ApiextensionsV1Client is used to interact with features provided by the apiextensions.k8s.io group. +type ApiextensionsV1Client struct { + restClient rest.Interface +} + +func (c *ApiextensionsV1Client) CustomResourceDefinitions() CustomResourceDefinitionInterface { + return newCustomResourceDefinitions(c) +} + +// NewForConfig creates a new ApiextensionsV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ApiextensionsV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ApiextensionsV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ApiextensionsV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ApiextensionsV1Client{client}, nil +} + +// NewForConfigOrDie creates a new ApiextensionsV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ApiextensionsV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ApiextensionsV1Client for the given RESTClient. +func New(c rest.Interface) *ApiextensionsV1Client { + return &ApiextensionsV1Client{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 *ApiextensionsV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go new file mode 100644 index 00000000000..bed2804af48 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/customresourcedefinition.go @@ -0,0 +1,232 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + apiextensionsv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apiextensions/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/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" +) + +// CustomResourceDefinitionsGetter has a method to return a CustomResourceDefinitionInterface. +// A group's client should implement this interface. +type CustomResourceDefinitionsGetter interface { + CustomResourceDefinitions() CustomResourceDefinitionInterface +} + +// CustomResourceDefinitionInterface has methods to work with CustomResourceDefinition resources. +type CustomResourceDefinitionInterface interface { + Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (*v1.CustomResourceDefinition, error) + Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error) + UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, 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.CustomResourceDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CustomResourceDefinitionList, 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.CustomResourceDefinition, err error) + Apply(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) + ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) + CustomResourceDefinitionExpansion +} + +// customResourceDefinitions implements CustomResourceDefinitionInterface +type customResourceDefinitions struct { + client rest.Interface +} + +// newCustomResourceDefinitions returns a CustomResourceDefinitions +func newCustomResourceDefinitions(c *ApiextensionsV1Client) *customResourceDefinitions { + return &customResourceDefinitions{ + client: c.RESTClient(), + } +} + +// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any. +func (c *customResourceDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CustomResourceDefinition, err error) { + result = &v1.CustomResourceDefinition{} + err = c.client.Get(). + Resource("customresourcedefinitions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. +func (c *customResourceDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CustomResourceDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CustomResourceDefinitionList{} + err = c.client.Get(). + Resource("customresourcedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested customResourceDefinitions. +func (c *customResourceDefinitions) 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("customresourcedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. +func (c *customResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (result *v1.CustomResourceDefinition, err error) { + result = &v1.CustomResourceDefinition{} + err = c.client.Post(). + Resource("customresourcedefinitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(customResourceDefinition). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. +func (c *customResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (result *v1.CustomResourceDefinition, err error) { + result = &v1.CustomResourceDefinition{} + err = c.client.Put(). + Resource("customresourcedefinitions"). + Name(customResourceDefinition.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(customResourceDefinition). + 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 *customResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (result *v1.CustomResourceDefinition, err error) { + result = &v1.CustomResourceDefinition{} + err = c.client.Put(). + Resource("customresourcedefinitions"). + Name(customResourceDefinition.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(customResourceDefinition). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. +func (c *customResourceDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("customresourcedefinitions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *customResourceDefinitions) 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("customresourcedefinitions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched customResourceDefinition. +func (c *customResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CustomResourceDefinition, err error) { + result = &v1.CustomResourceDefinition{} + err = c.client.Patch(pt). + Resource("customresourcedefinitions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied customResourceDefinition. +func (c *customResourceDefinitions) Apply(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) { + if customResourceDefinition == nil { + return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(customResourceDefinition) + if err != nil { + return nil, err + } + name := customResourceDefinition.Name + if name == nil { + return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply") + } + result = &v1.CustomResourceDefinition{} + err = c.client.Patch(types.ApplyPatchType). + Resource("customresourcedefinitions"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *customResourceDefinitions) ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) { + if customResourceDefinition == nil { + return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(customResourceDefinition) + if err != nil { + return nil, err + } + + name := customResourceDefinition.Name + if name == nil { + return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply") + } + + result = &v1.CustomResourceDefinition{} + err = c.client.Patch(types.ApplyPatchType). + Resource("customresourcedefinitions"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/apiextensions/v1/doc.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/doc.go new file mode 100644 index 00000000000..30c59f84ddd --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/doc.go @@ -0,0 +1,9 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/doc.go new file mode 100644 index 00000000000..c50d07e8a70 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/doc.go @@ -0,0 +1,9 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/fake_apiextensions_client.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/fake_apiextensions_client.go new file mode 100644 index 00000000000..ea68315a92e --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/fake_apiextensions_client.go @@ -0,0 +1,29 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apiextensions/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeApiextensionsV1 struct { + *testing.Fake +} + +func (c *FakeApiextensionsV1) CustomResourceDefinitions() v1.CustomResourceDefinitionInterface { + return &FakeCustomResourceDefinitions{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeApiextensionsV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go new file mode 100644 index 00000000000..97380d9d25c --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/fake/fake_customresourcedefinition.go @@ -0,0 +1,167 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + apiextensionsv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apiextensions/v1" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCustomResourceDefinitions implements CustomResourceDefinitionInterface +type FakeCustomResourceDefinitions struct { + Fake *FakeApiextensionsV1 +} + +var customresourcedefinitionsResource = v1.SchemeGroupVersion.WithResource("customresourcedefinitions") + +var customresourcedefinitionsKind = v1.SchemeGroupVersion.WithKind("CustomResourceDefinition") + +// Get takes name of the customResourceDefinition, and returns the corresponding customResourceDefinition object, and an error if there is any. +func (c *FakeCustomResourceDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CustomResourceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(customresourcedefinitionsResource, name), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), err +} + +// List takes label and field selectors, and returns the list of CustomResourceDefinitions that match those selectors. +func (c *FakeCustomResourceDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CustomResourceDefinitionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(customresourcedefinitionsResource, customresourcedefinitionsKind, opts), &v1.CustomResourceDefinitionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.CustomResourceDefinitionList{ListMeta: obj.(*v1.CustomResourceDefinitionList).ListMeta} + for _, item := range obj.(*v1.CustomResourceDefinitionList).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 customResourceDefinitions. +func (c *FakeCustomResourceDefinitions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(customresourcedefinitionsResource, opts)) +} + +// Create takes the representation of a customResourceDefinition and creates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. +func (c *FakeCustomResourceDefinitions) Create(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.CreateOptions) (result *v1.CustomResourceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(customresourcedefinitionsResource, customResourceDefinition), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), err +} + +// Update takes the representation of a customResourceDefinition and updates it. Returns the server's representation of the customResourceDefinition, and an error, if there is any. +func (c *FakeCustomResourceDefinitions) Update(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (result *v1.CustomResourceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(customresourcedefinitionsResource, customResourceDefinition), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), 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 *FakeCustomResourceDefinitions) UpdateStatus(ctx context.Context, customResourceDefinition *v1.CustomResourceDefinition, opts metav1.UpdateOptions) (*v1.CustomResourceDefinition, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(customresourcedefinitionsResource, "status", customResourceDefinition), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), err +} + +// Delete takes name of the customResourceDefinition and deletes it. Returns an error if one occurs. +func (c *FakeCustomResourceDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(customresourcedefinitionsResource, name, opts), &v1.CustomResourceDefinition{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCustomResourceDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(customresourcedefinitionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1.CustomResourceDefinitionList{}) + return err +} + +// Patch applies the patch and returns the patched customResourceDefinition. +func (c *FakeCustomResourceDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CustomResourceDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, name, pt, data, subresources...), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied customResourceDefinition. +func (c *FakeCustomResourceDefinitions) Apply(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) { + if customResourceDefinition == nil { + return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil") + } + data, err := json.Marshal(customResourceDefinition) + if err != nil { + return nil, err + } + name := customResourceDefinition.Name + if name == nil { + return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, *name, types.ApplyPatchType, data), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeCustomResourceDefinitions) ApplyStatus(ctx context.Context, customResourceDefinition *apiextensionsv1.CustomResourceDefinitionApplyConfiguration, opts metav1.ApplyOptions) (result *v1.CustomResourceDefinition, err error) { + if customResourceDefinition == nil { + return nil, fmt.Errorf("customResourceDefinition provided to Apply must not be nil") + } + data, err := json.Marshal(customResourceDefinition) + if err != nil { + return nil, err + } + name := customResourceDefinition.Name + if name == nil { + return nil, fmt.Errorf("customResourceDefinition.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(customresourcedefinitionsResource, *name, types.ApplyPatchType, data, "status"), &v1.CustomResourceDefinition{}) + if obj == nil { + return nil, err + } + return obj.(*v1.CustomResourceDefinition), err +} diff --git a/pkg/apis/core/v1/zz_generated.deepcopy.go b/pkg/generated/clientset/versioned/typed/apiextensions/v1/generated_expansion.go similarity index 70% rename from pkg/apis/core/v1/zz_generated.deepcopy.go rename to pkg/generated/clientset/versioned/typed/apiextensions/v1/generated_expansion.go index 08494978bdf..c7134d9d916 100644 --- a/pkg/apis/core/v1/zz_generated.deepcopy.go +++ b/pkg/generated/clientset/versioned/typed/apiextensions/v1/generated_expansion.go @@ -1,11 +1,10 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - // Copyright 2022 Lingfei Kong . All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. The original repo for // this file is https://github.com/superproj/onex. -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. package v1 + +type CustomResourceDefinitionExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/apps_client.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/apps_client.go index 051d64c61ff..cbf9fba98be 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/apps_client.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/apps_client.go @@ -10,10 +10,9 @@ package v1beta1 import ( "net/http" - rest "k8s.io/client-go/rest" - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" ) type AppsV1beta1Interface interface { diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/chain.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/chain.go index b8152b58607..40872c19d60 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/chain.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/chain.go @@ -9,15 +9,17 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // ChainsGetter has a method to return a ChainInterface. @@ -37,6 +39,8 @@ type ChainInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ChainList, 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 *v1beta1.Chain, err error) + Apply(ctx context.Context, chain *appsv1beta1.ChainApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Chain, err error) + ApplyStatus(ctx context.Context, chain *appsv1beta1.ChainApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Chain, err error) ChainExpansion } @@ -183,3 +187,59 @@ func (c *chains) Patch(ctx context.Context, name string, pt types.PatchType, dat Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied chain. +func (c *chains) Apply(ctx context.Context, chain *appsv1beta1.ChainApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Chain, err error) { + if chain == nil { + return nil, fmt.Errorf("chain provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(chain) + if err != nil { + return nil, err + } + name := chain.Name + if name == nil { + return nil, fmt.Errorf("chain.Name must be provided to Apply") + } + result = &v1beta1.Chain{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("chains"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *chains) ApplyStatus(ctx context.Context, chain *appsv1beta1.ChainApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Chain, err error) { + if chain == nil { + return nil, fmt.Errorf("chain provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(chain) + if err != nil { + return nil, err + } + + name := chain.Name + if name == nil { + return nil, fmt.Errorf("chain.Name must be provided to Apply") + } + + result = &v1beta1.Chain{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("chains"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/chargerequest.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/chargerequest.go index 4b1f3674f6f..a8a93668550 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/chargerequest.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/chargerequest.go @@ -9,15 +9,17 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // ChargeRequestsGetter has a method to return a ChargeRequestInterface. @@ -37,6 +39,8 @@ type ChargeRequestInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ChargeRequestList, 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 *v1beta1.ChargeRequest, err error) + Apply(ctx context.Context, chargeRequest *appsv1beta1.ChargeRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ChargeRequest, err error) + ApplyStatus(ctx context.Context, chargeRequest *appsv1beta1.ChargeRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ChargeRequest, err error) ChargeRequestExpansion } @@ -183,3 +187,59 @@ func (c *chargeRequests) Patch(ctx context.Context, name string, pt types.PatchT Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied chargeRequest. +func (c *chargeRequests) Apply(ctx context.Context, chargeRequest *appsv1beta1.ChargeRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ChargeRequest, err error) { + if chargeRequest == nil { + return nil, fmt.Errorf("chargeRequest provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(chargeRequest) + if err != nil { + return nil, err + } + name := chargeRequest.Name + if name == nil { + return nil, fmt.Errorf("chargeRequest.Name must be provided to Apply") + } + result = &v1beta1.ChargeRequest{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("chargerequests"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *chargeRequests) ApplyStatus(ctx context.Context, chargeRequest *appsv1beta1.ChargeRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ChargeRequest, err error) { + if chargeRequest == nil { + return nil, fmt.Errorf("chargeRequest provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(chargeRequest) + if err != nil { + return nil, err + } + + name := chargeRequest.Name + if name == nil { + return nil, fmt.Errorf("chargeRequest.Name must be provided to Apply") + } + + result = &v1beta1.ChargeRequest{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("chargerequests"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_apps_client.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_apps_client.go index d22779df768..9c2c8084e8a 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_apps_client.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_apps_client.go @@ -8,10 +8,9 @@ package fake import ( + v1beta1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apps/v1beta1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - - v1beta1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/apps/v1beta1" ) type FakeAppsV1beta1 struct { diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chain.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chain.go index 4390d625024..020ee839d25 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chain.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chain.go @@ -9,14 +9,16 @@ package fake import ( "context" + json "encoding/json" + "fmt" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // FakeChains implements ChainInterface @@ -66,6 +68,7 @@ func (c *FakeChains) List(ctx context.Context, opts v1.ListOptions) (result *v1b func (c *FakeChains) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(chainsResource, c.ns, opts)) + } // Create takes the representation of a chain and creates it. Returns the server's representation of the chain, and an error, if there is any. @@ -128,3 +131,48 @@ func (c *FakeChains) Patch(ctx context.Context, name string, pt types.PatchType, } return obj.(*v1beta1.Chain), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied chain. +func (c *FakeChains) Apply(ctx context.Context, chain *appsv1beta1.ChainApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Chain, err error) { + if chain == nil { + return nil, fmt.Errorf("chain provided to Apply must not be nil") + } + data, err := json.Marshal(chain) + if err != nil { + return nil, err + } + name := chain.Name + if name == nil { + return nil, fmt.Errorf("chain.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(chainsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Chain{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Chain), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeChains) ApplyStatus(ctx context.Context, chain *appsv1beta1.ChainApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Chain, err error) { + if chain == nil { + return nil, fmt.Errorf("chain provided to Apply must not be nil") + } + data, err := json.Marshal(chain) + if err != nil { + return nil, err + } + name := chain.Name + if name == nil { + return nil, fmt.Errorf("chain.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(chainsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Chain{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Chain), err +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chargerequest.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chargerequest.go index ad04eb18004..28b67972536 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chargerequest.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_chargerequest.go @@ -9,14 +9,16 @@ package fake import ( "context" + json "encoding/json" + "fmt" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // FakeChargeRequests implements ChargeRequestInterface @@ -66,6 +68,7 @@ func (c *FakeChargeRequests) List(ctx context.Context, opts v1.ListOptions) (res func (c *FakeChargeRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(chargerequestsResource, c.ns, opts)) + } // Create takes the representation of a chargeRequest and creates it. Returns the server's representation of the chargeRequest, and an error, if there is any. @@ -128,3 +131,48 @@ func (c *FakeChargeRequests) Patch(ctx context.Context, name string, pt types.Pa } return obj.(*v1beta1.ChargeRequest), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied chargeRequest. +func (c *FakeChargeRequests) Apply(ctx context.Context, chargeRequest *appsv1beta1.ChargeRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ChargeRequest, err error) { + if chargeRequest == nil { + return nil, fmt.Errorf("chargeRequest provided to Apply must not be nil") + } + data, err := json.Marshal(chargeRequest) + if err != nil { + return nil, err + } + name := chargeRequest.Name + if name == nil { + return nil, fmt.Errorf("chargeRequest.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(chargerequestsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.ChargeRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ChargeRequest), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeChargeRequests) ApplyStatus(ctx context.Context, chargeRequest *appsv1beta1.ChargeRequestApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.ChargeRequest, err error) { + if chargeRequest == nil { + return nil, fmt.Errorf("chargeRequest provided to Apply must not be nil") + } + data, err := json.Marshal(chargeRequest) + if err != nil { + return nil, err + } + name := chargeRequest.Name + if name == nil { + return nil, fmt.Errorf("chargeRequest.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(chargerequestsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.ChargeRequest{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ChargeRequest), err +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_miner.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_miner.go index 320329f9619..d9af6b6269a 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_miner.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_miner.go @@ -9,14 +9,16 @@ package fake import ( "context" + json "encoding/json" + "fmt" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // FakeMiners implements MinerInterface @@ -66,6 +68,7 @@ func (c *FakeMiners) List(ctx context.Context, opts v1.ListOptions) (result *v1b func (c *FakeMiners) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(minersResource, c.ns, opts)) + } // Create takes the representation of a miner and creates it. Returns the server's representation of the miner, and an error, if there is any. @@ -128,3 +131,48 @@ func (c *FakeMiners) Patch(ctx context.Context, name string, pt types.PatchType, } return obj.(*v1beta1.Miner), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied miner. +func (c *FakeMiners) Apply(ctx context.Context, miner *appsv1beta1.MinerApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Miner, err error) { + if miner == nil { + return nil, fmt.Errorf("miner provided to Apply must not be nil") + } + data, err := json.Marshal(miner) + if err != nil { + return nil, err + } + name := miner.Name + if name == nil { + return nil, fmt.Errorf("miner.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(minersResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.Miner{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Miner), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeMiners) ApplyStatus(ctx context.Context, miner *appsv1beta1.MinerApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Miner, err error) { + if miner == nil { + return nil, fmt.Errorf("miner provided to Apply must not be nil") + } + data, err := json.Marshal(miner) + if err != nil { + return nil, err + } + name := miner.Name + if name == nil { + return nil, fmt.Errorf("miner.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(minersResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.Miner{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Miner), err +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_minerset.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_minerset.go index 7c19bcb30d1..96b56fb4e09 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_minerset.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/fake/fake_minerset.go @@ -9,15 +9,18 @@ package fake import ( "context" + json "encoding/json" + "fmt" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" + applyconfigurationsautoscalingv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/autoscaling/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // FakeMinerSets implements MinerSetInterface @@ -67,6 +70,7 @@ func (c *FakeMinerSets) List(ctx context.Context, opts v1.ListOptions) (result * func (c *FakeMinerSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(minersetsResource, c.ns, opts)) + } // Create takes the representation of a minerSet and creates it. Returns the server's representation of the minerSet, and an error, if there is any. @@ -130,6 +134,51 @@ func (c *FakeMinerSets) Patch(ctx context.Context, name string, pt types.PatchTy return obj.(*v1beta1.MinerSet), err } +// Apply takes the given apply declarative configuration, applies it and returns the applied minerSet. +func (c *FakeMinerSets) Apply(ctx context.Context, minerSet *appsv1beta1.MinerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MinerSet, err error) { + if minerSet == nil { + return nil, fmt.Errorf("minerSet provided to Apply must not be nil") + } + data, err := json.Marshal(minerSet) + if err != nil { + return nil, err + } + name := minerSet.Name + if name == nil { + return nil, fmt.Errorf("minerSet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(minersetsResource, c.ns, *name, types.ApplyPatchType, data), &v1beta1.MinerSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MinerSet), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeMinerSets) ApplyStatus(ctx context.Context, minerSet *appsv1beta1.MinerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MinerSet, err error) { + if minerSet == nil { + return nil, fmt.Errorf("minerSet provided to Apply must not be nil") + } + data, err := json.Marshal(minerSet) + if err != nil { + return nil, err + } + name := minerSet.Name + if name == nil { + return nil, fmt.Errorf("minerSet.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(minersetsResource, c.ns, *name, types.ApplyPatchType, data, "status"), &v1beta1.MinerSet{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.MinerSet), err +} + // GetScale takes name of the minerSet, and returns the corresponding scale object, and an error if there is any. func (c *FakeMinerSets) GetScale(ctx context.Context, minerSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { obj, err := c.Fake. @@ -151,3 +200,22 @@ func (c *FakeMinerSets) UpdateScale(ctx context.Context, minerSetName string, sc } return obj.(*autoscalingv1.Scale), err } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *FakeMinerSets) ApplyScale(ctx context.Context, minerSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(minersetsResource, c.ns, minerSetName, types.ApplyPatchType, data, "status"), &autoscalingv1.Scale{}) + + if obj == nil { + return nil, err + } + return obj.(*autoscalingv1.Scale), err +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/generated_expansion.go index 280ed2e25c0..95cdf44fd5b 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/generated_expansion.go @@ -7,10 +7,10 @@ package v1beta1 -type ChainExpansion any +type ChainExpansion interface{} -type ChargeRequestExpansion any +type ChargeRequestExpansion interface{} -type MinerExpansion any +type MinerExpansion interface{} -type MinerSetExpansion any +type MinerSetExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/miner.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/miner.go index 3b3bc81c525..d26cc90f515 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/miner.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/miner.go @@ -9,15 +9,17 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" rest "k8s.io/client-go/rest" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // MinersGetter has a method to return a MinerInterface. @@ -37,6 +39,8 @@ type MinerInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MinerList, 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 *v1beta1.Miner, err error) + Apply(ctx context.Context, miner *appsv1beta1.MinerApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Miner, err error) + ApplyStatus(ctx context.Context, miner *appsv1beta1.MinerApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Miner, err error) MinerExpansion } @@ -183,3 +187,59 @@ func (c *miners) Patch(ctx context.Context, name string, pt types.PatchType, dat Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied miner. +func (c *miners) Apply(ctx context.Context, miner *appsv1beta1.MinerApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Miner, err error) { + if miner == nil { + return nil, fmt.Errorf("miner provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(miner) + if err != nil { + return nil, err + } + name := miner.Name + if name == nil { + return nil, fmt.Errorf("miner.Name must be provided to Apply") + } + result = &v1beta1.Miner{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("miners"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *miners) ApplyStatus(ctx context.Context, miner *appsv1beta1.MinerApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.Miner, err error) { + if miner == nil { + return nil, fmt.Errorf("miner provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(miner) + if err != nil { + return nil, err + } + + name := miner.Name + if name == nil { + return nil, fmt.Errorf("miner.Name must be provided to Apply") + } + + result = &v1beta1.Miner{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("miners"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/apps/v1beta1/minerset.go b/pkg/generated/clientset/versioned/typed/apps/v1beta1/minerset.go index 07df31b8aca..40d5567bf05 100644 --- a/pkg/generated/clientset/versioned/typed/apps/v1beta1/minerset.go +++ b/pkg/generated/clientset/versioned/typed/apps/v1beta1/minerset.go @@ -9,16 +9,19 @@ package v1beta1 import ( "context" + json "encoding/json" + "fmt" "time" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + appsv1beta1 "github.com/superproj/onex/pkg/generated/applyconfigurations/apps/v1beta1" + applyconfigurationsautoscalingv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/autoscaling/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" autoscalingv1 "k8s.io/api/autoscaling/v1" 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" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // MinerSetsGetter has a method to return a MinerSetInterface. @@ -38,8 +41,11 @@ type MinerSetInterface interface { List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MinerSetList, 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 *v1beta1.MinerSet, err error) + Apply(ctx context.Context, minerSet *appsv1beta1.MinerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MinerSet, err error) + ApplyStatus(ctx context.Context, minerSet *appsv1beta1.MinerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MinerSet, err error) GetScale(ctx context.Context, minerSetName string, options v1.GetOptions) (*autoscalingv1.Scale, error) UpdateScale(ctx context.Context, minerSetName string, scale *autoscalingv1.Scale, opts v1.UpdateOptions) (*autoscalingv1.Scale, error) + ApplyScale(ctx context.Context, minerSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts v1.ApplyOptions) (*autoscalingv1.Scale, error) MinerSetExpansion } @@ -188,6 +194,62 @@ func (c *minerSets) Patch(ctx context.Context, name string, pt types.PatchType, return } +// Apply takes the given apply declarative configuration, applies it and returns the applied minerSet. +func (c *minerSets) Apply(ctx context.Context, minerSet *appsv1beta1.MinerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MinerSet, err error) { + if minerSet == nil { + return nil, fmt.Errorf("minerSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(minerSet) + if err != nil { + return nil, err + } + name := minerSet.Name + if name == nil { + return nil, fmt.Errorf("minerSet.Name must be provided to Apply") + } + result = &v1beta1.MinerSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("minersets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *minerSets) ApplyStatus(ctx context.Context, minerSet *appsv1beta1.MinerSetApplyConfiguration, opts v1.ApplyOptions) (result *v1beta1.MinerSet, err error) { + if minerSet == nil { + return nil, fmt.Errorf("minerSet provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(minerSet) + if err != nil { + return nil, err + } + + name := minerSet.Name + if name == nil { + return nil, fmt.Errorf("minerSet.Name must be provided to Apply") + } + + result = &v1beta1.MinerSet{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("minersets"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + // GetScale takes name of the minerSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. func (c *minerSets) GetScale(ctx context.Context, minerSetName string, options v1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} @@ -216,3 +278,28 @@ func (c *minerSets) UpdateScale(ctx context.Context, minerSetName string, scale Into(result) return } + +// ApplyScale takes top resource name and the apply declarative configuration for scale, +// applies it and returns the applied scale, and an error, if there is any. +func (c *minerSets) ApplyScale(ctx context.Context, minerSetName string, scale *applyconfigurationsautoscalingv1.ScaleApplyConfiguration, opts v1.ApplyOptions) (result *autoscalingv1.Scale, err error) { + if scale == nil { + return nil, fmt.Errorf("scale provided to ApplyScale must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(scale) + if err != nil { + return nil, err + } + + result = &autoscalingv1.Scale{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("minersets"). + Name(minerSetName). + SubResource("scale"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/coordination/v1/coordination_client.go b/pkg/generated/clientset/versioned/typed/coordination/v1/coordination_client.go index e70f264d2a1..f39d116b91f 100644 --- a/pkg/generated/clientset/versioned/typed/coordination/v1/coordination_client.go +++ b/pkg/generated/clientset/versioned/typed/coordination/v1/coordination_client.go @@ -10,10 +10,9 @@ package v1 import ( "net/http" - rest "k8s.io/client-go/rest" - - v1 "github.com/superproj/onex/pkg/apis/coordination/v1" "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/coordination/v1" + rest "k8s.io/client-go/rest" ) type CoordinationV1Interface interface { diff --git a/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_coordination_client.go b/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_coordination_client.go index ce0f59a844d..2cc6b621cab 100644 --- a/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_coordination_client.go +++ b/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_coordination_client.go @@ -8,10 +8,9 @@ package fake import ( + v1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/coordination/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - - v1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/coordination/v1" ) type FakeCoordinationV1 struct { diff --git a/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_lease.go b/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_lease.go index 2c48b16584c..ca26833e7c6 100644 --- a/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_lease.go +++ b/pkg/generated/clientset/versioned/typed/coordination/v1/fake/fake_lease.go @@ -9,14 +9,16 @@ package fake import ( "context" + json "encoding/json" + "fmt" + coordinationv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/coordination/v1" + v1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" testing "k8s.io/client-go/testing" - - v1 "github.com/superproj/onex/pkg/apis/coordination/v1" ) // FakeLeases implements LeaseInterface @@ -66,6 +68,7 @@ func (c *FakeLeases) List(ctx context.Context, opts metav1.ListOptions) (result func (c *FakeLeases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(leasesResource, c.ns, opts)) + } // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. @@ -116,3 +119,25 @@ func (c *FakeLeases) Patch(ctx context.Context, name string, pt types.PatchType, } return obj.(*v1.Lease), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied lease. +func (c *FakeLeases) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) { + if lease == nil { + return nil, fmt.Errorf("lease provided to Apply must not be nil") + } + data, err := json.Marshal(lease) + if err != nil { + return nil, err + } + name := lease.Name + if name == nil { + return nil, fmt.Errorf("lease.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(leasesResource, c.ns, *name, types.ApplyPatchType, data), &v1.Lease{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Lease), err +} diff --git a/pkg/generated/clientset/versioned/typed/coordination/v1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/coordination/v1/generated_expansion.go index 24ca1de262a..2f73dce57ae 100644 --- a/pkg/generated/clientset/versioned/typed/coordination/v1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/coordination/v1/generated_expansion.go @@ -7,4 +7,4 @@ package v1 -type LeaseExpansion any +type LeaseExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/coordination/v1/lease.go b/pkg/generated/clientset/versioned/typed/coordination/v1/lease.go index b0ab63ccae4..02dc898721e 100644 --- a/pkg/generated/clientset/versioned/typed/coordination/v1/lease.go +++ b/pkg/generated/clientset/versioned/typed/coordination/v1/lease.go @@ -9,15 +9,17 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" + coordinationv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/coordination/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/coordination/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 "github.com/superproj/onex/pkg/apis/coordination/v1" - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // LeasesGetter has a method to return a LeaseInterface. @@ -36,6 +38,7 @@ type LeaseInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, 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.Lease, err error) + Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) LeaseExpansion } @@ -166,3 +169,29 @@ func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, dat Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied lease. +func (c *leases) Apply(ctx context.Context, lease *coordinationv1.LeaseApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Lease, err error) { + if lease == nil { + return nil, fmt.Errorf("lease provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(lease) + if err != nil { + return nil, err + } + name := lease.Name + if name == nil { + return nil, fmt.Errorf("lease.Name must be provided to Apply") + } + result = &v1.Lease{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("leases"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/configmap.go b/pkg/generated/clientset/versioned/typed/core/v1/configmap.go index 3b54d6b7155..3a305c88462 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/configmap.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/configmap.go @@ -9,15 +9,17 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/api/core/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" - - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // ConfigMapsGetter has a method to return a ConfigMapInterface. @@ -36,6 +38,7 @@ type ConfigMapInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, 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.ConfigMap, err error) + Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) ConfigMapExpansion } @@ -166,3 +169,29 @@ func (c *configMaps) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied configMap. +func (c *configMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) { + if configMap == nil { + return nil, fmt.Errorf("configMap provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(configMap) + if err != nil { + return nil, err + } + name := configMap.Name + if name == nil { + return nil, fmt.Errorf("configMap.Name must be provided to Apply") + } + result = &v1.ConfigMap{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("configmaps"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/core_client.go b/pkg/generated/clientset/versioned/typed/core/v1/core_client.go index 4135ac73d72..d92581a0e7a 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/core_client.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/core_client.go @@ -10,10 +10,9 @@ package v1 import ( "net/http" + "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/api/core/v1" rest "k8s.io/client-go/rest" - - "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) type CoreV1Interface interface { diff --git a/pkg/generated/clientset/versioned/typed/core/v1/event.go b/pkg/generated/clientset/versioned/typed/core/v1/event.go index 112799e086c..f8a2c3f9fda 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/event.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/event.go @@ -9,15 +9,17 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/api/core/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" - - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // EventsGetter has a method to return a EventInterface. @@ -36,6 +38,7 @@ type EventInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, 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.Event, err error) + Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) EventExpansion } @@ -166,3 +169,29 @@ func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, dat Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied event. +func (c *events) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { + if event == nil { + return nil, fmt.Errorf("event provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(event) + if err != nil { + return nil, err + } + name := event.Name + if name == nil { + return nil, fmt.Errorf("event.Name must be provided to Apply") + } + result = &v1.Event{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("events"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_configmap.go b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_configmap.go index 7202f86d5f3..458d5873be7 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_configmap.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_configmap.go @@ -9,7 +9,10 @@ package fake import ( "context" + json "encoding/json" + "fmt" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -65,6 +68,7 @@ func (c *FakeConfigMaps) List(ctx context.Context, opts metav1.ListOptions) (res func (c *FakeConfigMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(configmapsResource, c.ns, opts)) + } // Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. @@ -115,3 +119,25 @@ func (c *FakeConfigMaps) Patch(ctx context.Context, name string, pt types.PatchT } return obj.(*v1.ConfigMap), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied configMap. +func (c *FakeConfigMaps) Apply(ctx context.Context, configMap *corev1.ConfigMapApplyConfiguration, opts metav1.ApplyOptions) (result *v1.ConfigMap, err error) { + if configMap == nil { + return nil, fmt.Errorf("configMap provided to Apply must not be nil") + } + data, err := json.Marshal(configMap) + if err != nil { + return nil, err + } + name := configMap.Name + if name == nil { + return nil, fmt.Errorf("configMap.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, *name, types.ApplyPatchType, data), &v1.ConfigMap{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.ConfigMap), err +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_core_client.go b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_core_client.go index 271b1ca5b69..8b6357b00e3 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_core_client.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_core_client.go @@ -8,10 +8,9 @@ package fake import ( + v1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/core/v1" rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - - v1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/core/v1" ) type FakeCoreV1 struct { diff --git a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_event.go b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_event.go index 3f052cb6313..530a573c817 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_event.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_event.go @@ -9,7 +9,10 @@ package fake import ( "context" + json "encoding/json" + "fmt" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -65,6 +68,7 @@ func (c *FakeEvents) List(ctx context.Context, opts metav1.ListOptions) (result func (c *FakeEvents) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(eventsResource, c.ns, opts)) + } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. @@ -115,3 +119,25 @@ func (c *FakeEvents) Patch(ctx context.Context, name string, pt types.PatchType, } return obj.(*v1.Event), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied event. +func (c *FakeEvents) Apply(ctx context.Context, event *corev1.EventApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Event, err error) { + if event == nil { + return nil, fmt.Errorf("event provided to Apply must not be nil") + } + data, err := json.Marshal(event) + if err != nil { + return nil, err + } + name := event.Name + if name == nil { + return nil, fmt.Errorf("event.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Event{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Event), err +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_namespace.go b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_namespace.go index e82d60df587..f7f87fa6bc1 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_namespace.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_namespace.go @@ -9,7 +9,10 @@ package fake import ( "context" + json "encoding/json" + "fmt" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -112,6 +115,49 @@ func (c *FakeNamespaces) Patch(ctx context.Context, name string, pt types.PatchT return obj.(*v1.Namespace), err } +// Apply takes the given apply declarative configuration, applies it and returns the applied namespace. +func (c *FakeNamespaces) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { + if namespace == nil { + return nil, fmt.Errorf("namespace provided to Apply must not be nil") + } + data, err := json.Marshal(namespace) + if err != nil { + return nil, err + } + name := namespace.Name + if name == nil { + return nil, fmt.Errorf("namespace.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data), &v1.Namespace{}) + if obj == nil { + return nil, err + } + return obj.(*v1.Namespace), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeNamespaces) ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { + if namespace == nil { + return nil, fmt.Errorf("namespace provided to Apply must not be nil") + } + data, err := json.Marshal(namespace) + if err != nil { + return nil, err + } + name := namespace.Name + if name == nil { + return nil, fmt.Errorf("namespace.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, *name, types.ApplyPatchType, data, "status"), &v1.Namespace{}) + if obj == nil { + return nil, err + } + return obj.(*v1.Namespace), err +} + // Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. func (c *FakeNamespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { return nil, nil diff --git a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_secret.go b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_secret.go index f537f1618ed..f2bd5a6aa82 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_secret.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/fake/fake_secret.go @@ -9,7 +9,10 @@ package fake import ( "context" + json "encoding/json" + "fmt" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -65,6 +68,7 @@ func (c *FakeSecrets) List(ctx context.Context, opts metav1.ListOptions) (result func (c *FakeSecrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(secretsResource, c.ns, opts)) + } // Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. @@ -115,3 +119,25 @@ func (c *FakeSecrets) Patch(ctx context.Context, name string, pt types.PatchType } return obj.(*v1.Secret), err } + +// Apply takes the given apply declarative configuration, applies it and returns the applied secret. +func (c *FakeSecrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) { + if secret == nil { + return nil, fmt.Errorf("secret provided to Apply must not be nil") + } + data, err := json.Marshal(secret) + if err != nil { + return nil, err + } + name := secret.Name + if name == nil { + return nil, fmt.Errorf("secret.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, *name, types.ApplyPatchType, data), &v1.Secret{}) + + if obj == nil { + return nil, err + } + return obj.(*v1.Secret), err +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/namespace.go b/pkg/generated/clientset/versioned/typed/core/v1/namespace.go index 0bc541cc4d7..43476e8f959 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/namespace.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/namespace.go @@ -9,15 +9,17 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/api/core/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" - - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // NamespacesGetter has a method to return a NamespaceInterface. @@ -36,6 +38,8 @@ type NamespaceInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, 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.Namespace, err error) + Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) + ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) NamespaceExpansion } @@ -156,3 +160,57 @@ func (c *namespaces) Patch(ctx context.Context, name string, pt types.PatchType, Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied namespace. +func (c *namespaces) Apply(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { + if namespace == nil { + return nil, fmt.Errorf("namespace provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(namespace) + if err != nil { + return nil, err + } + name := namespace.Name + if name == nil { + return nil, fmt.Errorf("namespace.Name must be provided to Apply") + } + result = &v1.Namespace{} + err = c.client.Patch(types.ApplyPatchType). + Resource("namespaces"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *namespaces) ApplyStatus(ctx context.Context, namespace *corev1.NamespaceApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Namespace, err error) { + if namespace == nil { + return nil, fmt.Errorf("namespace provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(namespace) + if err != nil { + return nil, err + } + + name := namespace.Name + if name == nil { + return nil, fmt.Errorf("namespace.Name must be provided to Apply") + } + + result = &v1.Namespace{} + err = c.client.Patch(types.ApplyPatchType). + Resource("namespaces"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/core/v1/secret.go b/pkg/generated/clientset/versioned/typed/core/v1/secret.go index c391a0566c6..8f2fd13ee7e 100644 --- a/pkg/generated/clientset/versioned/typed/core/v1/secret.go +++ b/pkg/generated/clientset/versioned/typed/core/v1/secret.go @@ -9,15 +9,17 @@ package v1 import ( "context" + json "encoding/json" + "fmt" "time" + corev1 "github.com/superproj/onex/pkg/generated/applyconfigurations/core/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" v1 "k8s.io/api/core/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" - - scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" ) // SecretsGetter has a method to return a SecretInterface. @@ -36,6 +38,7 @@ type SecretInterface interface { List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, 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.Secret, err error) + Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) SecretExpansion } @@ -166,3 +169,29 @@ func (c *secrets) Patch(ctx context.Context, name string, pt types.PatchType, da Into(result) return } + +// Apply takes the given apply declarative configuration, applies it and returns the applied secret. +func (c *secrets) Apply(ctx context.Context, secret *corev1.SecretApplyConfiguration, opts metav1.ApplyOptions) (result *v1.Secret, err error) { + if secret == nil { + return nil, fmt.Errorf("secret provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(secret) + if err != nil { + return nil, err + } + name := secret.Name + if name == nil { + return nil, fmt.Errorf("secret.Name must be provided to Apply") + } + result = &v1.Secret{} + err = c.client.Patch(types.ApplyPatchType). + Namespace(c.ns). + Resource("secrets"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/doc.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/doc.go new file mode 100644 index 00000000000..30c59f84ddd --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/doc.go @@ -0,0 +1,9 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/doc.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/doc.go new file mode 100644 index 00000000000..c50d07e8a70 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/doc.go @@ -0,0 +1,9 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go new file mode 100644 index 00000000000..9029424ba59 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_flowcontrol_client.go @@ -0,0 +1,33 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/superproj/onex/pkg/generated/clientset/versioned/typed/flowcontrol/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeFlowcontrolV1 struct { + *testing.Fake +} + +func (c *FakeFlowcontrolV1) FlowSchemas() v1.FlowSchemaInterface { + return &FakeFlowSchemas{c} +} + +func (c *FakeFlowcontrolV1) PriorityLevelConfigurations() v1.PriorityLevelConfigurationInterface { + return &FakePriorityLevelConfigurations{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeFlowcontrolV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_flowschema.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_flowschema.go new file mode 100644 index 00000000000..1e795934e44 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_flowschema.go @@ -0,0 +1,167 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + flowcontrolv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/flowcontrol/v1" + v1 "k8s.io/api/flowcontrol/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeFlowSchemas implements FlowSchemaInterface +type FakeFlowSchemas struct { + Fake *FakeFlowcontrolV1 +} + +var flowschemasResource = v1.SchemeGroupVersion.WithResource("flowschemas") + +var flowschemasKind = v1.SchemeGroupVersion.WithKind("FlowSchema") + +// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. +func (c *FakeFlowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(flowschemasResource, name), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), err +} + +// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *FakeFlowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(flowschemasResource, flowschemasKind, opts), &v1.FlowSchemaList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.FlowSchemaList{ListMeta: obj.(*v1.FlowSchemaList).ListMeta} + for _, item := range obj.(*v1.FlowSchemaList).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 flowSchemas. +func (c *FakeFlowSchemas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(flowschemasResource, opts)) +} + +// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. +func (c *FakeFlowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), err +} + +// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. +func (c *FakeFlowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(flowschemasResource, flowSchema), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), 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 *FakeFlowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(flowschemasResource, "status", flowSchema), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), err +} + +// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. +func (c *FakeFlowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(flowschemasResource, name, opts), &v1.FlowSchema{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFlowSchemas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(flowschemasResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1.FlowSchemaList{}) + return err +} + +// Patch applies the patch and returns the patched flowSchema. +func (c *FakeFlowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, name, pt, data, subresources...), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. +func (c *FakeFlowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { + if flowSchema == nil { + return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") + } + data, err := json.Marshal(flowSchema) + if err != nil { + return nil, err + } + name := flowSchema.Name + if name == nil { + return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakeFlowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { + if flowSchema == nil { + return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") + } + data, err := json.Marshal(flowSchema) + if err != nil { + return nil, err + } + name := flowSchema.Name + if name == nil { + return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(flowschemasResource, *name, types.ApplyPatchType, data, "status"), &v1.FlowSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v1.FlowSchema), err +} diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go new file mode 100644 index 00000000000..c4edb778ab6 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/fake/fake_prioritylevelconfiguration.go @@ -0,0 +1,167 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + json "encoding/json" + "fmt" + + flowcontrolv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/flowcontrol/v1" + v1 "k8s.io/api/flowcontrol/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePriorityLevelConfigurations implements PriorityLevelConfigurationInterface +type FakePriorityLevelConfigurations struct { + Fake *FakeFlowcontrolV1 +} + +var prioritylevelconfigurationsResource = v1.SchemeGroupVersion.WithResource("prioritylevelconfigurations") + +var prioritylevelconfigurationsKind = v1.SchemeGroupVersion.WithKind("PriorityLevelConfiguration") + +// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. +func (c *FakePriorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(prioritylevelconfigurationsResource, name), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), err +} + +// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *FakePriorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(prioritylevelconfigurationsResource, prioritylevelconfigurationsKind, opts), &v1.PriorityLevelConfigurationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1.PriorityLevelConfigurationList{ListMeta: obj.(*v1.PriorityLevelConfigurationList).ListMeta} + for _, item := range obj.(*v1.PriorityLevelConfigurationList).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 priorityLevelConfigurations. +func (c *FakePriorityLevelConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(prioritylevelconfigurationsResource, opts)) +} + +// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. +func (c *FakePriorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), err +} + +// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. +func (c *FakePriorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(prioritylevelconfigurationsResource, priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), 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 *FakePriorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(prioritylevelconfigurationsResource, "status", priorityLevelConfiguration), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), err +} + +// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. +func (c *FakePriorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(prioritylevelconfigurationsResource, name, opts), &v1.PriorityLevelConfiguration{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePriorityLevelConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(prioritylevelconfigurationsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1.PriorityLevelConfigurationList{}) + return err +} + +// Patch applies the patch and returns the patched priorityLevelConfiguration. +func (c *FakePriorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, name, pt, data, subresources...), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), err +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. +func (c *FakePriorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { + if priorityLevelConfiguration == nil { + return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(priorityLevelConfiguration) + if err != nil { + return nil, err + } + name := priorityLevelConfiguration.Name + if name == nil { + return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), err +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *FakePriorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { + if priorityLevelConfiguration == nil { + return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") + } + data, err := json.Marshal(priorityLevelConfiguration) + if err != nil { + return nil, err + } + name := priorityLevelConfiguration.Name + if name == nil { + return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") + } + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(prioritylevelconfigurationsResource, *name, types.ApplyPatchType, data, "status"), &v1.PriorityLevelConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1.PriorityLevelConfiguration), err +} diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/flowcontrol_client.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/flowcontrol_client.go new file mode 100644 index 00000000000..2242b131ae5 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/flowcontrol_client.go @@ -0,0 +1,101 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/flowcontrol/v1" + rest "k8s.io/client-go/rest" +) + +type FlowcontrolV1Interface interface { + RESTClient() rest.Interface + FlowSchemasGetter + PriorityLevelConfigurationsGetter +} + +// FlowcontrolV1Client is used to interact with features provided by the flowcontrol.apiserver.k8s.io group. +type FlowcontrolV1Client struct { + restClient rest.Interface +} + +func (c *FlowcontrolV1Client) FlowSchemas() FlowSchemaInterface { + return newFlowSchemas(c) +} + +func (c *FlowcontrolV1Client) PriorityLevelConfigurations() PriorityLevelConfigurationInterface { + return newPriorityLevelConfigurations(c) +} + +// NewForConfig creates a new FlowcontrolV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*FlowcontrolV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new FlowcontrolV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &FlowcontrolV1Client{client}, nil +} + +// NewForConfigOrDie creates a new FlowcontrolV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *FlowcontrolV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new FlowcontrolV1Client for the given RESTClient. +func New(c rest.Interface) *FlowcontrolV1Client { + return &FlowcontrolV1Client{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 *FlowcontrolV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/flowschema.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/flowschema.go new file mode 100644 index 00000000000..5e6e7aad341 --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/flowschema.go @@ -0,0 +1,232 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + flowcontrolv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/flowcontrol/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/flowcontrol/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" +) + +// FlowSchemasGetter has a method to return a FlowSchemaInterface. +// A group's client should implement this interface. +type FlowSchemasGetter interface { + FlowSchemas() FlowSchemaInterface +} + +// FlowSchemaInterface has methods to work with FlowSchema resources. +type FlowSchemaInterface interface { + Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (*v1.FlowSchema, error) + Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, error) + UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (*v1.FlowSchema, 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.FlowSchema, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.FlowSchemaList, 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.FlowSchema, err error) + Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) + ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) + FlowSchemaExpansion +} + +// flowSchemas implements FlowSchemaInterface +type flowSchemas struct { + client rest.Interface +} + +// newFlowSchemas returns a FlowSchemas +func newFlowSchemas(c *FlowcontrolV1Client) *flowSchemas { + return &flowSchemas{ + client: c.RESTClient(), + } +} + +// Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. +func (c *flowSchemas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.FlowSchema, err error) { + result = &v1.FlowSchema{} + err = c.client.Get(). + Resource("flowschemas"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. +func (c *flowSchemas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.FlowSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.FlowSchemaList{} + err = c.client.Get(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested flowSchemas. +func (c *flowSchemas) 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("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. +func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.CreateOptions) (result *v1.FlowSchema, err error) { + result = &v1.FlowSchema{} + err = c.client.Post(). + Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(flowSchema). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. +func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { + result = &v1.FlowSchema{} + err = c.client.Put(). + Resource("flowschemas"). + Name(flowSchema.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(flowSchema). + 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 *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1.FlowSchema, opts metav1.UpdateOptions) (result *v1.FlowSchema, err error) { + result = &v1.FlowSchema{} + err = c.client.Put(). + Resource("flowschemas"). + Name(flowSchema.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(flowSchema). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. +func (c *flowSchemas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("flowschemas"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *flowSchemas) 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("flowschemas"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched flowSchema. +func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.FlowSchema, err error) { + result = &v1.FlowSchema{} + err = c.client.Patch(pt). + Resource("flowschemas"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied flowSchema. +func (c *flowSchemas) Apply(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { + if flowSchema == nil { + return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(flowSchema) + if err != nil { + return nil, err + } + name := flowSchema.Name + if name == nil { + return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") + } + result = &v1.FlowSchema{} + err = c.client.Patch(types.ApplyPatchType). + Resource("flowschemas"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *flowSchemas) ApplyStatus(ctx context.Context, flowSchema *flowcontrolv1.FlowSchemaApplyConfiguration, opts metav1.ApplyOptions) (result *v1.FlowSchema, err error) { + if flowSchema == nil { + return nil, fmt.Errorf("flowSchema provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(flowSchema) + if err != nil { + return nil, err + } + + name := flowSchema.Name + if name == nil { + return nil, fmt.Errorf("flowSchema.Name must be provided to Apply") + } + + result = &v1.FlowSchema{} + err = c.client.Patch(types.ApplyPatchType). + Resource("flowschemas"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/apis/core/zz_generated.deepcopy.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/generated_expansion.go similarity index 63% rename from pkg/apis/core/zz_generated.deepcopy.go rename to pkg/generated/clientset/versioned/typed/flowcontrol/v1/generated_expansion.go index 94062c66314..825a7d2899e 100644 --- a/pkg/apis/core/zz_generated.deepcopy.go +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/generated_expansion.go @@ -1,11 +1,12 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - // Copyright 2022 Lingfei Kong . All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. The original repo for // this file is https://github.com/superproj/onex. -// Code generated by deepcopy-gen. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +type FlowSchemaExpansion interface{} -package core +type PriorityLevelConfigurationExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/flowcontrol/v1/prioritylevelconfiguration.go b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/prioritylevelconfiguration.go new file mode 100644 index 00000000000..0c8dbf0b47d --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/flowcontrol/v1/prioritylevelconfiguration.go @@ -0,0 +1,232 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + json "encoding/json" + "fmt" + "time" + + flowcontrolv1 "github.com/superproj/onex/pkg/generated/applyconfigurations/flowcontrol/v1" + scheme "github.com/superproj/onex/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/flowcontrol/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" +) + +// PriorityLevelConfigurationsGetter has a method to return a PriorityLevelConfigurationInterface. +// A group's client should implement this interface. +type PriorityLevelConfigurationsGetter interface { + PriorityLevelConfigurations() PriorityLevelConfigurationInterface +} + +// PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. +type PriorityLevelConfigurationInterface interface { + Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*v1.PriorityLevelConfiguration, error) + Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, error) + UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*v1.PriorityLevelConfiguration, 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.PriorityLevelConfiguration, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityLevelConfigurationList, 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.PriorityLevelConfiguration, err error) + Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) + ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) + PriorityLevelConfigurationExpansion +} + +// priorityLevelConfigurations implements PriorityLevelConfigurationInterface +type priorityLevelConfigurations struct { + client rest.Interface +} + +// newPriorityLevelConfigurations returns a PriorityLevelConfigurations +func newPriorityLevelConfigurations(c *FlowcontrolV1Client) *priorityLevelConfigurations { + return &priorityLevelConfigurations{ + client: c.RESTClient(), + } +} + +// Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. +func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityLevelConfiguration, err error) { + result = &v1.PriorityLevelConfiguration{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. +func (c *priorityLevelConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityLevelConfigurationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PriorityLevelConfigurationList{} + err = c.client.Get(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. +func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. +func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.CreateOptions) (result *v1.PriorityLevelConfiguration, err error) { + result = &v1.PriorityLevelConfiguration{} + err = c.client.Post(). + Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(priorityLevelConfiguration). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. +func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { + result = &v1.PriorityLevelConfiguration{} + err = c.client.Put(). + Resource("prioritylevelconfigurations"). + Name(priorityLevelConfiguration.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(priorityLevelConfiguration). + 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 *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (result *v1.PriorityLevelConfiguration, err error) { + result = &v1.PriorityLevelConfiguration{} + err = c.client.Put(). + Resource("prioritylevelconfigurations"). + Name(priorityLevelConfiguration.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(priorityLevelConfiguration). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. +func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("prioritylevelconfigurations"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *priorityLevelConfigurations) 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("prioritylevelconfigurations"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched priorityLevelConfiguration. +func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityLevelConfiguration, err error) { + result = &v1.PriorityLevelConfiguration{} + err = c.client.Patch(pt). + Resource("prioritylevelconfigurations"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// Apply takes the given apply declarative configuration, applies it and returns the applied priorityLevelConfiguration. +func (c *priorityLevelConfigurations) Apply(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { + if priorityLevelConfiguration == nil { + return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(priorityLevelConfiguration) + if err != nil { + return nil, err + } + name := priorityLevelConfiguration.Name + if name == nil { + return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") + } + result = &v1.PriorityLevelConfiguration{} + err = c.client.Patch(types.ApplyPatchType). + Resource("prioritylevelconfigurations"). + Name(*name). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} + +// ApplyStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating ApplyStatus(). +func (c *priorityLevelConfigurations) ApplyStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1.PriorityLevelConfigurationApplyConfiguration, opts metav1.ApplyOptions) (result *v1.PriorityLevelConfiguration, err error) { + if priorityLevelConfiguration == nil { + return nil, fmt.Errorf("priorityLevelConfiguration provided to Apply must not be nil") + } + patchOpts := opts.ToPatchOptions() + data, err := json.Marshal(priorityLevelConfiguration) + if err != nil { + return nil, err + } + + name := priorityLevelConfiguration.Name + if name == nil { + return nil, fmt.Errorf("priorityLevelConfiguration.Name must be provided to Apply") + } + + result = &v1.PriorityLevelConfiguration{} + err = c.client.Patch(types.ApplyPatchType). + Resource("prioritylevelconfigurations"). + Name(*name). + SubResource("status"). + VersionedParams(&patchOpts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/informers/apiextensions/interface.go b/pkg/generated/informers/apiextensions/interface.go new file mode 100644 index 00000000000..6976327009e --- /dev/null +++ b/pkg/generated/informers/apiextensions/interface.go @@ -0,0 +1,35 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package apiextensions + +import ( + v1 "github.com/superproj/onex/pkg/generated/informers/apiextensions/v1" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/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/pkg/generated/informers/apiextensions/v1/customresourcedefinition.go b/pkg/generated/informers/apiextensions/v1/customresourcedefinition.go new file mode 100644 index 00000000000..942137d96fe --- /dev/null +++ b/pkg/generated/informers/apiextensions/v1/customresourcedefinition.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/apiextensions/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/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" +) + +// CustomResourceDefinitionInformer provides access to a shared informer and lister for +// CustomResourceDefinitions. +type CustomResourceDefinitionInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CustomResourceDefinitionLister +} + +type customResourceDefinitionInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCustomResourceDefinitionInformer constructs a new informer for CustomResourceDefinition 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 NewCustomResourceDefinitionInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCustomResourceDefinitionInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCustomResourceDefinitionInformer constructs a new informer for CustomResourceDefinition 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 NewFilteredCustomResourceDefinitionInformer(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.ApiextensionsV1().CustomResourceDefinitions().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ApiextensionsV1().CustomResourceDefinitions().Watch(context.TODO(), options) + }, + }, + &apiextensionsv1.CustomResourceDefinition{}, + resyncPeriod, + indexers, + ) +} + +func (f *customResourceDefinitionInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCustomResourceDefinitionInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *customResourceDefinitionInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&apiextensionsv1.CustomResourceDefinition{}, f.defaultInformer) +} + +func (f *customResourceDefinitionInformer) Lister() v1.CustomResourceDefinitionLister { + return v1.NewCustomResourceDefinitionLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/apiextensions/v1/interface.go b/pkg/generated/informers/apiextensions/v1/interface.go new file mode 100644 index 00000000000..16ff0b3906b --- /dev/null +++ b/pkg/generated/informers/apiextensions/v1/interface.go @@ -0,0 +1,34 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // CustomResourceDefinitions returns a CustomResourceDefinitionInformer. + CustomResourceDefinitions() CustomResourceDefinitionInformer +} + +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} +} + +// CustomResourceDefinitions returns a CustomResourceDefinitionInformer. +func (v *version) CustomResourceDefinitions() CustomResourceDefinitionInformer { + return &customResourceDefinitionInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/informers/externalversions/apps/interface.go b/pkg/generated/informers/apps/interface.go similarity index 89% rename from pkg/generated/informers/externalversions/apps/interface.go rename to pkg/generated/informers/apps/interface.go index 494d97ede35..356053ae474 100644 --- a/pkg/generated/informers/externalversions/apps/interface.go +++ b/pkg/generated/informers/apps/interface.go @@ -8,8 +8,8 @@ package apps import ( - v1beta1 "github.com/superproj/onex/pkg/generated/informers/externalversions/apps/v1beta1" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" + v1beta1 "github.com/superproj/onex/pkg/generated/informers/apps/v1beta1" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/generated/informers/externalversions/apps/v1beta1/chain.go b/pkg/generated/informers/apps/v1beta1/chain.go similarity index 98% rename from pkg/generated/informers/externalversions/apps/v1beta1/chain.go rename to pkg/generated/informers/apps/v1beta1/chain.go index 697e97697c0..559148dfa0f 100644 --- a/pkg/generated/informers/externalversions/apps/v1beta1/chain.go +++ b/pkg/generated/informers/apps/v1beta1/chain.go @@ -11,15 +11,14 @@ import ( "context" time "time" + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" 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" - - appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" ) // ChainInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/apps/v1beta1/chargerequest.go b/pkg/generated/informers/apps/v1beta1/chargerequest.go similarity index 98% rename from pkg/generated/informers/externalversions/apps/v1beta1/chargerequest.go rename to pkg/generated/informers/apps/v1beta1/chargerequest.go index 2cc580934e3..9de793932d3 100644 --- a/pkg/generated/informers/externalversions/apps/v1beta1/chargerequest.go +++ b/pkg/generated/informers/apps/v1beta1/chargerequest.go @@ -11,15 +11,14 @@ import ( "context" time "time" + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" 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" - - appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" ) // ChargeRequestInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/apps/v1beta1/interface.go b/pkg/generated/informers/apps/v1beta1/interface.go similarity index 97% rename from pkg/generated/informers/externalversions/apps/v1beta1/interface.go rename to pkg/generated/informers/apps/v1beta1/interface.go index 9fcc98f6831..240669064ef 100644 --- a/pkg/generated/informers/externalversions/apps/v1beta1/interface.go +++ b/pkg/generated/informers/apps/v1beta1/interface.go @@ -8,7 +8,7 @@ package v1beta1 import ( - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/generated/informers/externalversions/apps/v1beta1/miner.go b/pkg/generated/informers/apps/v1beta1/miner.go similarity index 98% rename from pkg/generated/informers/externalversions/apps/v1beta1/miner.go rename to pkg/generated/informers/apps/v1beta1/miner.go index 0e26a843c68..1293ea2dcd8 100644 --- a/pkg/generated/informers/externalversions/apps/v1beta1/miner.go +++ b/pkg/generated/informers/apps/v1beta1/miner.go @@ -11,15 +11,14 @@ import ( "context" time "time" + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" 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" - - appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" ) // MinerInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/apps/v1beta1/minerset.go b/pkg/generated/informers/apps/v1beta1/minerset.go similarity index 98% rename from pkg/generated/informers/externalversions/apps/v1beta1/minerset.go rename to pkg/generated/informers/apps/v1beta1/minerset.go index 51ee7b95f83..7d3803bead8 100644 --- a/pkg/generated/informers/externalversions/apps/v1beta1/minerset.go +++ b/pkg/generated/informers/apps/v1beta1/minerset.go @@ -11,15 +11,14 @@ import ( "context" time "time" + appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" 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" - - appsv1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1beta1 "github.com/superproj/onex/pkg/generated/listers/apps/v1beta1" ) // MinerSetInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/coordination/interface.go b/pkg/generated/informers/coordination/interface.go similarity index 89% rename from pkg/generated/informers/externalversions/coordination/interface.go rename to pkg/generated/informers/coordination/interface.go index 15e13b79dba..40c0ef086fc 100644 --- a/pkg/generated/informers/externalversions/coordination/interface.go +++ b/pkg/generated/informers/coordination/interface.go @@ -8,8 +8,8 @@ package coordination import ( - v1 "github.com/superproj/onex/pkg/generated/informers/externalversions/coordination/v1" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/informers/coordination/v1" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/generated/informers/externalversions/coordination/v1/interface.go b/pkg/generated/informers/coordination/v1/interface.go similarity index 96% rename from pkg/generated/informers/externalversions/coordination/v1/interface.go rename to pkg/generated/informers/coordination/v1/interface.go index 4540202b8be..71520867d62 100644 --- a/pkg/generated/informers/externalversions/coordination/v1/interface.go +++ b/pkg/generated/informers/coordination/v1/interface.go @@ -8,7 +8,7 @@ package v1 import ( - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/generated/informers/externalversions/coordination/v1/lease.go b/pkg/generated/informers/coordination/v1/lease.go similarity index 96% rename from pkg/generated/informers/externalversions/coordination/v1/lease.go rename to pkg/generated/informers/coordination/v1/lease.go index b7052c2f276..feb3392cc48 100644 --- a/pkg/generated/informers/externalversions/coordination/v1/lease.go +++ b/pkg/generated/informers/coordination/v1/lease.go @@ -11,15 +11,14 @@ import ( "context" time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/coordination/v1" + coordinationv1 "k8s.io/api/coordination/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" - - coordinationv1 "github.com/superproj/onex/pkg/apis/coordination/v1" - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/superproj/onex/pkg/generated/listers/coordination/v1" ) // LeaseInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/core/interface.go b/pkg/generated/informers/core/interface.go similarity index 90% rename from pkg/generated/informers/externalversions/core/interface.go rename to pkg/generated/informers/core/interface.go index 26e1e3d997b..de96bdd9df8 100644 --- a/pkg/generated/informers/externalversions/core/interface.go +++ b/pkg/generated/informers/core/interface.go @@ -8,8 +8,8 @@ package core import ( - v1 "github.com/superproj/onex/pkg/generated/informers/externalversions/core/v1" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/informers/core/v1" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" ) // Interface provides access to each of this group's versions. diff --git a/pkg/generated/informers/externalversions/core/v1/configmap.go b/pkg/generated/informers/core/v1/configmap.go similarity index 98% rename from pkg/generated/informers/externalversions/core/v1/configmap.go rename to pkg/generated/informers/core/v1/configmap.go index 92320e3ff71..b64863a293f 100644 --- a/pkg/generated/informers/externalversions/core/v1/configmap.go +++ b/pkg/generated/informers/core/v1/configmap.go @@ -11,15 +11,14 @@ import ( "context" time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" corev1 "k8s.io/api/core/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" - - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" ) // ConfigMapInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/core/v1/event.go b/pkg/generated/informers/core/v1/event.go similarity index 98% rename from pkg/generated/informers/externalversions/core/v1/event.go rename to pkg/generated/informers/core/v1/event.go index 2832e7a873b..c322e76c8c5 100644 --- a/pkg/generated/informers/externalversions/core/v1/event.go +++ b/pkg/generated/informers/core/v1/event.go @@ -11,15 +11,14 @@ import ( "context" time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" corev1 "k8s.io/api/core/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" - - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" ) // EventInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/core/v1/interface.go b/pkg/generated/informers/core/v1/interface.go similarity index 97% rename from pkg/generated/informers/externalversions/core/v1/interface.go rename to pkg/generated/informers/core/v1/interface.go index 4a5a928f2cc..c5de39cd9fd 100644 --- a/pkg/generated/informers/externalversions/core/v1/interface.go +++ b/pkg/generated/informers/core/v1/interface.go @@ -8,7 +8,7 @@ package v1 import ( - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" ) // Interface provides access to all the informers in this group version. diff --git a/pkg/generated/informers/externalversions/core/v1/namespace.go b/pkg/generated/informers/core/v1/namespace.go similarity index 98% rename from pkg/generated/informers/externalversions/core/v1/namespace.go rename to pkg/generated/informers/core/v1/namespace.go index 16d03d7517b..45476172723 100644 --- a/pkg/generated/informers/externalversions/core/v1/namespace.go +++ b/pkg/generated/informers/core/v1/namespace.go @@ -11,15 +11,14 @@ import ( "context" time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" corev1 "k8s.io/api/core/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" - - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" ) // NamespaceInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/core/v1/secret.go b/pkg/generated/informers/core/v1/secret.go similarity index 98% rename from pkg/generated/informers/externalversions/core/v1/secret.go rename to pkg/generated/informers/core/v1/secret.go index 8fe17e15fa3..a481777b8ac 100644 --- a/pkg/generated/informers/externalversions/core/v1/secret.go +++ b/pkg/generated/informers/core/v1/secret.go @@ -11,15 +11,14 @@ import ( "context" time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" corev1 "k8s.io/api/core/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" - - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" - v1 "github.com/superproj/onex/pkg/generated/listers/core/v1" ) // SecretInformer provides access to a shared informer and lister for diff --git a/pkg/generated/informers/externalversions/factory.go b/pkg/generated/informers/factory.go similarity index 88% rename from pkg/generated/informers/externalversions/factory.go rename to pkg/generated/informers/factory.go index f5209adf246..a3ad90392a9 100644 --- a/pkg/generated/informers/externalversions/factory.go +++ b/pkg/generated/informers/factory.go @@ -5,23 +5,24 @@ // Code generated by informer-gen. DO NOT EDIT. -package externalversions +package informers import ( reflect "reflect" sync "sync" time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + apiextensions "github.com/superproj/onex/pkg/generated/informers/apiextensions" + apps "github.com/superproj/onex/pkg/generated/informers/apps" + coordination "github.com/superproj/onex/pkg/generated/informers/coordination" + core "github.com/superproj/onex/pkg/generated/informers/core" + flowcontrol "github.com/superproj/onex/pkg/generated/informers/flowcontrol" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" - apps "github.com/superproj/onex/pkg/generated/informers/externalversions/apps" - coordination "github.com/superproj/onex/pkg/generated/informers/externalversions/coordination" - core "github.com/superproj/onex/pkg/generated/informers/externalversions/core" - internalinterfaces "github.com/superproj/onex/pkg/generated/informers/externalversions/internalinterfaces" ) // SharedInformerOption defines the functional option type for SharedInformerFactory. @@ -34,6 +35,7 @@ type sharedInformerFactory struct { lock sync.Mutex defaultResync time.Duration customResync map[reflect.Type]time.Duration + transform cache.TransformFunc informers map[reflect.Type]cache.SharedIndexInformer // startedInformers is used for tracking which informers have been started. @@ -72,6 +74,14 @@ func WithNamespace(namespace string) SharedInformerOption { } } +// WithTransform sets a transform on all informers. +func WithTransform(transform cache.TransformFunc) SharedInformerOption { + return func(factory *sharedInformerFactory) *sharedInformerFactory { + factory.transform = transform + 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) @@ -158,7 +168,7 @@ func (f *sharedInformerFactory) WaitForCacheSync(stopCh <-chan struct{}) map[ref return res } -// InternalInformerFor returns the SharedIndexInformer for obj using an internal +// InformerFor returns the SharedIndexInformer for obj using an internal // client. func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer { f.lock.Lock() @@ -176,6 +186,7 @@ func (f *sharedInformerFactory) InformerFor(obj runtime.Object, newFunc internal } informer = newFunc(f.client, resyncPeriod) + informer.SetTransform(f.transform) f.informers[informerType] = informer return informer @@ -231,13 +242,19 @@ type SharedInformerFactory interface { // ForResource gives generic access to a shared informer of the matching type. ForResource(resource schema.GroupVersionResource) (GenericInformer, error) - // InternalInformerFor returns the SharedIndexInformer for obj using an internal + // InformerFor returns the SharedIndexInformer for obj using an internal // client. InformerFor(obj runtime.Object, newFunc internalinterfaces.NewInformerFunc) cache.SharedIndexInformer + Apiextensions() apiextensions.Interface Apps() apps.Interface Coordination() coordination.Interface Core() core.Interface + Flowcontrol() flowcontrol.Interface +} + +func (f *sharedInformerFactory) Apiextensions() apiextensions.Interface { + return apiextensions.New(f, f.namespace, f.tweakListOptions) } func (f *sharedInformerFactory) Apps() apps.Interface { @@ -251,3 +268,7 @@ func (f *sharedInformerFactory) Coordination() coordination.Interface { func (f *sharedInformerFactory) Core() core.Interface { return core.New(f, f.namespace, f.tweakListOptions) } + +func (f *sharedInformerFactory) Flowcontrol() flowcontrol.Interface { + return flowcontrol.New(f, f.namespace, f.tweakListOptions) +} diff --git a/pkg/generated/informers/flowcontrol/interface.go b/pkg/generated/informers/flowcontrol/interface.go new file mode 100644 index 00000000000..ad5563c20c4 --- /dev/null +++ b/pkg/generated/informers/flowcontrol/interface.go @@ -0,0 +1,35 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package flowcontrol + +import ( + v1 "github.com/superproj/onex/pkg/generated/informers/flowcontrol/v1" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/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/pkg/generated/informers/flowcontrol/v1/flowschema.go b/pkg/generated/informers/flowcontrol/v1/flowschema.go new file mode 100644 index 00000000000..8b8ac4ce63d --- /dev/null +++ b/pkg/generated/informers/flowcontrol/v1/flowschema.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/flowcontrol/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/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" +) + +// FlowSchemaInformer provides access to a shared informer and lister for +// FlowSchemas. +type FlowSchemaInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.FlowSchemaLister +} + +type flowSchemaInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewFlowSchemaInformer constructs a new informer for FlowSchema 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 NewFlowSchemaInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredFlowSchemaInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredFlowSchemaInformer constructs a new informer for FlowSchema 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 NewFilteredFlowSchemaInformer(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.FlowcontrolV1().FlowSchemas().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1().FlowSchemas().Watch(context.TODO(), options) + }, + }, + &flowcontrolv1.FlowSchema{}, + resyncPeriod, + indexers, + ) +} + +func (f *flowSchemaInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredFlowSchemaInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *flowSchemaInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&flowcontrolv1.FlowSchema{}, f.defaultInformer) +} + +func (f *flowSchemaInformer) Lister() v1.FlowSchemaLister { + return v1.NewFlowSchemaLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/flowcontrol/v1/interface.go b/pkg/generated/informers/flowcontrol/v1/interface.go new file mode 100644 index 00000000000..f5ed5c1c6a4 --- /dev/null +++ b/pkg/generated/informers/flowcontrol/v1/interface.go @@ -0,0 +1,41 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" +) + +// Interface provides access to all the informers in this group version. +type Interface interface { + // FlowSchemas returns a FlowSchemaInformer. + FlowSchemas() FlowSchemaInformer + // PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. + PriorityLevelConfigurations() PriorityLevelConfigurationInformer +} + +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} +} + +// FlowSchemas returns a FlowSchemaInformer. +func (v *version) FlowSchemas() FlowSchemaInformer { + return &flowSchemaInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + +// PriorityLevelConfigurations returns a PriorityLevelConfigurationInformer. +func (v *version) PriorityLevelConfigurations() PriorityLevelConfigurationInformer { + return &priorityLevelConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/pkg/generated/informers/flowcontrol/v1/prioritylevelconfiguration.go b/pkg/generated/informers/flowcontrol/v1/prioritylevelconfiguration.go new file mode 100644 index 00000000000..1ea8ef9c8c7 --- /dev/null +++ b/pkg/generated/informers/flowcontrol/v1/prioritylevelconfiguration.go @@ -0,0 +1,78 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" + internalinterfaces "github.com/superproj/onex/pkg/generated/informers/internalinterfaces" + v1 "github.com/superproj/onex/pkg/generated/listers/flowcontrol/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/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" +) + +// PriorityLevelConfigurationInformer provides access to a shared informer and lister for +// PriorityLevelConfigurations. +type PriorityLevelConfigurationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PriorityLevelConfigurationLister +} + +type priorityLevelConfigurationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration 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 NewPriorityLevelConfigurationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredPriorityLevelConfigurationInformer constructs a new informer for PriorityLevelConfiguration 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 NewFilteredPriorityLevelConfigurationInformer(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.FlowcontrolV1().PriorityLevelConfigurations().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.FlowcontrolV1().PriorityLevelConfigurations().Watch(context.TODO(), options) + }, + }, + &flowcontrolv1.PriorityLevelConfiguration{}, + resyncPeriod, + indexers, + ) +} + +func (f *priorityLevelConfigurationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPriorityLevelConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *priorityLevelConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&flowcontrolv1.PriorityLevelConfiguration{}, f.defaultInformer) +} + +func (f *priorityLevelConfigurationInformer) Lister() v1.PriorityLevelConfigurationLister { + return v1.NewPriorityLevelConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/generic.go similarity index 75% rename from pkg/generated/informers/externalversions/generic.go rename to pkg/generated/informers/generic.go index 6dce93187a7..c2de5e57340 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/generic.go @@ -5,17 +5,18 @@ // Code generated by informer-gen. DO NOT EDIT. -package externalversions +package informers import ( "fmt" + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" + coordinationv1 "k8s.io/api/coordination/v1" corev1 "k8s.io/api/core/v1" + flowcontrolv1 "k8s.io/api/flowcontrol/v1" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" - v1 "github.com/superproj/onex/pkg/apis/coordination/v1" ) // GenericInformer is type of SharedIndexInformer which will locate and delegate to other @@ -44,7 +45,11 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=apps.onex.io, Version=v1beta1 + // Group=apiextensions.k8s.io, Version=v1 + case v1.SchemeGroupVersion.WithResource("customresourcedefinitions"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Apiextensions().V1().CustomResourceDefinitions().Informer()}, nil + + // Group=apps.onex.io, Version=v1beta1 case v1beta1.SchemeGroupVersion.WithResource("chains"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().Chains().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("chargerequests"): @@ -55,7 +60,7 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().MinerSets().Informer()}, nil // Group=coordination.k8s.io, Version=v1 - case v1.SchemeGroupVersion.WithResource("leases"): + case coordinationv1.SchemeGroupVersion.WithResource("leases"): return &genericInformer{resource: resource.GroupResource(), informer: f.Coordination().V1().Leases().Informer()}, nil // Group=core, Version=v1 @@ -68,6 +73,12 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource case corev1.SchemeGroupVersion.WithResource("secrets"): return &genericInformer{resource: resource.GroupResource(), informer: f.Core().V1().Secrets().Informer()}, nil + // Group=flowcontrol.apiserver.k8s.io, Version=v1 + case flowcontrolv1.SchemeGroupVersion.WithResource("flowschemas"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().FlowSchemas().Informer()}, nil + case flowcontrolv1.SchemeGroupVersion.WithResource("prioritylevelconfigurations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Flowcontrol().V1().PriorityLevelConfigurations().Informer()}, nil + } return nil, fmt.Errorf("no informer found for %v", resource) diff --git a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go b/pkg/generated/informers/internalinterfaces/factory_interfaces.go similarity index 99% rename from pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go rename to pkg/generated/informers/internalinterfaces/factory_interfaces.go index 8aa2da48fe0..62158e57cf8 100644 --- a/pkg/generated/informers/externalversions/internalinterfaces/factory_interfaces.go +++ b/pkg/generated/informers/internalinterfaces/factory_interfaces.go @@ -10,11 +10,10 @@ package internalinterfaces import ( time "time" + versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" cache "k8s.io/client-go/tools/cache" - - versioned "github.com/superproj/onex/pkg/generated/clientset/versioned" ) // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. diff --git a/pkg/generated/listers/apiextensions/v1/customresourcedefinition.go b/pkg/generated/listers/apiextensions/v1/customresourcedefinition.go new file mode 100644 index 00000000000..9e1b663083f --- /dev/null +++ b/pkg/generated/listers/apiextensions/v1/customresourcedefinition.go @@ -0,0 +1,57 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CustomResourceDefinitionLister helps list CustomResourceDefinitions. +// All objects returned here must be treated as read-only. +type CustomResourceDefinitionLister interface { + // List lists all CustomResourceDefinitions in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.CustomResourceDefinition, err error) + // Get retrieves the CustomResourceDefinition from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.CustomResourceDefinition, error) + CustomResourceDefinitionListerExpansion +} + +// customResourceDefinitionLister implements the CustomResourceDefinitionLister interface. +type customResourceDefinitionLister struct { + indexer cache.Indexer +} + +// NewCustomResourceDefinitionLister returns a new CustomResourceDefinitionLister. +func NewCustomResourceDefinitionLister(indexer cache.Indexer) CustomResourceDefinitionLister { + return &customResourceDefinitionLister{indexer: indexer} +} + +// List lists all CustomResourceDefinitions in the indexer. +func (s *customResourceDefinitionLister) List(selector labels.Selector) (ret []*v1.CustomResourceDefinition, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.CustomResourceDefinition)) + }) + return ret, err +} + +// Get retrieves the CustomResourceDefinition from the index for a given name. +func (s *customResourceDefinitionLister) Get(name string) (*v1.CustomResourceDefinition, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("customresourcedefinition"), name) + } + return obj.(*v1.CustomResourceDefinition), nil +} diff --git a/pkg/apis/coordination/doc.go b/pkg/generated/listers/apiextensions/v1/expansion_generated.go similarity index 52% rename from pkg/apis/coordination/doc.go rename to pkg/generated/listers/apiextensions/v1/expansion_generated.go index ccd71f37ac5..fcfb85e918b 100644 --- a/pkg/apis/coordination/doc.go +++ b/pkg/generated/listers/apiextensions/v1/expansion_generated.go @@ -2,9 +2,11 @@ // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. The original repo for // this file is https://github.com/superproj/onex. -// -// +k8s:deepcopy-gen=package -// +groupName=coordination.k8s.io +// Code generated by lister-gen. DO NOT EDIT. -package coordination // import "github.com/superproj/onex/pkg/apis/coordination" +package v1 + +// CustomResourceDefinitionListerExpansion allows custom methods to be added to +// CustomResourceDefinitionLister. +type CustomResourceDefinitionListerExpansion interface{} diff --git a/pkg/generated/listers/apps/v1beta1/chain.go b/pkg/generated/listers/apps/v1beta1/chain.go index a7ffa8ceafd..5d88b7c694f 100644 --- a/pkg/generated/listers/apps/v1beta1/chain.go +++ b/pkg/generated/listers/apps/v1beta1/chain.go @@ -8,11 +8,10 @@ package v1beta1 import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // ChainLister helps list Chains. @@ -38,7 +37,7 @@ func NewChainLister(indexer cache.Indexer) ChainLister { // List lists all Chains in the indexer. func (s *chainLister) List(selector labels.Selector) (ret []*v1beta1.Chain, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.Chain)) }) return ret, err @@ -70,7 +69,7 @@ type chainNamespaceLister struct { // List lists all Chains in the indexer for a given namespace. func (s chainNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Chain, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.Chain)) }) return ret, err diff --git a/pkg/generated/listers/apps/v1beta1/chargerequest.go b/pkg/generated/listers/apps/v1beta1/chargerequest.go index 05f04c2ad2d..7562dfe6bd3 100644 --- a/pkg/generated/listers/apps/v1beta1/chargerequest.go +++ b/pkg/generated/listers/apps/v1beta1/chargerequest.go @@ -8,11 +8,10 @@ package v1beta1 import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // ChargeRequestLister helps list ChargeRequests. @@ -38,7 +37,7 @@ func NewChargeRequestLister(indexer cache.Indexer) ChargeRequestLister { // List lists all ChargeRequests in the indexer. func (s *chargeRequestLister) List(selector labels.Selector) (ret []*v1beta1.ChargeRequest, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.ChargeRequest)) }) return ret, err @@ -70,7 +69,7 @@ type chargeRequestNamespaceLister struct { // List lists all ChargeRequests in the indexer for a given namespace. func (s chargeRequestNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ChargeRequest, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.ChargeRequest)) }) return ret, err diff --git a/pkg/generated/listers/apps/v1beta1/expansion_generated.go b/pkg/generated/listers/apps/v1beta1/expansion_generated.go index 7417aac39b3..4938f47f939 100644 --- a/pkg/generated/listers/apps/v1beta1/expansion_generated.go +++ b/pkg/generated/listers/apps/v1beta1/expansion_generated.go @@ -9,32 +9,32 @@ package v1beta1 // ChainListerExpansion allows custom methods to be added to // ChainLister. -type ChainListerExpansion any +type ChainListerExpansion interface{} // ChainNamespaceListerExpansion allows custom methods to be added to // ChainNamespaceLister. -type ChainNamespaceListerExpansion any +type ChainNamespaceListerExpansion interface{} // ChargeRequestListerExpansion allows custom methods to be added to // ChargeRequestLister. -type ChargeRequestListerExpansion any +type ChargeRequestListerExpansion interface{} // ChargeRequestNamespaceListerExpansion allows custom methods to be added to // ChargeRequestNamespaceLister. -type ChargeRequestNamespaceListerExpansion any +type ChargeRequestNamespaceListerExpansion interface{} // MinerListerExpansion allows custom methods to be added to // MinerLister. -type MinerListerExpansion any +type MinerListerExpansion interface{} // MinerNamespaceListerExpansion allows custom methods to be added to // MinerNamespaceLister. -type MinerNamespaceListerExpansion any +type MinerNamespaceListerExpansion interface{} // MinerSetListerExpansion allows custom methods to be added to // MinerSetLister. -type MinerSetListerExpansion any +type MinerSetListerExpansion interface{} // MinerSetNamespaceListerExpansion allows custom methods to be added to // MinerSetNamespaceLister. -type MinerSetNamespaceListerExpansion any +type MinerSetNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/apps/v1beta1/miner.go b/pkg/generated/listers/apps/v1beta1/miner.go index 9788e4187a4..3465e49074d 100644 --- a/pkg/generated/listers/apps/v1beta1/miner.go +++ b/pkg/generated/listers/apps/v1beta1/miner.go @@ -8,11 +8,10 @@ package v1beta1 import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // MinerLister helps list Miners. @@ -38,7 +37,7 @@ func NewMinerLister(indexer cache.Indexer) MinerLister { // List lists all Miners in the indexer. func (s *minerLister) List(selector labels.Selector) (ret []*v1beta1.Miner, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.Miner)) }) return ret, err @@ -70,7 +69,7 @@ type minerNamespaceLister struct { // List lists all Miners in the indexer for a given namespace. func (s minerNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Miner, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.Miner)) }) return ret, err diff --git a/pkg/generated/listers/apps/v1beta1/minerset.go b/pkg/generated/listers/apps/v1beta1/minerset.go index 68fc3265dfb..37071f8d107 100644 --- a/pkg/generated/listers/apps/v1beta1/minerset.go +++ b/pkg/generated/listers/apps/v1beta1/minerset.go @@ -8,11 +8,10 @@ package v1beta1 import ( + v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1beta1 "github.com/superproj/onex/pkg/apis/apps/v1beta1" ) // MinerSetLister helps list MinerSets. @@ -38,7 +37,7 @@ func NewMinerSetLister(indexer cache.Indexer) MinerSetLister { // List lists all MinerSets in the indexer. func (s *minerSetLister) List(selector labels.Selector) (ret []*v1beta1.MinerSet, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.MinerSet)) }) return ret, err @@ -70,7 +69,7 @@ type minerSetNamespaceLister struct { // List lists all MinerSets in the indexer for a given namespace. func (s minerSetNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.MinerSet, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1beta1.MinerSet)) }) return ret, err diff --git a/pkg/generated/listers/coordination/v1/expansion_generated.go b/pkg/generated/listers/coordination/v1/expansion_generated.go index 1aeedabde89..e715c003193 100644 --- a/pkg/generated/listers/coordination/v1/expansion_generated.go +++ b/pkg/generated/listers/coordination/v1/expansion_generated.go @@ -9,8 +9,8 @@ package v1 // LeaseListerExpansion allows custom methods to be added to // LeaseLister. -type LeaseListerExpansion any +type LeaseListerExpansion interface{} // LeaseNamespaceListerExpansion allows custom methods to be added to // LeaseNamespaceLister. -type LeaseNamespaceListerExpansion any +type LeaseNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/coordination/v1/lease.go b/pkg/generated/listers/coordination/v1/lease.go index 598358c3e3e..f8071f8c880 100644 --- a/pkg/generated/listers/coordination/v1/lease.go +++ b/pkg/generated/listers/coordination/v1/lease.go @@ -8,11 +8,10 @@ package v1 import ( + v1 "k8s.io/api/coordination/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" - - v1 "github.com/superproj/onex/pkg/apis/coordination/v1" ) // LeaseLister helps list Leases. @@ -38,7 +37,7 @@ func NewLeaseLister(indexer cache.Indexer) LeaseLister { // List lists all Leases in the indexer. func (s *leaseLister) List(selector labels.Selector) (ret []*v1.Lease, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Lease)) }) return ret, err @@ -70,7 +69,7 @@ type leaseNamespaceLister struct { // List lists all Leases in the indexer for a given namespace. func (s leaseNamespaceLister) List(selector labels.Selector) (ret []*v1.Lease, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1.Lease)) }) return ret, err diff --git a/pkg/generated/listers/core/v1/configmap.go b/pkg/generated/listers/core/v1/configmap.go index b7929086626..cad3deb388d 100644 --- a/pkg/generated/listers/core/v1/configmap.go +++ b/pkg/generated/listers/core/v1/configmap.go @@ -37,7 +37,7 @@ func NewConfigMapLister(indexer cache.Indexer) ConfigMapLister { // List lists all ConfigMaps in the indexer. func (s *configMapLister) List(selector labels.Selector) (ret []*v1.ConfigMap, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.ConfigMap)) }) return ret, err @@ -69,7 +69,7 @@ type configMapNamespaceLister struct { // List lists all ConfigMaps in the indexer for a given namespace. func (s configMapNamespaceLister) List(selector labels.Selector) (ret []*v1.ConfigMap, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1.ConfigMap)) }) return ret, err diff --git a/pkg/generated/listers/core/v1/event.go b/pkg/generated/listers/core/v1/event.go index 4f0997fbd8d..b08029a8c66 100644 --- a/pkg/generated/listers/core/v1/event.go +++ b/pkg/generated/listers/core/v1/event.go @@ -37,7 +37,7 @@ func NewEventLister(indexer cache.Indexer) EventLister { // List lists all Events in the indexer. func (s *eventLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Event)) }) return ret, err @@ -69,7 +69,7 @@ type eventNamespaceLister struct { // List lists all Events in the indexer for a given namespace. func (s eventNamespaceLister) List(selector labels.Selector) (ret []*v1.Event, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1.Event)) }) return ret, err diff --git a/pkg/generated/listers/core/v1/expansion_generated.go b/pkg/generated/listers/core/v1/expansion_generated.go index d0b4853b803..316db1c889e 100644 --- a/pkg/generated/listers/core/v1/expansion_generated.go +++ b/pkg/generated/listers/core/v1/expansion_generated.go @@ -9,28 +9,28 @@ package v1 // ConfigMapListerExpansion allows custom methods to be added to // ConfigMapLister. -type ConfigMapListerExpansion any +type ConfigMapListerExpansion interface{} // ConfigMapNamespaceListerExpansion allows custom methods to be added to // ConfigMapNamespaceLister. -type ConfigMapNamespaceListerExpansion any +type ConfigMapNamespaceListerExpansion interface{} // EventListerExpansion allows custom methods to be added to // EventLister. -type EventListerExpansion any +type EventListerExpansion interface{} // EventNamespaceListerExpansion allows custom methods to be added to // EventNamespaceLister. -type EventNamespaceListerExpansion any +type EventNamespaceListerExpansion interface{} // NamespaceListerExpansion allows custom methods to be added to // NamespaceLister. -type NamespaceListerExpansion any +type NamespaceListerExpansion interface{} // SecretListerExpansion allows custom methods to be added to // SecretLister. -type SecretListerExpansion any +type SecretListerExpansion interface{} // SecretNamespaceListerExpansion allows custom methods to be added to // SecretNamespaceLister. -type SecretNamespaceListerExpansion any +type SecretNamespaceListerExpansion interface{} diff --git a/pkg/generated/listers/core/v1/namespace.go b/pkg/generated/listers/core/v1/namespace.go index 6507f9759ca..21b1360c033 100644 --- a/pkg/generated/listers/core/v1/namespace.go +++ b/pkg/generated/listers/core/v1/namespace.go @@ -38,7 +38,7 @@ func NewNamespaceLister(indexer cache.Indexer) NamespaceLister { // List lists all Namespaces in the indexer. func (s *namespaceLister) List(selector labels.Selector) (ret []*v1.Namespace, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Namespace)) }) return ret, err diff --git a/pkg/generated/listers/core/v1/secret.go b/pkg/generated/listers/core/v1/secret.go index 81661f97a40..3cf309e52a0 100644 --- a/pkg/generated/listers/core/v1/secret.go +++ b/pkg/generated/listers/core/v1/secret.go @@ -37,7 +37,7 @@ func NewSecretLister(indexer cache.Indexer) SecretLister { // List lists all Secrets in the indexer. func (s *secretLister) List(selector labels.Selector) (ret []*v1.Secret, err error) { - err = cache.ListAll(s.indexer, selector, func(m any) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { ret = append(ret, m.(*v1.Secret)) }) return ret, err @@ -69,7 +69,7 @@ type secretNamespaceLister struct { // List lists all Secrets in the indexer for a given namespace. func (s secretNamespaceLister) List(selector labels.Selector) (ret []*v1.Secret, err error) { - err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m any) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { ret = append(ret, m.(*v1.Secret)) }) return ret, err diff --git a/pkg/generated/listers/flowcontrol/v1/expansion_generated.go b/pkg/generated/listers/flowcontrol/v1/expansion_generated.go new file mode 100644 index 00000000000..92eb0e354bd --- /dev/null +++ b/pkg/generated/listers/flowcontrol/v1/expansion_generated.go @@ -0,0 +1,16 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +// FlowSchemaListerExpansion allows custom methods to be added to +// FlowSchemaLister. +type FlowSchemaListerExpansion interface{} + +// PriorityLevelConfigurationListerExpansion allows custom methods to be added to +// PriorityLevelConfigurationLister. +type PriorityLevelConfigurationListerExpansion interface{} diff --git a/pkg/generated/listers/flowcontrol/v1/flowschema.go b/pkg/generated/listers/flowcontrol/v1/flowschema.go new file mode 100644 index 00000000000..3952e338855 --- /dev/null +++ b/pkg/generated/listers/flowcontrol/v1/flowschema.go @@ -0,0 +1,57 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// FlowSchemaLister helps list FlowSchemas. +// All objects returned here must be treated as read-only. +type FlowSchemaLister interface { + // List lists all FlowSchemas in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.FlowSchema, err error) + // Get retrieves the FlowSchema from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.FlowSchema, error) + FlowSchemaListerExpansion +} + +// flowSchemaLister implements the FlowSchemaLister interface. +type flowSchemaLister struct { + indexer cache.Indexer +} + +// NewFlowSchemaLister returns a new FlowSchemaLister. +func NewFlowSchemaLister(indexer cache.Indexer) FlowSchemaLister { + return &flowSchemaLister{indexer: indexer} +} + +// List lists all FlowSchemas in the indexer. +func (s *flowSchemaLister) List(selector labels.Selector) (ret []*v1.FlowSchema, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.FlowSchema)) + }) + return ret, err +} + +// Get retrieves the FlowSchema from the index for a given name. +func (s *flowSchemaLister) Get(name string) (*v1.FlowSchema, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("flowschema"), name) + } + return obj.(*v1.FlowSchema), nil +} diff --git a/pkg/generated/listers/flowcontrol/v1/prioritylevelconfiguration.go b/pkg/generated/listers/flowcontrol/v1/prioritylevelconfiguration.go new file mode 100644 index 00000000000..b52b7df72d7 --- /dev/null +++ b/pkg/generated/listers/flowcontrol/v1/prioritylevelconfiguration.go @@ -0,0 +1,57 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/flowcontrol/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PriorityLevelConfigurationLister helps list PriorityLevelConfigurations. +// All objects returned here must be treated as read-only. +type PriorityLevelConfigurationLister interface { + // List lists all PriorityLevelConfigurations in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) + // Get retrieves the PriorityLevelConfiguration from the index for a given name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PriorityLevelConfiguration, error) + PriorityLevelConfigurationListerExpansion +} + +// priorityLevelConfigurationLister implements the PriorityLevelConfigurationLister interface. +type priorityLevelConfigurationLister struct { + indexer cache.Indexer +} + +// NewPriorityLevelConfigurationLister returns a new PriorityLevelConfigurationLister. +func NewPriorityLevelConfigurationLister(indexer cache.Indexer) PriorityLevelConfigurationLister { + return &priorityLevelConfigurationLister{indexer: indexer} +} + +// List lists all PriorityLevelConfigurations in the indexer. +func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*v1.PriorityLevelConfiguration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PriorityLevelConfiguration)) + }) + return ret, err +} + +// Get retrieves the PriorityLevelConfiguration from the index for a given name. +func (s *priorityLevelConfigurationLister) Get(name string) (*v1.PriorityLevelConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("prioritylevelconfiguration"), name) + } + return obj.(*v1.PriorityLevelConfiguration), nil +} diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index af89a3bc417..8f94746e7ba 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -13,335 +13,394 @@ package openapi import ( - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + intstr "k8s.io/apimachinery/pkg/util/intstr" common "k8s.io/kube-openapi/pkg/common" spec "k8s.io/kube-openapi/pkg/validation/spec" ) func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Chain": schema_pkg_apis_apps_v1beta1_Chain(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainList": schema_pkg_apis_apps_v1beta1_ChainList(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainSpec": schema_pkg_apis_apps_v1beta1_ChainSpec(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainStatus": schema_pkg_apis_apps_v1beta1_ChainStatus(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequest": schema_pkg_apis_apps_v1beta1_ChargeRequest(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestList": schema_pkg_apis_apps_v1beta1_ChargeRequestList(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestSpec": schema_pkg_apis_apps_v1beta1_ChargeRequestSpec(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestStatus": schema_pkg_apis_apps_v1beta1_ChargeRequestStatus(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition": schema_pkg_apis_apps_v1beta1_Condition(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.LocalObjectReference": schema_pkg_apis_apps_v1beta1_LocalObjectReference(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Miner": schema_pkg_apis_apps_v1beta1_Miner(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerAddress": schema_pkg_apis_apps_v1beta1_MinerAddress(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerList": schema_pkg_apis_apps_v1beta1_MinerList(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSet": schema_pkg_apis_apps_v1beta1_MinerSet(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetList": schema_pkg_apis_apps_v1beta1_MinerSetList(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetSpec": schema_pkg_apis_apps_v1beta1_MinerSetSpec(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetStatus": schema_pkg_apis_apps_v1beta1_MinerSetStatus(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec": schema_pkg_apis_apps_v1beta1_MinerSpec(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerStatus": schema_pkg_apis_apps_v1beta1_MinerStatus(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerTemplateSpec": schema_pkg_apis_apps_v1beta1_MinerTemplateSpec(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta": schema_pkg_apis_apps_v1beta1_ObjectMeta(ref), - "github.com/superproj/onex/pkg/apis/apps/v1beta1.PodInfo": schema_pkg_apis_apps_v1beta1_PodInfo(ref), - "github.com/superproj/onex/pkg/apis/coordination/v1.Lease": schema_pkg_apis_coordination_v1_Lease(ref), - "github.com/superproj/onex/pkg/apis/coordination/v1.LeaseList": schema_pkg_apis_coordination_v1_LeaseList(ref), - "github.com/superproj/onex/pkg/apis/coordination/v1.LeaseSpec": schema_pkg_apis_coordination_v1_LeaseSpec(ref), - "k8s.io/api/autoscaling/v1.ContainerResourceMetricSource": schema_k8sio_api_autoscaling_v1_ContainerResourceMetricSource(ref), - "k8s.io/api/autoscaling/v1.ContainerResourceMetricStatus": schema_k8sio_api_autoscaling_v1_ContainerResourceMetricStatus(ref), - "k8s.io/api/autoscaling/v1.CrossVersionObjectReference": schema_k8sio_api_autoscaling_v1_CrossVersionObjectReference(ref), - "k8s.io/api/autoscaling/v1.ExternalMetricSource": schema_k8sio_api_autoscaling_v1_ExternalMetricSource(ref), - "k8s.io/api/autoscaling/v1.ExternalMetricStatus": schema_k8sio_api_autoscaling_v1_ExternalMetricStatus(ref), - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscaler": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscaler(ref), - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerCondition": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerCondition(ref), - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerList": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerList(ref), - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerSpec": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerSpec(ref), - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerStatus": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerStatus(ref), - "k8s.io/api/autoscaling/v1.MetricSpec": schema_k8sio_api_autoscaling_v1_MetricSpec(ref), - "k8s.io/api/autoscaling/v1.MetricStatus": schema_k8sio_api_autoscaling_v1_MetricStatus(ref), - "k8s.io/api/autoscaling/v1.ObjectMetricSource": schema_k8sio_api_autoscaling_v1_ObjectMetricSource(ref), - "k8s.io/api/autoscaling/v1.ObjectMetricStatus": schema_k8sio_api_autoscaling_v1_ObjectMetricStatus(ref), - "k8s.io/api/autoscaling/v1.PodsMetricSource": schema_k8sio_api_autoscaling_v1_PodsMetricSource(ref), - "k8s.io/api/autoscaling/v1.PodsMetricStatus": schema_k8sio_api_autoscaling_v1_PodsMetricStatus(ref), - "k8s.io/api/autoscaling/v1.ResourceMetricSource": schema_k8sio_api_autoscaling_v1_ResourceMetricSource(ref), - "k8s.io/api/autoscaling/v1.ResourceMetricStatus": schema_k8sio_api_autoscaling_v1_ResourceMetricStatus(ref), - "k8s.io/api/autoscaling/v1.Scale": schema_k8sio_api_autoscaling_v1_Scale(ref), - "k8s.io/api/autoscaling/v1.ScaleSpec": schema_k8sio_api_autoscaling_v1_ScaleSpec(ref), - "k8s.io/api/autoscaling/v1.ScaleStatus": schema_k8sio_api_autoscaling_v1_ScaleStatus(ref), - "k8s.io/api/coordination/v1.Lease": schema_k8sio_api_coordination_v1_Lease(ref), - "k8s.io/api/coordination/v1.LeaseList": schema_k8sio_api_coordination_v1_LeaseList(ref), - "k8s.io/api/coordination/v1.LeaseSpec": schema_k8sio_api_coordination_v1_LeaseSpec(ref), - "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.ClaimSource": schema_k8sio_api_core_v1_ClaimSource(ref), - "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), - "k8s.io/api/core/v1.ClusterTrustBundleProjection": schema_k8sio_api_core_v1_ClusterTrustBundleProjection(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.ContainerResizePolicy": schema_k8sio_api_core_v1_ContainerResizePolicy(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.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.GRPCAction": schema_k8sio_api_core_v1_GRPCAction(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.HostAlias": schema_k8sio_api_core_v1_HostAlias(ref), - "k8s.io/api/core/v1.HostIP": schema_k8sio_api_core_v1_HostIP(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.LifecycleHandler": schema_k8sio_api_core_v1_LifecycleHandler(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.ModifyVolumeStatus": schema_k8sio_api_core_v1_ModifyVolumeStatus(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.PodOS": schema_k8sio_api_core_v1_PodOS(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.PodResourceClaim": schema_k8sio_api_core_v1_PodResourceClaim(ref), - "k8s.io/api/core/v1.PodResourceClaimStatus": schema_k8sio_api_core_v1_PodResourceClaimStatus(ref), - "k8s.io/api/core/v1.PodSchedulingGate": schema_k8sio_api_core_v1_PodSchedulingGate(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.PortStatus": schema_k8sio_api_core_v1_PortStatus(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.ProbeHandler": schema_k8sio_api_core_v1_ProbeHandler(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.ResourceClaim": schema_k8sio_api_core_v1_ResourceClaim(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.SleepAction": schema_k8sio_api_core_v1_SleepAction(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.TypedObjectReference": schema_k8sio_api_core_v1_TypedObjectReference(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.VolumeResourceRequirements": schema_k8sio_api_core_v1_VolumeResourceRequirements(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), - "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.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(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.FieldsV1": schema_pkg_apis_meta_v1_FieldsV1(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GetOptions": schema_pkg_apis_meta_v1_GetOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind": schema_pkg_apis_meta_v1_GroupKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupResource": schema_pkg_apis_meta_v1_GroupResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersion": schema_pkg_apis_meta_v1_GroupVersion(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery": schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionKind": schema_pkg_apis_meta_v1_GroupVersionKind(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionResource": schema_pkg_apis_meta_v1_GroupVersionResource(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.InternalEvent": schema_pkg_apis_meta_v1_InternalEvent(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector": schema_pkg_apis_meta_v1_LabelSelector(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement": schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.List": schema_pkg_apis_meta_v1_List(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta": schema_pkg_apis_meta_v1_ListMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ListOptions": schema_pkg_apis_meta_v1_ListOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry": schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime": schema_pkg_apis_meta_v1_MicroTime(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta": schema_pkg_apis_meta_v1_ObjectMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference": schema_pkg_apis_meta_v1_OwnerReference(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata": schema_pkg_apis_meta_v1_PartialObjectMetadata(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadataList": schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Patch": schema_pkg_apis_meta_v1_Patch(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.PatchOptions": schema_pkg_apis_meta_v1_PatchOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Preconditions": schema_pkg_apis_meta_v1_Preconditions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.RootPaths": schema_pkg_apis_meta_v1_RootPaths(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR": schema_pkg_apis_meta_v1_ServerAddressByClientCIDR(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Status": schema_pkg_apis_meta_v1_Status(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause": schema_pkg_apis_meta_v1_StatusCause(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails": schema_pkg_apis_meta_v1_StatusDetails(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Table": schema_pkg_apis_meta_v1_Table(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition": schema_pkg_apis_meta_v1_TableColumnDefinition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableOptions": schema_pkg_apis_meta_v1_TableOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow": schema_pkg_apis_meta_v1_TableRow(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition": schema_pkg_apis_meta_v1_TableRowCondition(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Time": schema_pkg_apis_meta_v1_Time(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.Timestamp": schema_pkg_apis_meta_v1_Timestamp(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.TypeMeta": schema_pkg_apis_meta_v1_TypeMeta(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.UpdateOptions": schema_pkg_apis_meta_v1_UpdateOptions(ref), - "k8s.io/apimachinery/pkg/apis/meta/v1.WatchEvent": schema_pkg_apis_meta_v1_WatchEvent(ref), - "k8s.io/apimachinery/pkg/runtime.RawExtension": schema_k8sio_apimachinery_pkg_runtime_RawExtension(ref), - "k8s.io/apimachinery/pkg/runtime.TypeMeta": schema_k8sio_apimachinery_pkg_runtime_TypeMeta(ref), - "k8s.io/apimachinery/pkg/runtime.Unknown": schema_k8sio_apimachinery_pkg_runtime_Unknown(ref), - "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Chain": schema_pkg_apis_apps_v1beta1_Chain(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainList": schema_pkg_apis_apps_v1beta1_ChainList(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainSpec": schema_pkg_apis_apps_v1beta1_ChainSpec(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainStatus": schema_pkg_apis_apps_v1beta1_ChainStatus(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequest": schema_pkg_apis_apps_v1beta1_ChargeRequest(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestList": schema_pkg_apis_apps_v1beta1_ChargeRequestList(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestSpec": schema_pkg_apis_apps_v1beta1_ChargeRequestSpec(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestStatus": schema_pkg_apis_apps_v1beta1_ChargeRequestStatus(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition": schema_pkg_apis_apps_v1beta1_Condition(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.LocalObjectReference": schema_pkg_apis_apps_v1beta1_LocalObjectReference(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Miner": schema_pkg_apis_apps_v1beta1_Miner(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerAddress": schema_pkg_apis_apps_v1beta1_MinerAddress(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerList": schema_pkg_apis_apps_v1beta1_MinerList(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSet": schema_pkg_apis_apps_v1beta1_MinerSet(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetList": schema_pkg_apis_apps_v1beta1_MinerSetList(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetSpec": schema_pkg_apis_apps_v1beta1_MinerSetSpec(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetStatus": schema_pkg_apis_apps_v1beta1_MinerSetStatus(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec": schema_pkg_apis_apps_v1beta1_MinerSpec(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerStatus": schema_pkg_apis_apps_v1beta1_MinerStatus(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerTemplateSpec": schema_pkg_apis_apps_v1beta1_MinerTemplateSpec(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta": schema_pkg_apis_apps_v1beta1_ObjectMeta(ref), + "github.com/superproj/onex/pkg/apis/apps/v1beta1.PodInfo": schema_pkg_apis_apps_v1beta1_PodInfo(ref), + "k8s.io/api/autoscaling/v1.ContainerResourceMetricSource": schema_k8sio_api_autoscaling_v1_ContainerResourceMetricSource(ref), + "k8s.io/api/autoscaling/v1.ContainerResourceMetricStatus": schema_k8sio_api_autoscaling_v1_ContainerResourceMetricStatus(ref), + "k8s.io/api/autoscaling/v1.CrossVersionObjectReference": schema_k8sio_api_autoscaling_v1_CrossVersionObjectReference(ref), + "k8s.io/api/autoscaling/v1.ExternalMetricSource": schema_k8sio_api_autoscaling_v1_ExternalMetricSource(ref), + "k8s.io/api/autoscaling/v1.ExternalMetricStatus": schema_k8sio_api_autoscaling_v1_ExternalMetricStatus(ref), + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscaler": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscaler(ref), + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerCondition": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerCondition(ref), + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerList": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerList(ref), + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerSpec": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerSpec(ref), + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerStatus": schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerStatus(ref), + "k8s.io/api/autoscaling/v1.MetricSpec": schema_k8sio_api_autoscaling_v1_MetricSpec(ref), + "k8s.io/api/autoscaling/v1.MetricStatus": schema_k8sio_api_autoscaling_v1_MetricStatus(ref), + "k8s.io/api/autoscaling/v1.ObjectMetricSource": schema_k8sio_api_autoscaling_v1_ObjectMetricSource(ref), + "k8s.io/api/autoscaling/v1.ObjectMetricStatus": schema_k8sio_api_autoscaling_v1_ObjectMetricStatus(ref), + "k8s.io/api/autoscaling/v1.PodsMetricSource": schema_k8sio_api_autoscaling_v1_PodsMetricSource(ref), + "k8s.io/api/autoscaling/v1.PodsMetricStatus": schema_k8sio_api_autoscaling_v1_PodsMetricStatus(ref), + "k8s.io/api/autoscaling/v1.ResourceMetricSource": schema_k8sio_api_autoscaling_v1_ResourceMetricSource(ref), + "k8s.io/api/autoscaling/v1.ResourceMetricStatus": schema_k8sio_api_autoscaling_v1_ResourceMetricStatus(ref), + "k8s.io/api/autoscaling/v1.Scale": schema_k8sio_api_autoscaling_v1_Scale(ref), + "k8s.io/api/autoscaling/v1.ScaleSpec": schema_k8sio_api_autoscaling_v1_ScaleSpec(ref), + "k8s.io/api/autoscaling/v1.ScaleStatus": schema_k8sio_api_autoscaling_v1_ScaleStatus(ref), + "k8s.io/api/coordination/v1.Lease": schema_k8sio_api_coordination_v1_Lease(ref), + "k8s.io/api/coordination/v1.LeaseList": schema_k8sio_api_coordination_v1_LeaseList(ref), + "k8s.io/api/coordination/v1.LeaseSpec": schema_k8sio_api_coordination_v1_LeaseSpec(ref), + "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.AppArmorProfile": schema_k8sio_api_core_v1_AppArmorProfile(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.ClaimSource": schema_k8sio_api_core_v1_ClaimSource(ref), + "k8s.io/api/core/v1.ClientIPConfig": schema_k8sio_api_core_v1_ClientIPConfig(ref), + "k8s.io/api/core/v1.ClusterTrustBundleProjection": schema_k8sio_api_core_v1_ClusterTrustBundleProjection(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.ContainerResizePolicy": schema_k8sio_api_core_v1_ContainerResizePolicy(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.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.GRPCAction": schema_k8sio_api_core_v1_GRPCAction(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.HostAlias": schema_k8sio_api_core_v1_HostAlias(ref), + "k8s.io/api/core/v1.HostIP": schema_k8sio_api_core_v1_HostIP(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.LifecycleHandler": schema_k8sio_api_core_v1_LifecycleHandler(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.ModifyVolumeStatus": schema_k8sio_api_core_v1_ModifyVolumeStatus(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.NodeRuntimeHandler": schema_k8sio_api_core_v1_NodeRuntimeHandler(ref), + "k8s.io/api/core/v1.NodeRuntimeHandlerFeatures": schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(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.PodOS": schema_k8sio_api_core_v1_PodOS(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.PodResourceClaim": schema_k8sio_api_core_v1_PodResourceClaim(ref), + "k8s.io/api/core/v1.PodResourceClaimStatus": schema_k8sio_api_core_v1_PodResourceClaimStatus(ref), + "k8s.io/api/core/v1.PodSchedulingGate": schema_k8sio_api_core_v1_PodSchedulingGate(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.PortStatus": schema_k8sio_api_core_v1_PortStatus(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.ProbeHandler": schema_k8sio_api_core_v1_ProbeHandler(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.ResourceClaim": schema_k8sio_api_core_v1_ResourceClaim(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.SleepAction": schema_k8sio_api_core_v1_SleepAction(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.TypedObjectReference": schema_k8sio_api_core_v1_TypedObjectReference(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.VolumeMountStatus": schema_k8sio_api_core_v1_VolumeMountStatus(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.VolumeResourceRequirements": schema_k8sio_api_core_v1_VolumeResourceRequirements(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), + "k8s.io/api/flowcontrol/v1.ExemptPriorityLevelConfiguration": schema_k8sio_api_flowcontrol_v1_ExemptPriorityLevelConfiguration(ref), + "k8s.io/api/flowcontrol/v1.FlowDistinguisherMethod": schema_k8sio_api_flowcontrol_v1_FlowDistinguisherMethod(ref), + "k8s.io/api/flowcontrol/v1.FlowSchema": schema_k8sio_api_flowcontrol_v1_FlowSchema(ref), + "k8s.io/api/flowcontrol/v1.FlowSchemaCondition": schema_k8sio_api_flowcontrol_v1_FlowSchemaCondition(ref), + "k8s.io/api/flowcontrol/v1.FlowSchemaList": schema_k8sio_api_flowcontrol_v1_FlowSchemaList(ref), + "k8s.io/api/flowcontrol/v1.FlowSchemaSpec": schema_k8sio_api_flowcontrol_v1_FlowSchemaSpec(ref), + "k8s.io/api/flowcontrol/v1.FlowSchemaStatus": schema_k8sio_api_flowcontrol_v1_FlowSchemaStatus(ref), + "k8s.io/api/flowcontrol/v1.GroupSubject": schema_k8sio_api_flowcontrol_v1_GroupSubject(ref), + "k8s.io/api/flowcontrol/v1.LimitResponse": schema_k8sio_api_flowcontrol_v1_LimitResponse(ref), + "k8s.io/api/flowcontrol/v1.LimitedPriorityLevelConfiguration": schema_k8sio_api_flowcontrol_v1_LimitedPriorityLevelConfiguration(ref), + "k8s.io/api/flowcontrol/v1.NonResourcePolicyRule": schema_k8sio_api_flowcontrol_v1_NonResourcePolicyRule(ref), + "k8s.io/api/flowcontrol/v1.PolicyRulesWithSubjects": schema_k8sio_api_flowcontrol_v1_PolicyRulesWithSubjects(ref), + "k8s.io/api/flowcontrol/v1.PriorityLevelConfiguration": schema_k8sio_api_flowcontrol_v1_PriorityLevelConfiguration(ref), + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationCondition": schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationCondition(ref), + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationList": schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationList(ref), + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationReference": schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationReference(ref), + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationSpec": schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationSpec(ref), + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationStatus": schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationStatus(ref), + "k8s.io/api/flowcontrol/v1.QueuingConfiguration": schema_k8sio_api_flowcontrol_v1_QueuingConfiguration(ref), + "k8s.io/api/flowcontrol/v1.ResourcePolicyRule": schema_k8sio_api_flowcontrol_v1_ResourcePolicyRule(ref), + "k8s.io/api/flowcontrol/v1.ServiceAccountSubject": schema_k8sio_api_flowcontrol_v1_ServiceAccountSubject(ref), + "k8s.io/api/flowcontrol/v1.Subject": schema_k8sio_api_flowcontrol_v1_Subject(ref), + "k8s.io/api/flowcontrol/v1.UserSubject": schema_k8sio_api_flowcontrol_v1_UserSubject(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionRequest": schema_pkg_apis_apiextensions_v1_ConversionRequest(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionResponse": schema_pkg_apis_apiextensions_v1_ConversionResponse(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionReview": schema_pkg_apis_apiextensions_v1_ConversionReview(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceColumnDefinition": schema_pkg_apis_apiextensions_v1_CustomResourceColumnDefinition(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceConversion": schema_pkg_apis_apiextensions_v1_CustomResourceConversion(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinition": schema_pkg_apis_apiextensions_v1_CustomResourceDefinition(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionCondition": schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionCondition(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionList": schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionList(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionNames": schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionNames(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionSpec": schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionSpec(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionStatus": schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionStatus(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionVersion": schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionVersion(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresourceScale": schema_pkg_apis_apiextensions_v1_CustomResourceSubresourceScale(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresourceStatus": schema_pkg_apis_apiextensions_v1_CustomResourceSubresourceStatus(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresources": schema_pkg_apis_apiextensions_v1_CustomResourceSubresources(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceValidation": schema_pkg_apis_apiextensions_v1_CustomResourceValidation(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ExternalDocumentation": schema_pkg_apis_apiextensions_v1_ExternalDocumentation(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON": schema_pkg_apis_apiextensions_v1_JSON(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps": schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrArray": schema_pkg_apis_apiextensions_v1_JSONSchemaPropsOrArray(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrBool": schema_pkg_apis_apiextensions_v1_JSONSchemaPropsOrBool(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrStringArray": schema_pkg_apis_apiextensions_v1_JSONSchemaPropsOrStringArray(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.SelectableField": schema_pkg_apis_apiextensions_v1_SelectableField(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ServiceReference": schema_pkg_apis_apiextensions_v1_ServiceReference(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ValidationRule": schema_pkg_apis_apiextensions_v1_ValidationRule(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.WebhookClientConfig": schema_pkg_apis_apiextensions_v1_WebhookClientConfig(ref), + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.WebhookConversion": schema_pkg_apis_apiextensions_v1_WebhookConversion(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup": schema_pkg_apis_meta_v1_APIGroup(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroupList": schema_pkg_apis_meta_v1_APIGroupList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource": schema_pkg_apis_meta_v1_APIResource(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIResourceList": schema_pkg_apis_meta_v1_APIResourceList(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.APIVersions": schema_pkg_apis_meta_v1_APIVersions(ref), + "k8s.io/apimachinery/pkg/apis/meta/v1.ApplyOptions": schema_pkg_apis_meta_v1_ApplyOptions(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.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/util/intstr.IntOrString": schema_apimachinery_pkg_util_intstr_IntOrString(ref), + "k8s.io/apimachinery/pkg/version.Info": schema_k8sio_apimachinery_pkg_version_Info(ref), + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIService": schema_pkg_apis_apiregistration_v1_APIService(ref), + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceCondition": schema_pkg_apis_apiregistration_v1_APIServiceCondition(ref), + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceList": schema_pkg_apis_apiregistration_v1_APIServiceList(ref), + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceSpec": schema_pkg_apis_apiregistration_v1_APIServiceSpec(ref), + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceStatus": schema_pkg_apis_apiregistration_v1_APIServiceStatus(ref), + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.ServiceReference": schema_pkg_apis_apiregistration_v1_ServiceReference(ref), } } @@ -369,21 +428,21 @@ func schema_pkg_apis_apps_v1beta1_Chain(ref common.ReferenceCallback) common.Ope "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "Specification of the desired behavior of the chain. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "Status is the most recently observed status of the Chain. 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainStatus"), }, }, @@ -391,8 +450,7 @@ func schema_pkg_apis_apps_v1beta1_Chain(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChainStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -420,7 +478,7 @@ func schema_pkg_apis_apps_v1beta1_ChainList(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -431,7 +489,7 @@ func schema_pkg_apis_apps_v1beta1_ChainList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.Chain"), }, }, @@ -443,8 +501,7 @@ func schema_pkg_apis_apps_v1beta1_ChainList(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Chain", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Chain", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -527,7 +584,7 @@ func schema_pkg_apis_apps_v1beta1_ChainStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition"), }, }, @@ -538,8 +595,7 @@ func schema_pkg_apis_apps_v1beta1_ChainStatus(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition", "github.com/superproj/onex/pkg/apis/apps/v1beta1.LocalObjectReference", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition", "github.com/superproj/onex/pkg/apis/apps/v1beta1.LocalObjectReference"}, } } @@ -567,21 +623,21 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequest(ref common.ReferenceCallback) co "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "Specification of the desired behavior of the chargerequest. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "Status is the most recently observed status of the ChargeRequest. 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestStatus"), }, }, @@ -589,8 +645,7 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequest(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequestStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -618,7 +673,7 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequestList(ref common.ReferenceCallback "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -629,7 +684,7 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequestList(ref common.ReferenceCallback Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequest"), }, }, @@ -641,8 +696,7 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequestList(ref common.ReferenceCallback }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequest", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ChargeRequest", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -684,7 +738,7 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequestStatus(ref common.ReferenceCallba Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition"), }, }, @@ -695,8 +749,7 @@ func schema_pkg_apis_apps_v1beta1_ChargeRequestStatus(ref common.ReferenceCallba }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition"}, } } @@ -734,7 +787,6 @@ func schema_pkg_apis_apps_v1beta1_Condition(ref common.ReferenceCallback) common "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -757,8 +809,7 @@ func schema_pkg_apis_apps_v1beta1_Condition(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -806,21 +857,21 @@ func schema_pkg_apis_apps_v1beta1_Miner(ref common.ReferenceCallback) common.Ope "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "Specification of the desired behavior of the miner. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "Most recently observed status of the miner. 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerStatus"), }, }, @@ -828,8 +879,7 @@ func schema_pkg_apis_apps_v1beta1_Miner(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -887,7 +937,7 @@ func schema_pkg_apis_apps_v1beta1_MinerList(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -898,7 +948,7 @@ func schema_pkg_apis_apps_v1beta1_MinerList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.Miner"), }, }, @@ -910,8 +960,7 @@ func schema_pkg_apis_apps_v1beta1_MinerList(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Miner", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Miner", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -939,21 +988,21 @@ func schema_pkg_apis_apps_v1beta1_MinerSet(ref common.ReferenceCallback) common. "metadata": { SchemaProps: spec.SchemaProps{ Description: "If the Labels of a MinerSet are empty, they are defaulted to be the same as the Miner(s) that the MinerSet manages. Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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 MinerSet. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "Status is the most recently observed status of the MinerSet. 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetStatus"), }, }, @@ -961,8 +1010,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSet(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSetStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -990,7 +1038,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSetList(ref common.ReferenceCallback) com "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -1001,7 +1049,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSetList(ref common.ReferenceCallback) com Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSet"), }, }, @@ -1013,8 +1061,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSetList(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSet", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSet", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -1035,14 +1082,14 @@ func schema_pkg_apis_apps_v1beta1_MinerSetSpec(ref common.ReferenceCallback) com "selector": { SchemaProps: spec.SchemaProps{ Description: "Selector is a label query over miners that should match the replica count. Label keys and values that must match in order to be controlled by this MinerSet. It must match the miner template's labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), }, }, "template": { SchemaProps: spec.SchemaProps{ Description: "Template is the object that describes the miner that will be created if insufficient replicas are detected.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerTemplateSpec"), }, }, @@ -1079,8 +1126,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSetSpec(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -1154,7 +1200,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSetStatus(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition"), }, }, @@ -1166,8 +1212,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSetStatus(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition"}, } } @@ -1181,7 +1226,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSpec(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "ObjectMeta will autopopulate the Pod created. Use this to indicate what labels, annotations, name prefix, etc., should be used when creating the Pod.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta"), }, }, @@ -1210,7 +1255,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSpec(ref common.ReferenceCallback) common Description: "Restart policy for the miner. One of Always, OnFailure, Never. Default to Always.\n\nPossible enum values:\n - `\"Always\"`\n - `\"Never\"`\n - `\"OnFailure\"`", Type: []string{"string"}, Format: "", - Enum: []any{"Always", "Never", "OnFailure"}, + Enum: []interface{}{"Always", "Never", "OnFailure"}, }, }, "podDeletionTimeout": { @@ -1223,8 +1268,7 @@ func schema_pkg_apis_apps_v1beta1_MinerSpec(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, } } @@ -1274,7 +1318,7 @@ func schema_pkg_apis_apps_v1beta1_MinerStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerAddress"), }, }, @@ -1302,7 +1346,7 @@ func schema_pkg_apis_apps_v1beta1_MinerStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition"), }, }, @@ -1313,8 +1357,7 @@ func schema_pkg_apis_apps_v1beta1_MinerStatus(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition", "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerAddress", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.Condition", "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerAddress", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -1328,14 +1371,14 @@ func schema_pkg_apis_apps_v1beta1_MinerTemplateSpec(ref common.ReferenceCallback "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "Specification of the desired behavior of the miner. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec"), }, }, @@ -1343,8 +1386,7 @@ func schema_pkg_apis_apps_v1beta1_MinerTemplateSpec(ref common.ReferenceCallback }, }, Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta", - }, + "github.com/superproj/onex/pkg/apis/apps/v1beta1.MinerSpec", "github.com/superproj/onex/pkg/apis/apps/v1beta1.ObjectMeta"}, } } @@ -1423,151 +1465,6 @@ func schema_pkg_apis_apps_v1beta1_PodInfo(ref common.ReferenceCallback) common.O } } -func schema_pkg_apis_coordination_v1_Lease(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "Lease defines a lease concept.", - 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", - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), - }, - }, - "spec": { - SchemaProps: spec.SchemaProps{ - Description: "Specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, - Ref: ref("github.com/superproj/onex/pkg/apis/coordination/v1.LeaseSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/coordination/v1.LeaseSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, - } -} - -func schema_pkg_apis_coordination_v1_LeaseList(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LeaseList is a list of Lease 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#metadata", - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), - }, - }, - "items": { - SchemaProps: spec.SchemaProps{ - Description: "Items is a list of schema objects.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("github.com/superproj/onex/pkg/apis/coordination/v1.Lease"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "github.com/superproj/onex/pkg/apis/coordination/v1.Lease", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, - } -} - -func schema_pkg_apis_coordination_v1_LeaseSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LeaseSpec is a specification of a Lease.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "holderIdentity": { - SchemaProps: spec.SchemaProps{ - Description: "holderIdentity contains the identity of the holder of a current lease.", - Type: []string{"string"}, - Format: "", - }, - }, - "leaseDurationSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measure against time of last observed RenewTime.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "acquireTime": { - SchemaProps: spec.SchemaProps{ - Description: "acquireTime is a time when the current lease was acquired.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), - }, - }, - "renewTime": { - SchemaProps: spec.SchemaProps{ - Description: "renewTime is a time when the current holder of a lease has last updated the lease.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), - }, - }, - "leaseTransitions": { - SchemaProps: spec.SchemaProps{ - Description: "leaseTransitions is the number of transitions of a lease between holders.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime", - }, - } -} - func schema_k8sio_api_autoscaling_v1_ContainerResourceMetricSource(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -1609,8 +1506,7 @@ func schema_k8sio_api_autoscaling_v1_ContainerResourceMetricSource(ref common.Re }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -1639,7 +1535,6 @@ func schema_k8sio_api_autoscaling_v1_ContainerResourceMetricStatus(ref common.Re "currentAverageValue": { SchemaProps: spec.SchemaProps{ Description: "currentAverageValue is the current value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type. It will always be set, regardless of the corresponding metric specification.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -1656,8 +1551,7 @@ func schema_k8sio_api_autoscaling_v1_ContainerResourceMetricStatus(ref common.Re }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -1741,8 +1635,7 @@ func schema_k8sio_api_autoscaling_v1_ExternalMetricSource(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -1770,7 +1663,6 @@ func schema_k8sio_api_autoscaling_v1_ExternalMetricStatus(ref common.ReferenceCa "currentValue": { SchemaProps: spec.SchemaProps{ Description: "currentValue is the current value of the metric (as a quantity)", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -1785,8 +1677,7 @@ func schema_k8sio_api_autoscaling_v1_ExternalMetricStatus(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -1814,21 +1705,21 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscaler(ref common.Referenc "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "spec defines the behaviour of autoscaler. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the current information about the autoscaler.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerStatus"), }, }, @@ -1836,8 +1727,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscaler(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerSpec", "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerSpec", "k8s.io/api/autoscaling/v1.HorizontalPodAutoscalerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -1867,7 +1757,6 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerCondition(ref common "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "lastTransitionTime is the last time the condition transitioned from one status to another", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -1890,8 +1779,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerCondition(ref common }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -1919,7 +1807,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerList(ref common.Refe "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -1930,7 +1818,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerList(ref common.Refe Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.HorizontalPodAutoscaler"), }, }, @@ -1942,8 +1830,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerList(ref common.Refe }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.HorizontalPodAutoscaler", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/autoscaling/v1.HorizontalPodAutoscaler", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -1957,7 +1844,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerSpec(ref common.Refe "scaleTargetRef": { SchemaProps: spec.SchemaProps{ Description: "reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.CrossVersionObjectReference"), }, }, @@ -1988,8 +1875,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerSpec(ref common.Refe }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.CrossVersionObjectReference", - }, + "k8s.io/api/autoscaling/v1.CrossVersionObjectReference"}, } } @@ -2041,8 +1927,7 @@ func schema_k8sio_api_autoscaling_v1_HorizontalPodAutoscalerStatus(ref common.Re }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -2059,7 +1944,7 @@ func schema_k8sio_api_autoscaling_v1_MetricSpec(ref common.ReferenceCallback) co Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"ContainerResource", "External", "Object", "Pods", "Resource"}, + Enum: []interface{}{"ContainerResource", "External", "Object", "Pods", "Resource"}, }, }, "object": { @@ -2097,8 +1982,7 @@ func schema_k8sio_api_autoscaling_v1_MetricSpec(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.ContainerResourceMetricSource", "k8s.io/api/autoscaling/v1.ExternalMetricSource", "k8s.io/api/autoscaling/v1.ObjectMetricSource", "k8s.io/api/autoscaling/v1.PodsMetricSource", "k8s.io/api/autoscaling/v1.ResourceMetricSource", - }, + "k8s.io/api/autoscaling/v1.ContainerResourceMetricSource", "k8s.io/api/autoscaling/v1.ExternalMetricSource", "k8s.io/api/autoscaling/v1.ObjectMetricSource", "k8s.io/api/autoscaling/v1.PodsMetricSource", "k8s.io/api/autoscaling/v1.ResourceMetricSource"}, } } @@ -2115,7 +1999,7 @@ func schema_k8sio_api_autoscaling_v1_MetricStatus(ref common.ReferenceCallback) Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"ContainerResource", "External", "Object", "Pods", "Resource"}, + Enum: []interface{}{"ContainerResource", "External", "Object", "Pods", "Resource"}, }, }, "object": { @@ -2153,8 +2037,7 @@ func schema_k8sio_api_autoscaling_v1_MetricStatus(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.ContainerResourceMetricStatus", "k8s.io/api/autoscaling/v1.ExternalMetricStatus", "k8s.io/api/autoscaling/v1.ObjectMetricStatus", "k8s.io/api/autoscaling/v1.PodsMetricStatus", "k8s.io/api/autoscaling/v1.ResourceMetricStatus", - }, + "k8s.io/api/autoscaling/v1.ContainerResourceMetricStatus", "k8s.io/api/autoscaling/v1.ExternalMetricStatus", "k8s.io/api/autoscaling/v1.ObjectMetricStatus", "k8s.io/api/autoscaling/v1.PodsMetricStatus", "k8s.io/api/autoscaling/v1.ResourceMetricStatus"}, } } @@ -2168,7 +2051,7 @@ func schema_k8sio_api_autoscaling_v1_ObjectMetricSource(ref common.ReferenceCall "target": { SchemaProps: spec.SchemaProps{ Description: "target is the described Kubernetes object.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.CrossVersionObjectReference"), }, }, @@ -2183,7 +2066,6 @@ func schema_k8sio_api_autoscaling_v1_ObjectMetricSource(ref common.ReferenceCall "targetValue": { SchemaProps: spec.SchemaProps{ Description: "targetValue is the target value of the metric (as a quantity).", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -2204,8 +2086,7 @@ func schema_k8sio_api_autoscaling_v1_ObjectMetricSource(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.CrossVersionObjectReference", "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/api/autoscaling/v1.CrossVersionObjectReference", "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -2219,7 +2100,7 @@ func schema_k8sio_api_autoscaling_v1_ObjectMetricStatus(ref common.ReferenceCall "target": { SchemaProps: spec.SchemaProps{ Description: "target is the described Kubernetes object.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.CrossVersionObjectReference"), }, }, @@ -2234,7 +2115,6 @@ func schema_k8sio_api_autoscaling_v1_ObjectMetricStatus(ref common.ReferenceCall "currentValue": { SchemaProps: spec.SchemaProps{ Description: "currentValue is the current value of the metric (as a quantity).", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -2255,8 +2135,7 @@ func schema_k8sio_api_autoscaling_v1_ObjectMetricStatus(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.CrossVersionObjectReference", "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/api/autoscaling/v1.CrossVersionObjectReference", "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -2278,7 +2157,6 @@ func schema_k8sio_api_autoscaling_v1_PodsMetricSource(ref common.ReferenceCallba "targetAverageValue": { SchemaProps: spec.SchemaProps{ Description: "targetAverageValue is the target value of the average of the metric across all relevant pods (as a quantity)", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -2293,8 +2171,7 @@ func schema_k8sio_api_autoscaling_v1_PodsMetricSource(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -2316,7 +2193,6 @@ func schema_k8sio_api_autoscaling_v1_PodsMetricStatus(ref common.ReferenceCallba "currentAverageValue": { SchemaProps: spec.SchemaProps{ Description: "currentAverageValue is the current value of the average of the metric across all relevant pods (as a quantity)", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -2331,8 +2207,7 @@ func schema_k8sio_api_autoscaling_v1_PodsMetricStatus(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -2369,8 +2244,7 @@ func schema_k8sio_api_autoscaling_v1_ResourceMetricSource(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -2399,7 +2273,6 @@ func schema_k8sio_api_autoscaling_v1_ResourceMetricStatus(ref common.ReferenceCa "currentAverageValue": { SchemaProps: spec.SchemaProps{ Description: "currentAverageValue is the current value of the average of the resource metric across all relevant pods, as a raw value (instead of as a percentage of the request), similar to the \"pods\" metric source type. It will always be set, regardless of the corresponding metric specification.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -2408,8 +2281,7 @@ func schema_k8sio_api_autoscaling_v1_ResourceMetricStatus(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -2437,21 +2309,21 @@ func schema_k8sio_api_autoscaling_v1_Scale(ref common.ReferenceCallback) common. "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object metadata; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "spec defines the behavior of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.ScaleSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the current status of the scale. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. Read-only.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/autoscaling/v1.ScaleStatus"), }, }, @@ -2459,8 +2331,7 @@ func schema_k8sio_api_autoscaling_v1_Scale(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/api/autoscaling/v1.ScaleSpec", "k8s.io/api/autoscaling/v1.ScaleStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/autoscaling/v1.ScaleSpec", "k8s.io/api/autoscaling/v1.ScaleStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -2537,14 +2408,14 @@ func schema_k8sio_api_coordination_v1_Lease(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "spec contains the specification of the Lease. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/coordination/v1.LeaseSpec"), }, }, @@ -2552,8 +2423,7 @@ func schema_k8sio_api_coordination_v1_Lease(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/coordination/v1.LeaseSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/coordination/v1.LeaseSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -2581,7 +2451,7 @@ func schema_k8sio_api_coordination_v1_LeaseList(ref common.ReferenceCallback) co "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -2592,7 +2462,7 @@ func schema_k8sio_api_coordination_v1_LeaseList(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/coordination/v1.Lease"), }, }, @@ -2604,8 +2474,7 @@ func schema_k8sio_api_coordination_v1_LeaseList(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/api/coordination/v1.Lease", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/coordination/v1.Lease", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -2653,8 +2522,7 @@ func schema_k8sio_api_coordination_v1_LeaseSpec(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"}, } } @@ -2730,7 +2598,48 @@ func schema_k8sio_api_core_v1_Affinity(ref common.ReferenceCallback) common.Open }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeAffinity", "k8s.io/api/core/v1.PodAffinity", "k8s.io/api/core/v1.PodAntiAffinity", + "k8s.io/api/core/v1.NodeAffinity", "k8s.io/api/core/v1.PodAffinity", "k8s.io/api/core/v1.PodAntiAffinity"}, + } +} + +func schema_k8sio_api_core_v1_AppArmorProfile(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "AppArmorProfile defines a pod or container's AppArmor settings.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type indicates which kind of AppArmor profile will be applied. Valid options are:\n Localhost - a profile pre-loaded on the node.\n RuntimeDefault - the container runtime's default profile.\n Unconfined - no AppArmor enforcement.\n\nPossible enum values:\n - `\"Localhost\"` indicates that a profile pre-loaded on the node should be used.\n - `\"RuntimeDefault\"` indicates that the container runtime's default AppArmor profile should be used.\n - `\"Unconfined\"` indicates that no AppArmor profile should be enforced.", + Default: "", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"Localhost", "RuntimeDefault", "Unconfined"}, + }, + }, + "localhostProfile": { + SchemaProps: spec.SchemaProps{ + Description: "localhostProfile indicates a profile loaded on the node that should be used. The profile must be preconfigured on the node to work. Must match the loaded name of the profile. Must be set if and only if type is \"Localhost\".", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "localhostProfile": "LocalhostProfile", + }, + }, + }, + }, + }, }, } } @@ -2773,13 +2682,18 @@ func schema_k8sio_api_core_v1_AvoidPods(ref common.ReferenceCallback) common.Ope Type: []string{"object"}, Properties: map[string]spec.Schema{ "preferAvoidPods": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PreferAvoidPodsEntry"), }, }, @@ -2790,8 +2704,7 @@ func schema_k8sio_api_core_v1_AvoidPods(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PreferAvoidPodsEntry", - }, + "k8s.io/api/core/v1.PreferAvoidPodsEntry"}, } } @@ -2823,7 +2736,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback Description: "cachingMode is the Host Caching mode: None, Read Only, Read Write.\n\nPossible enum values:\n - `\"None\"`\n - `\"ReadOnly\"`\n - `\"ReadWrite\"`", Type: []string{"string"}, Format: "", - Enum: []any{"None", "ReadOnly", "ReadWrite"}, + Enum: []interface{}{"None", "ReadOnly", "ReadWrite"}, }, }, "fsType": { @@ -2845,7 +2758,7 @@ func schema_k8sio_api_core_v1_AzureDiskVolumeSource(ref common.ReferenceCallback Description: "kind expected values are 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\n\nPossible enum values:\n - `\"Dedicated\"`\n - `\"Managed\"`\n - `\"Shared\"`", Type: []string{"string"}, Format: "", - Enum: []any{"Dedicated", "Managed", "Shared"}, + Enum: []interface{}{"Dedicated", "Managed", "Shared"}, }, }, }, @@ -2960,14 +2873,14 @@ func schema_k8sio_api_core_v1_Binding(ref common.ReferenceCallback) common.OpenA "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ObjectReference"), }, }, @@ -2976,8 +2889,7 @@ func schema_k8sio_api_core_v1_Binding(ref common.ReferenceCallback) common.OpenA }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -3069,8 +2981,7 @@ func schema_k8sio_api_core_v1_CSIPersistentVolumeSource(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -3130,8 +3041,7 @@ func schema_k8sio_api_core_v1_CSIVolumeSource(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -3143,6 +3053,11 @@ func schema_k8sio_api_core_v1_Capabilities(ref common.ReferenceCallback) common. Type: []string{"object"}, Properties: map[string]spec.Schema{ "add": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Added capabilities", Type: []string{"array"}, @@ -3158,6 +3073,11 @@ func schema_k8sio_api_core_v1_Capabilities(ref common.ReferenceCallback) common. }, }, "drop": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Removed capabilities", Type: []string{"array"}, @@ -3186,6 +3106,11 @@ func schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref common.ReferenceC Type: []string{"object"}, Properties: map[string]spec.Schema{ "monitors": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "monitors is 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"}, @@ -3239,8 +3164,7 @@ func schema_k8sio_api_core_v1_CephFSPersistentVolumeSource(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -3252,6 +3176,11 @@ func schema_k8sio_api_core_v1_CephFSVolumeSource(ref common.ReferenceCallback) c Type: []string{"object"}, Properties: map[string]spec.Schema{ "monitors": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "monitors is 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"}, @@ -3305,8 +3234,7 @@ func schema_k8sio_api_core_v1_CephFSVolumeSource(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -3350,8 +3278,7 @@ func schema_k8sio_api_core_v1_CinderPersistentVolumeSource(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -3395,8 +3322,7 @@ func schema_k8sio_api_core_v1_CinderVolumeSource(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -3494,8 +3420,7 @@ func schema_k8sio_api_core_v1_ClusterTrustBundleProjection(ref common.ReferenceC }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -3567,13 +3492,17 @@ func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) comm "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, @@ -3584,7 +3513,7 @@ func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ComponentCondition"), }, }, @@ -3595,8 +3524,7 @@ func schema_k8sio_api_core_v1_ComponentStatus(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ComponentCondition", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.ComponentCondition", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -3624,7 +3552,7 @@ func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -3635,7 +3563,7 @@ func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ComponentStatus"), }, }, @@ -3647,8 +3575,7 @@ func schema_k8sio_api_core_v1_ComponentStatusList(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ComponentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.ComponentStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -3676,7 +3603,7 @@ func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.Ope "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, @@ -3722,8 +3649,7 @@ func schema_k8sio_api_core_v1_ConfigMap(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -3736,7 +3662,8 @@ func schema_k8sio_api_core_v1_ConfigMapEnvSource(ref common.ReferenceCallback) c 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, @@ -3763,7 +3690,8 @@ func schema_k8sio_api_core_v1_ConfigMapKeySelector(ref common.ReferenceCallback) 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, @@ -3819,7 +3747,7 @@ func schema_k8sio_api_core_v1_ConfigMapList(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -3830,7 +3758,7 @@ func schema_k8sio_api_core_v1_ConfigMapList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ConfigMap"), }, }, @@ -3842,8 +3770,7 @@ func schema_k8sio_api_core_v1_ConfigMapList(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMap", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.ConfigMap", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -3908,19 +3835,25 @@ func schema_k8sio_api_core_v1_ConfigMapProjection(ref common.ReferenceCallback) 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, }, "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "items 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.KeyToPath"), }, }, @@ -3938,8 +3871,7 @@ func schema_k8sio_api_core_v1_ConfigMapProjection(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath", - }, + "k8s.io/api/core/v1.KeyToPath"}, } } @@ -3952,19 +3884,25 @@ func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, }, "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "items 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.KeyToPath"), }, }, @@ -3989,8 +3927,7 @@ func schema_k8sio_api_core_v1_ConfigMapVolumeSource(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath", - }, + "k8s.io/api/core/v1.KeyToPath"}, } } @@ -4017,6 +3954,11 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Entrypoint array. Not executed within a shell. The container 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(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"}, @@ -4032,6 +3974,11 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, "args": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Arguments to the entrypoint. The container 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(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"}, @@ -4056,7 +4003,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope "ports": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "containerPort", "protocol", }, @@ -4071,7 +4018,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerPort"), }, }, @@ -4079,13 +4026,18 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, "envFrom": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EnvFromSource"), }, }, @@ -4095,6 +4047,10 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope "env": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -4105,7 +4061,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EnvVar"), }, }, @@ -4115,7 +4071,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope "resources": { SchemaProps: spec.SchemaProps{ Description: "Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, @@ -4131,7 +4087,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerResizePolicy"), }, }, @@ -4148,6 +4104,10 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "mountPath", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge", }, @@ -4158,7 +4118,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeMount"), }, }, @@ -4168,6 +4128,10 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope "volumeDevices": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "devicePath", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge", }, @@ -4178,7 +4142,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeDevice"), }, }, @@ -4221,7 +4185,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope 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.\n\nPossible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", Type: []string{"string"}, Format: "", - Enum: []any{"FallbackToLogsOnError", "File"}, + Enum: []interface{}{"FallbackToLogsOnError", "File"}, }, }, "imagePullPolicy": { @@ -4229,7 +4193,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope 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\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", Type: []string{"string"}, Format: "", - Enum: []any{"Always", "IfNotPresent", "Never"}, + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, }, }, "securityContext": { @@ -4264,8 +4228,7 @@ func schema_k8sio_api_core_v1_Container(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "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", - }, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "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"}, } } @@ -4277,6 +4240,11 @@ func schema_k8sio_api_core_v1_ContainerImage(ref common.ReferenceCallback) commo Type: []string{"object"}, Properties: map[string]spec.Schema{ "names": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Names by which this image is known. e.g. [\"kubernetes.example/hyperkube:v1.0.7\", \"cloud-vendor.registry.example/cloud-vendor/hyperkube:v1.0.7\"]", Type: []string{"array"}, @@ -4339,7 +4307,7 @@ func schema_k8sio_api_core_v1_ContainerPort(ref common.ReferenceCallback) common Default: "TCP", Type: []string{"string"}, Format: "", - Enum: []any{"SCTP", "TCP", "UDP"}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, }, }, "hostIP": { @@ -4415,8 +4383,7 @@ func schema_k8sio_api_core_v1_ContainerState(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting", - }, + "k8s.io/api/core/v1.ContainerStateRunning", "k8s.io/api/core/v1.ContainerStateTerminated", "k8s.io/api/core/v1.ContainerStateWaiting"}, } } @@ -4430,7 +4397,6 @@ func schema_k8sio_api_core_v1_ContainerStateRunning(ref common.ReferenceCallback "startedAt": { SchemaProps: spec.SchemaProps{ Description: "Time at which the container was last (re-)started", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -4438,8 +4404,7 @@ func schema_k8sio_api_core_v1_ContainerStateRunning(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -4482,14 +4447,12 @@ func schema_k8sio_api_core_v1_ContainerStateTerminated(ref common.ReferenceCallb "startedAt": { SchemaProps: spec.SchemaProps{ Description: "Time at which previous execution of the container started", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "finishedAt": { SchemaProps: spec.SchemaProps{ Description: "Time at which the container last terminated", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -4505,8 +4468,7 @@ func schema_k8sio_api_core_v1_ContainerStateTerminated(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -4555,14 +4517,14 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm "state": { SchemaProps: spec.SchemaProps{ Description: "State holds details about the container's current condition.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerState"), }, }, "lastState": { SchemaProps: spec.SchemaProps{ Description: "LastTerminationState holds the last termination state of the container to help debug container crashes and restarts. This field is not populated if the container is still running and RestartCount is 0.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerState"), }, }, @@ -4620,8 +4582,7 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -4633,13 +4594,36 @@ func schema_k8sio_api_core_v1_ContainerStatus(ref common.ReferenceCallback) comm Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, + "volumeMounts": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "mountPath", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "mountPath", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Status of volume mounts.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.VolumeMountStatus"), + }, + }, + }, + }, + }, }, Required: []string{"name", "ready", "restartCount", "image", "imageID"}, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/api/core/v1.ContainerState", "k8s.io/api/core/v1.ResourceRequirements", "k8s.io/api/core/v1.VolumeMountStatus", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -4673,13 +4657,18 @@ func schema_k8sio_api_core_v1_DownwardAPIProjection(ref common.ReferenceCallback Type: []string{"object"}, Properties: map[string]spec.Schema{ "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Items is a list of DownwardAPIVolume file", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeFile"), }, }, @@ -4690,8 +4679,7 @@ func schema_k8sio_api_core_v1_DownwardAPIProjection(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.DownwardAPIVolumeFile", - }, + "k8s.io/api/core/v1.DownwardAPIVolumeFile"}, } } @@ -4712,7 +4700,7 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref common.ReferenceCallback }, "fieldRef": { SchemaProps: spec.SchemaProps{ - Description: "Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.", + Description: "Required: Selects a field of the pod: only annotations, labels, name, namespace and uid are supported.", Ref: ref("k8s.io/api/core/v1.ObjectFieldSelector"), }, }, @@ -4734,8 +4722,7 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeFile(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector", - }, + "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector"}, } } @@ -4747,13 +4734,18 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallba Type: []string{"object"}, Properties: map[string]spec.Schema{ "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.DownwardAPIVolumeFile"), }, }, @@ -4771,8 +4763,7 @@ func schema_k8sio_api_core_v1_DownwardAPIVolumeSource(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/api/core/v1.DownwardAPIVolumeFile", - }, + "k8s.io/api/core/v1.DownwardAPIVolumeFile"}, } } @@ -4800,8 +4791,7 @@ func schema_k8sio_api_core_v1_EmptyDirVolumeSource(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -4850,8 +4840,7 @@ func schema_k8sio_api_core_v1_EndpointAddress(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", - }, + "k8s.io/api/core/v1.ObjectReference"}, } } @@ -4882,7 +4871,7 @@ func schema_k8sio_api_core_v1_EndpointPort(ref common.ReferenceCallback) common. Description: "The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.\n\nPossible enum values:\n - `\"SCTP\"` is the SCTP protocol.\n - `\"TCP\"` is the TCP protocol.\n - `\"UDP\"` is the UDP protocol.", Type: []string{"string"}, Format: "", - Enum: []any{"SCTP", "TCP", "UDP"}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, }, }, "appProtocol": { @@ -4912,13 +4901,18 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo Type: []string{"object"}, Properties: map[string]spec.Schema{ "addresses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EndpointAddress"), }, }, @@ -4926,13 +4920,18 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo }, }, "notReadyAddresses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EndpointAddress"), }, }, @@ -4940,13 +4939,18 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo }, }, "ports": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Port numbers available on the related IP addresses.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EndpointPort"), }, }, @@ -4957,8 +4961,7 @@ func schema_k8sio_api_core_v1_EndpointSubset(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EndpointAddress", "k8s.io/api/core/v1.EndpointPort", - }, + "k8s.io/api/core/v1.EndpointAddress", "k8s.io/api/core/v1.EndpointPort"}, } } @@ -4986,18 +4989,23 @@ func schema_k8sio_api_core_v1_Endpoints(ref common.ReferenceCallback) common.Ope "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "subsets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EndpointSubset"), }, }, @@ -5008,8 +5016,7 @@ func schema_k8sio_api_core_v1_Endpoints(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EndpointSubset", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.EndpointSubset", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -5037,7 +5044,7 @@ func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -5048,7 +5055,7 @@ func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Endpoints"), }, }, @@ -5060,8 +5067,7 @@ func schema_k8sio_api_core_v1_EndpointsList(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Endpoints", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Endpoints", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -5095,8 +5101,7 @@ func schema_k8sio_api_core_v1_EnvFromSource(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapEnvSource", "k8s.io/api/core/v1.SecretEnvSource", - }, + "k8s.io/api/core/v1.ConfigMapEnvSource", "k8s.io/api/core/v1.SecretEnvSource"}, } } @@ -5133,8 +5138,7 @@ func schema_k8sio_api_core_v1_EnvVar(ref common.ReferenceCallback) common.OpenAP }, }, Dependencies: []string{ - "k8s.io/api/core/v1.EnvVarSource", - }, + "k8s.io/api/core/v1.EnvVarSource"}, } } @@ -5173,8 +5177,7 @@ func schema_k8sio_api_core_v1_EnvVarSource(ref common.ReferenceCallback) common. }, }, 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", - }, + "k8s.io/api/core/v1.ConfigMapKeySelector", "k8s.io/api/core/v1.ObjectFieldSelector", "k8s.io/api/core/v1.ResourceFieldSelector", "k8s.io/api/core/v1.SecretKeySelector"}, } } @@ -5201,6 +5204,11 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Entrypoint array. Not executed within a shell. The 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(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"}, @@ -5216,6 +5224,11 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, "args": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Arguments to the entrypoint. The 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(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"}, @@ -5240,7 +5253,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c "ports": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "containerPort", "protocol", }, @@ -5255,7 +5268,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerPort"), }, }, @@ -5263,13 +5276,18 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, "envFrom": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EnvFromSource"), }, }, @@ -5279,6 +5297,10 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c "env": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -5289,7 +5311,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EnvVar"), }, }, @@ -5299,7 +5321,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c "resources": { SchemaProps: spec.SchemaProps{ Description: "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, @@ -5315,7 +5337,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerResizePolicy"), }, }, @@ -5332,6 +5354,10 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "mountPath", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge", }, @@ -5342,7 +5368,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeMount"), }, }, @@ -5352,6 +5378,10 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c "volumeDevices": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "devicePath", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge", }, @@ -5362,7 +5392,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeDevice"), }, }, @@ -5405,7 +5435,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c 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.\n\nPossible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", Type: []string{"string"}, Format: "", - Enum: []any{"FallbackToLogsOnError", "File"}, + Enum: []interface{}{"FallbackToLogsOnError", "File"}, }, }, "imagePullPolicy": { @@ -5413,7 +5443,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c 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\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", Type: []string{"string"}, Format: "", - Enum: []any{"Always", "IfNotPresent", "Never"}, + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, }, }, "securityContext": { @@ -5455,8 +5485,7 @@ func schema_k8sio_api_core_v1_EphemeralContainer(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "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", - }, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "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"}, } } @@ -5483,6 +5512,11 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Entrypoint array. Not executed within a shell. The 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(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"}, @@ -5498,6 +5532,11 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, "args": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Arguments to the entrypoint. The 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. Double $$ are reduced to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. \"$$(VAR_NAME)\" will produce the string literal \"$(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"}, @@ -5522,7 +5561,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb "ports": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "containerPort", "protocol", }, @@ -5537,7 +5576,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerPort"), }, }, @@ -5545,13 +5584,18 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, "envFrom": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EnvFromSource"), }, }, @@ -5561,6 +5605,10 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb "env": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -5571,7 +5619,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EnvVar"), }, }, @@ -5581,7 +5629,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb "resources": { SchemaProps: spec.SchemaProps{ Description: "Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ResourceRequirements"), }, }, @@ -5597,7 +5645,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerResizePolicy"), }, }, @@ -5614,6 +5662,10 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb "volumeMounts": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "mountPath", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "mountPath", "x-kubernetes-patch-strategy": "merge", }, @@ -5624,7 +5676,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeMount"), }, }, @@ -5634,6 +5686,10 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb "volumeDevices": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "devicePath", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "devicePath", "x-kubernetes-patch-strategy": "merge", }, @@ -5644,7 +5700,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeDevice"), }, }, @@ -5687,7 +5743,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb 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.\n\nPossible enum values:\n - `\"FallbackToLogsOnError\"` will read the most recent contents of the container logs for the container status message when the container exits with an error and the terminationMessagePath has no contents.\n - `\"File\"` is the default behavior and will set the container status message to the contents of the container's terminationMessagePath when the container exits.", Type: []string{"string"}, Format: "", - Enum: []any{"FallbackToLogsOnError", "File"}, + Enum: []interface{}{"FallbackToLogsOnError", "File"}, }, }, "imagePullPolicy": { @@ -5695,7 +5751,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb 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\n\nPossible enum values:\n - `\"Always\"` means that kubelet always attempts to pull the latest image. Container will fail If the pull fails.\n - `\"IfNotPresent\"` means that kubelet pulls if the image isn't present on disk. Container will fail if the image isn't present and the pull fails.\n - `\"Never\"` means that kubelet never pulls an image, but only uses a local image. Container will fail if the image isn't present", Type: []string{"string"}, Format: "", - Enum: []any{"Always", "IfNotPresent", "Never"}, + Enum: []interface{}{"Always", "IfNotPresent", "Never"}, }, }, "securityContext": { @@ -5730,8 +5786,7 @@ func schema_k8sio_api_core_v1_EphemeralContainerCommon(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "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", - }, + "k8s.io/api/core/v1.ContainerPort", "k8s.io/api/core/v1.ContainerResizePolicy", "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"}, } } @@ -5752,8 +5807,7 @@ func schema_k8sio_api_core_v1_EphemeralVolumeSource(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimTemplate", - }, + "k8s.io/api/core/v1.PersistentVolumeClaimTemplate"}, } } @@ -5781,14 +5835,14 @@ func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPI "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "involvedObject": { SchemaProps: spec.SchemaProps{ Description: "The object that this event is about.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ObjectReference"), }, }, @@ -5809,21 +5863,19 @@ func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPI "source": { SchemaProps: spec.SchemaProps{ Description: "The component reporting this event. Should be a short machine understandable string.", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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.)", - Default: map[string]any{}, 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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -5844,7 +5896,6 @@ func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPI "eventTime": { SchemaProps: spec.SchemaProps{ Description: "Time when this Event was first observed.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), }, }, @@ -5888,8 +5939,7 @@ func schema_k8sio_api_core_v1_Event(ref common.ReferenceCallback) common.OpenAPI }, }, 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", - }, + "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"}, } } @@ -5917,7 +5967,7 @@ func schema_k8sio_api_core_v1_EventList(ref common.ReferenceCallback) common.Ope "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -5928,7 +5978,7 @@ func schema_k8sio_api_core_v1_EventList(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Event"), }, }, @@ -5940,8 +5990,7 @@ func schema_k8sio_api_core_v1_EventList(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Event", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Event", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -5962,7 +6011,6 @@ func schema_k8sio_api_core_v1_EventSeries(ref common.ReferenceCallback) common.O "lastObservedTime": { SchemaProps: spec.SchemaProps{ Description: "Time of the last occurrence observed", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"), }, }, @@ -5970,8 +6018,7 @@ func schema_k8sio_api_core_v1_EventSeries(ref common.ReferenceCallback) common.O }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.MicroTime"}, } } @@ -6010,6 +6057,11 @@ func schema_k8sio_api_core_v1_ExecAction(ref common.ReferenceCallback) common.Op Type: []string{"object"}, Properties: map[string]spec.Schema{ "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -6038,6 +6090,11 @@ func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) commo Type: []string{"object"}, Properties: map[string]spec.Schema{ "targetWWNs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "targetWWNs is Optional: FC target worldwide names (WWNs)", Type: []string{"array"}, @@ -6074,6 +6131,11 @@ func schema_k8sio_api_core_v1_FCVolumeSource(ref common.ReferenceCallback) commo }, }, "wwids": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "wwids 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"}, @@ -6150,8 +6212,7 @@ func schema_k8sio_api_core_v1_FlexPersistentVolumeSource(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -6211,8 +6272,7 @@ func schema_k8sio_api_core_v1_FlexVolumeSource(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -6449,7 +6509,6 @@ func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common "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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -6465,17 +6524,22 @@ func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common Description: "Scheme to use for connecting to the host. Defaults to HTTP.\n\nPossible enum values:\n - `\"HTTP\"` means that the scheme used will be http://\n - `\"HTTPS\"` means that the scheme used will be https://", Type: []string{"string"}, Format: "", - Enum: []any{"HTTP", "HTTPS"}, + Enum: []interface{}{"HTTP", "HTTPS"}, }, }, "httpHeaders": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.HTTPHeader"), }, }, @@ -6487,8 +6551,7 @@ func schema_k8sio_api_core_v1_HTTPGetAction(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.HTTPHeader", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", - }, + "k8s.io/api/core/v1.HTTPHeader", "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, } } @@ -6532,11 +6595,17 @@ func schema_k8sio_api_core_v1_HostAlias(ref common.ReferenceCallback) common.Ope "ip": { SchemaProps: spec.SchemaProps{ Description: "IP address of the host file entry.", + Default: "", Type: []string{"string"}, Format: "", }, }, "hostnames": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Hostnames for the above IP address.", Type: []string{"array"}, @@ -6552,6 +6621,7 @@ func schema_k8sio_api_core_v1_HostAlias(ref common.ReferenceCallback) common.Ope }, }, }, + Required: []string{"ip"}, }, }, } @@ -6597,7 +6667,7 @@ func schema_k8sio_api_core_v1_HostPathVolumeSource(ref common.ReferenceCallback) Description: "type for HostPath Volume Defaults to \"\" More info: https://kubernetes.io/docs/concepts/storage/volumes#hostpath\n\nPossible enum values:\n - `\"\"` For backwards compatible, leave it empty if unset\n - `\"BlockDevice\"` A block device must exist at the given path\n - `\"CharDevice\"` A character device must exist at the given path\n - `\"Directory\"` A directory must exist at the given path\n - `\"DirectoryOrCreate\"` If nothing exists at the given path, an empty directory will be created there as needed with file mode 0755, having the same group and ownership with Kubelet.\n - `\"File\"` A file must exist at the given path\n - `\"FileOrCreate\"` If nothing exists at the given path, an empty file will be created there as needed with file mode 0644, having the same group and ownership with Kubelet.\n - `\"Socket\"` A UNIX socket must exist at the given path", Type: []string{"string"}, Format: "", - Enum: []any{"", "BlockDevice", "CharDevice", "Directory", "DirectoryOrCreate", "File", "FileOrCreate", "Socket"}, + Enum: []interface{}{"", "BlockDevice", "CharDevice", "Directory", "DirectoryOrCreate", "File", "FileOrCreate", "Socket"}, }, }, }, @@ -6660,6 +6730,11 @@ func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCa }, }, "portals": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "portals is the 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"}, @@ -6706,8 +6781,7 @@ func schema_k8sio_api_core_v1_ISCSIPersistentVolumeSource(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -6764,6 +6838,11 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co }, }, "portals": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "portals is the 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"}, @@ -6810,8 +6889,7 @@ func schema_k8sio_api_core_v1_ISCSIVolumeSource(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -6875,8 +6953,7 @@ func schema_k8sio_api_core_v1_Lifecycle(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LifecycleHandler", - }, + "k8s.io/api/core/v1.LifecycleHandler"}, } } @@ -6915,8 +6992,7 @@ func schema_k8sio_api_core_v1_LifecycleHandler(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.SleepAction", "k8s.io/api/core/v1.TCPSocketAction", - }, + "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.SleepAction", "k8s.io/api/core/v1.TCPSocketAction"}, } } @@ -6944,14 +7020,14 @@ func schema_k8sio_api_core_v1_LimitRange(ref common.ReferenceCallback) common.Op "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LimitRangeSpec"), }, }, @@ -6959,8 +7035,7 @@ func schema_k8sio_api_core_v1_LimitRange(ref common.ReferenceCallback) common.Op }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LimitRangeSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.LimitRangeSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -6987,8 +7062,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -7002,8 +7076,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -7017,8 +7090,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -7032,8 +7104,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -7047,8 +7118,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -7059,8 +7129,7 @@ func schema_k8sio_api_core_v1_LimitRangeItem(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -7088,7 +7157,7 @@ func schema_k8sio_api_core_v1_LimitRangeList(ref common.ReferenceCallback) commo "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -7099,7 +7168,7 @@ func schema_k8sio_api_core_v1_LimitRangeList(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LimitRange"), }, }, @@ -7111,8 +7180,7 @@ func schema_k8sio_api_core_v1_LimitRangeList(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LimitRange", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.LimitRange", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -7124,13 +7192,18 @@ func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) commo Type: []string{"object"}, Properties: map[string]spec.Schema{ "limits": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LimitRangeItem"), }, }, @@ -7142,8 +7215,7 @@ func schema_k8sio_api_core_v1_LimitRangeSpec(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LimitRangeItem", - }, + "k8s.io/api/core/v1.LimitRangeItem"}, } } @@ -7171,7 +7243,7 @@ func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPID "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -7182,8 +7254,7 @@ func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPID Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, }, @@ -7194,8 +7265,7 @@ func schema_k8sio_api_core_v1_List(ref common.ReferenceCallback) common.OpenAPID }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -7239,7 +7309,7 @@ func schema_k8sio_api_core_v1_LoadBalancerIngress(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PortStatus"), }, }, @@ -7250,8 +7320,7 @@ func schema_k8sio_api_core_v1_LoadBalancerIngress(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PortStatus", - }, + "k8s.io/api/core/v1.PortStatus"}, } } @@ -7263,13 +7332,18 @@ func schema_k8sio_api_core_v1_LoadBalancerStatus(ref common.ReferenceCallback) c Type: []string{"object"}, Properties: map[string]spec.Schema{ "ingress": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LoadBalancerIngress"), }, }, @@ -7280,8 +7354,7 @@ func schema_k8sio_api_core_v1_LoadBalancerStatus(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LoadBalancerIngress", - }, + "k8s.io/api/core/v1.LoadBalancerIngress"}, } } @@ -7294,7 +7367,8 @@ func schema_k8sio_api_core_v1_LocalObjectReference(ref common.ReferenceCallback) 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, @@ -7359,7 +7433,7 @@ func schema_k8sio_api_core_v1_ModifyVolumeStatus(ref common.ReferenceCallback) c Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"InProgress", "Infeasible", "Pending"}, + Enum: []interface{}{"InProgress", "Infeasible", "Pending"}, }, }, }, @@ -7430,21 +7504,21 @@ func schema_k8sio_api_core_v1_Namespace(ref common.ReferenceCallback) common.Ope "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NamespaceStatus"), }, }, @@ -7452,8 +7526,7 @@ func schema_k8sio_api_core_v1_Namespace(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NamespaceSpec", "k8s.io/api/core/v1.NamespaceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.NamespaceSpec", "k8s.io/api/core/v1.NamespaceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -7482,8 +7555,7 @@ func schema_k8sio_api_core_v1_NamespaceCondition(ref common.ReferenceCallback) c }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "reason": { @@ -7503,8 +7575,7 @@ func schema_k8sio_api_core_v1_NamespaceCondition(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -7532,7 +7603,7 @@ func schema_k8sio_api_core_v1_NamespaceList(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -7543,7 +7614,7 @@ func schema_k8sio_api_core_v1_NamespaceList(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Namespace"), }, }, @@ -7555,8 +7626,7 @@ func schema_k8sio_api_core_v1_NamespaceList(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Namespace", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Namespace", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -7568,6 +7638,11 @@ func schema_k8sio_api_core_v1_NamespaceSpec(ref common.ReferenceCallback) common Type: []string{"object"}, Properties: map[string]spec.Schema{ "finalizers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -7600,12 +7675,16 @@ func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) comm Description: "Phase is the current lifecycle phase of the namespace. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/\n\nPossible enum values:\n - `\"Active\"` means the namespace is available for use in the system\n - `\"Terminating\"` means the namespace is undergoing graceful termination", Type: []string{"string"}, Format: "", - Enum: []any{"Active", "Terminating"}, + Enum: []interface{}{"Active", "Terminating"}, }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, @@ -7616,7 +7695,7 @@ func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NamespaceCondition"), }, }, @@ -7627,8 +7706,7 @@ func schema_k8sio_api_core_v1_NamespaceStatus(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NamespaceCondition", - }, + "k8s.io/api/core/v1.NamespaceCondition"}, } } @@ -7656,21 +7734,21 @@ func schema_k8sio_api_core_v1_Node(ref common.ReferenceCallback) common.OpenAPID "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeStatus"), }, }, @@ -7678,8 +7756,7 @@ func schema_k8sio_api_core_v1_Node(ref common.ReferenceCallback) common.OpenAPID }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSpec", "k8s.io/api/core/v1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.NodeSpec", "k8s.io/api/core/v1.NodeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -7727,13 +7804,18 @@ func schema_k8sio_api_core_v1_NodeAffinity(ref common.ReferenceCallback) common. }, }, "preferredDuringSchedulingIgnoredDuringExecution": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PreferredSchedulingTerm"), }, }, @@ -7744,8 +7826,7 @@ func schema_k8sio_api_core_v1_NodeAffinity(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/core/v1.PreferredSchedulingTerm", - }, + "k8s.io/api/core/v1.NodeSelector", "k8s.io/api/core/v1.PreferredSchedulingTerm"}, } } @@ -7775,14 +7856,12 @@ func schema_k8sio_api_core_v1_NodeCondition(ref common.ReferenceCallback) common "lastHeartbeatTime": { SchemaProps: spec.SchemaProps{ Description: "Last time we got an update on a given condition.", - Default: map[string]any{}, 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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -7805,8 +7884,7 @@ func schema_k8sio_api_core_v1_NodeCondition(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -7827,8 +7905,7 @@ func schema_k8sio_api_core_v1_NodeConfigSource(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ConfigMapNodeConfigSource", - }, + "k8s.io/api/core/v1.ConfigMapNodeConfigSource"}, } } @@ -7868,8 +7945,7 @@ func schema_k8sio_api_core_v1_NodeConfigStatus(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeConfigSource", - }, + "k8s.io/api/core/v1.NodeConfigSource"}, } } @@ -7883,7 +7959,7 @@ func schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref common.ReferenceCallback) "kubeletEndpoint": { SchemaProps: spec.SchemaProps{ Description: "Endpoint on which Kubelet is listening.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.DaemonEndpoint"), }, }, @@ -7891,8 +7967,7 @@ func schema_k8sio_api_core_v1_NodeDaemonEndpoints(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.DaemonEndpoint", - }, + "k8s.io/api/core/v1.DaemonEndpoint"}, } } @@ -7920,7 +7995,7 @@ func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.Open "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -7931,7 +8006,7 @@ func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.Open Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Node"), }, }, @@ -7943,8 +8018,7 @@ func schema_k8sio_api_core_v1_NodeList(ref common.ReferenceCallback) common.Open }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Node", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Node", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -7982,53 +8056,75 @@ func schema_k8sio_api_core_v1_NodeProxyOptions(ref common.ReferenceCallback) com } } -func schema_k8sio_api_core_v1_NodeResources(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_core_v1_NodeRuntimeHandler(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.", + Description: "NodeRuntimeHandler is a set of runtime handler information.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "Capacity": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "Capacity represents the available resources of a node", - Type: []string{"object"}, - AdditionalProperties: &spec.SchemaOrBool{ - Allows: true, - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), - }, - }, - }, + Description: "Runtime handler name. Empty for the default runtime handler.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "features": { + SchemaProps: spec.SchemaProps{ + Description: "Supported features.", + Ref: ref("k8s.io/api/core/v1.NodeRuntimeHandlerFeatures"), }, }, }, - Required: []string{"Capacity"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/api/core/v1.NodeRuntimeHandlerFeatures"}, } } -func schema_k8sio_api_core_v1_NodeSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_core_v1_NodeRuntimeHandlerFeatures(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.", + Description: "NodeRuntimeHandlerFeatures is a set of runtime features.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "nodeSelectorTerms": { + "recursiveReadOnlyMounts": { SchemaProps: spec.SchemaProps{ - Description: "Required. A list of node selector terms. The terms are ORed.", - Type: []string{"array"}, + Description: "RecursiveReadOnlyMounts is set to true if the runtime handler supports RecursiveReadOnlyMounts.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +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": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeSelectorTerm"), }, }, @@ -8045,8 +8141,7 @@ func schema_k8sio_api_core_v1_NodeSelector(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorTerm", - }, + "k8s.io/api/core/v1.NodeSelectorTerm"}, } } @@ -8071,10 +8166,15 @@ func schema_k8sio_api_core_v1_NodeSelectorRequirement(ref common.ReferenceCallba Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"DoesNotExist", "Exists", "Gt", "In", "Lt", "NotIn"}, + Enum: []interface{}{"DoesNotExist", "Exists", "Gt", "In", "Lt", "NotIn"}, }, }, "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -8104,13 +8204,18 @@ func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) com Type: []string{"object"}, Properties: map[string]spec.Schema{ "matchExpressions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"), }, }, @@ -8118,13 +8223,18 @@ func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) com }, }, "matchFields": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeSelectorRequirement"), }, }, @@ -8140,8 +8250,7 @@ func schema_k8sio_api_core_v1_NodeSelectorTerm(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorRequirement", - }, + "k8s.io/api/core/v1.NodeSelectorRequirement"}, } } @@ -8162,6 +8271,7 @@ func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.Open "podCIDRs": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", "x-kubernetes-patch-strategy": "merge", }, }, @@ -8194,13 +8304,18 @@ func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.Open }, }, "taints": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "If specified, the node's taints.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Taint"), }, }, @@ -8224,8 +8339,7 @@ func schema_k8sio_api_core_v1_NodeSpec(ref common.ReferenceCallback) common.Open }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeConfigSource", "k8s.io/api/core/v1.Taint", - }, + "k8s.io/api/core/v1.NodeConfigSource", "k8s.io/api/core/v1.Taint"}, } } @@ -8244,8 +8358,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -8259,8 +8372,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -8271,12 +8383,16 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op 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.\n\nPossible enum values:\n - `\"Pending\"` means the node has been created/added by the system, but not configured.\n - `\"Running\"` means the node has been configured and has Kubernetes components running.\n - `\"Terminated\"` means the node has been removed from the cluster.", Type: []string{"string"}, Format: "", - Enum: []any{"Pending", "Running", "Terminated"}, + Enum: []interface{}{"Pending", "Running", "Terminated"}, }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, @@ -8287,7 +8403,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeCondition"), }, }, @@ -8297,6 +8413,10 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op "addresses": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, @@ -8307,7 +8427,7 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeAddress"), }, }, @@ -8317,25 +8437,30 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op "daemonEndpoints": { SchemaProps: spec.SchemaProps{ Description: "Endpoints of daemons running on the Node.", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeSystemInfo"), }, }, "images": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "List of container images on this node", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerImage"), }, }, @@ -8343,6 +8468,11 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op }, }, "volumesInUse": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "List of attachable volumes in use (mounted) by the node.", Type: []string{"array"}, @@ -8358,13 +8488,18 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op }, }, "volumesAttached": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.AttachedVolume"), }, }, @@ -8377,12 +8512,30 @@ func schema_k8sio_api_core_v1_NodeStatus(ref common.ReferenceCallback) common.Op Ref: ref("k8s.io/api/core/v1.NodeConfigStatus"), }, }, + "runtimeHandlers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "The available runtime handlers.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.NodeRuntimeHandler"), + }, + }, + }, + }, + }, }, }, }, 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", - }, + "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.NodeRuntimeHandler", "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -8605,21 +8758,21 @@ func schema_k8sio_api_core_v1_PersistentVolume(ref common.ReferenceCallback) com "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PersistentVolumeStatus"), }, }, @@ -8627,8 +8780,7 @@ func schema_k8sio_api_core_v1_PersistentVolume(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeSpec", "k8s.io/api/core/v1.PersistentVolumeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PersistentVolumeSpec", "k8s.io/api/core/v1.PersistentVolumeStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -8656,21 +8808,21 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaim(ref common.ReferenceCallback "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimStatus"), }, }, @@ -8678,8 +8830,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaim(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.PersistentVolumeClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/api/core/v1.PersistentVolumeClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -8707,20 +8858,18 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref common.Referenc "lastProbeTime": { SchemaProps: spec.SchemaProps{ Description: "lastProbeTime is the time we probed the condition.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "lastTransitionTime is the time the condition transitioned from one status to another.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, "reason": { SchemaProps: spec.SchemaProps{ - Description: "reason is a 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.", + Description: "reason is a unique, this should be a short, machine understandable string that gives the reason for condition's last transition. If it reports \"Resizing\" that means the underlying persistent volume is being resized.", Type: []string{"string"}, Format: "", }, @@ -8737,8 +8886,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimCondition(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -8766,7 +8914,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref common.ReferenceCall "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -8777,7 +8925,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaim"), }, }, @@ -8789,8 +8937,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimList(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.PersistentVolumeClaim", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -8802,6 +8949,11 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Type: []string{"object"}, Properties: map[string]spec.Schema{ "accessModes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -8825,7 +8977,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall "resources": { SchemaProps: spec.SchemaProps{ Description: "resources represents the minimum resources the volume should have. If RecoverVolumeExpansionFailure feature is enabled users are allowed to specify resource requirements that are lower than previous value but must still be higher than capacity recorded in the status field of the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeResourceRequirements"), }, }, @@ -8848,7 +9000,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall Description: "volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.\n\nPossible enum values:\n - `\"Block\"` means the volume will not be formatted with a filesystem and will remain a raw block device.\n - `\"Filesystem\"` means the volume will be or is formatted with a filesystem.", Type: []string{"string"}, Format: "", - Enum: []any{"Block", "Filesystem"}, + Enum: []interface{}{"Block", "Filesystem"}, }, }, "dataSource": { @@ -8865,7 +9017,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, "volumeAttributesClassName": { SchemaProps: spec.SchemaProps{ - Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#volumeattributesclass (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", + Description: "volumeAttributesClassName may be used to set the VolumeAttributesClass used by this claim. If specified, the CSI driver will create or update the volume with the attributes defined in the corresponding VolumeAttributesClass. This has a different purpose than storageClassName, it can be changed after the claim is created. An empty string value means that no VolumeAttributesClass will be applied to the claim but it's not allowed to reset this field to empty string once it is set. If unspecified and the PersistentVolumeClaim is unbound, the default VolumeAttributesClass will be set by the persistentvolume controller if it exists. If the resource referred to by volumeAttributesClass does not exist, this PersistentVolumeClaim will be set to a Pending state, as reflected by the modifyVolumeStatus field, until such as a resource exists. More info: https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/ (Alpha) Using this field requires the VolumeAttributesClass feature gate to be enabled.", Type: []string{"string"}, Format: "", }, @@ -8874,8 +9026,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimSpec(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.TypedLocalObjectReference", "k8s.io/api/core/v1.TypedObjectReference", "k8s.io/api/core/v1.VolumeResourceRequirements", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/api/core/v1.TypedLocalObjectReference", "k8s.io/api/core/v1.TypedObjectReference", "k8s.io/api/core/v1.VolumeResourceRequirements", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -8891,10 +9042,15 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Description: "phase represents the current phase of PersistentVolumeClaim.\n\nPossible enum values:\n - `\"Bound\"` used for PersistentVolumeClaims that are bound\n - `\"Lost\"` used for PersistentVolumeClaims that lost their underlying PersistentVolume. The claim was bound to a PersistentVolume and this volume does not exist any longer and all data on it was lost.\n - `\"Pending\"` used for PersistentVolumeClaims that are not yet bound", Type: []string{"string"}, Format: "", - Enum: []any{"Bound", "Lost", "Pending"}, + Enum: []interface{}{"Bound", "Lost", "Pending"}, }, }, "accessModes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -8917,8 +9073,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -8927,17 +9082,21 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, }, SchemaProps: spec.SchemaProps{ - Description: "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'ResizeStarted'.", + Description: "conditions is the current Condition of persistent volume claim. If underlying persistent volume is being resized then the Condition will be set to 'Resizing'.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimCondition"), }, }, @@ -8952,8 +9111,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -8997,8 +9155,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimStatus(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ModifyVolumeStatus", "k8s.io/api/core/v1.PersistentVolumeClaimCondition", "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/api/core/v1.ModifyVolumeStatus", "k8s.io/api/core/v1.PersistentVolumeClaimCondition", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -9012,14 +9169,14 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimTemplate(ref common.Reference "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.", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PersistentVolumeClaimSpec"), }, }, @@ -9028,8 +9185,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeClaimTemplate(ref common.Reference }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PersistentVolumeClaimSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -9086,7 +9242,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeList(ref common.ReferenceCallback) "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -9097,7 +9253,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeList(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PersistentVolume"), }, }, @@ -9109,8 +9265,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeList(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PersistentVolume", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.PersistentVolume", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -9257,8 +9412,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSource(ref common.ReferenceCallbac }, }, 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", - }, + "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"}, } } @@ -9277,8 +9431,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -9417,6 +9570,11 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, }, "accessModes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -9447,7 +9605,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) Description: "persistentVolumeReclaimPolicy defines 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\n\nPossible enum values:\n - `\"Delete\"` means the volume will be deleted from Kubernetes on release from its claim. The volume plugin must support Deletion.\n - `\"Recycle\"` means the volume will be recycled back into the pool of unbound persistent volumes on release from its claim. The volume plugin must support Recycling.\n - `\"Retain\"` means the volume will be left in its current phase (Released) for manual reclamation by the administrator. The default policy is Retain.", Type: []string{"string"}, Format: "", - Enum: []any{"Delete", "Recycle", "Retain"}, + Enum: []interface{}{"Delete", "Recycle", "Retain"}, }, }, "storageClassName": { @@ -9458,6 +9616,11 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, }, "mountOptions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "mountOptions is the 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"}, @@ -9477,7 +9640,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) 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.\n\nPossible enum values:\n - `\"Block\"` means the volume will not be formatted with a filesystem and will remain a raw block device.\n - `\"Filesystem\"` means the volume will be or is formatted with a filesystem.", Type: []string{"string"}, Format: "", - Enum: []any{"Block", "Filesystem"}, + Enum: []interface{}{"Block", "Filesystem"}, }, }, "nodeAffinity": { @@ -9497,8 +9660,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeSpec(ref common.ReferenceCallback) }, }, 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", - }, + "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"}, } } @@ -9514,7 +9676,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac 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\n\nPossible enum values:\n - `\"Available\"` used for PersistentVolumes that are not yet bound Available volumes are held by the binder and matched to PersistentVolumeClaims\n - `\"Bound\"` used for PersistentVolumes that are bound\n - `\"Failed\"` used for PersistentVolumes that failed to be correctly recycled or deleted after being released from a claim\n - `\"Pending\"` used for PersistentVolumes that are not available\n - `\"Released\"` used for PersistentVolumes where the bound PersistentVolumeClaim was deleted released volumes must be recycled before becoming available again this phase is used by the persistent volume claim binder to signal to another process to reclaim the resource", Type: []string{"string"}, Format: "", - Enum: []any{"Available", "Bound", "Failed", "Pending", "Released"}, + Enum: []interface{}{"Available", "Bound", "Failed", "Pending", "Released"}, }, }, "message": { @@ -9533,7 +9695,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac }, "lastPhaseTransitionTime": { SchemaProps: spec.SchemaProps{ - Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is an alpha field and requires enabling PersistentVolumeLastPhaseTransitionTime feature.", + Description: "lastPhaseTransitionTime is the time the phase transitioned from one to another and automatically resets to current time everytime a volume phase transitions. This is a beta field and requires the PersistentVolumeLastPhaseTransitionTime feature to be enabled (enabled by default).", Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -9541,8 +9703,7 @@ func schema_k8sio_api_core_v1_PersistentVolumeStatus(ref common.ReferenceCallbac }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -9599,21 +9760,21 @@ func schema_k8sio_api_core_v1_Pod(ref common.ReferenceCallback) common.OpenAPIDe "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodStatus"), }, }, @@ -9621,8 +9782,7 @@ func schema_k8sio_api_core_v1_Pod(ref common.ReferenceCallback) common.OpenAPIDe }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodSpec", "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PodSpec", "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -9634,13 +9794,18 @@ func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.O Type: []string{"object"}, Properties: map[string]spec.Schema{ "requiredDuringSchedulingIgnoredDuringExecution": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), }, }, @@ -9648,13 +9813,18 @@ func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.O }, }, "preferredDuringSchedulingIgnoredDuringExecution": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.WeightedPodAffinityTerm"), }, }, @@ -9665,8 +9835,7 @@ func schema_k8sio_api_core_v1_PodAffinity(ref common.ReferenceCallback) common.O }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm", - }, + "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm"}, } } @@ -9684,6 +9853,11 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, "namespaces": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".", Type: []string{"array"}, @@ -9719,7 +9893,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Description: "MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both matchLabelKeys and labelSelector. Also, matchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -9739,7 +9913,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, SchemaProps: spec.SchemaProps{ - Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", + Description: "MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `labelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both mismatchLabelKeys and labelSelector. Also, mismatchLabelKeys cannot be set when labelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -9757,8 +9931,7 @@ func schema_k8sio_api_core_v1_PodAffinityTerm(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -9770,13 +9943,18 @@ func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) comm Type: []string{"object"}, Properties: map[string]spec.Schema{ "requiredDuringSchedulingIgnoredDuringExecution": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), }, }, @@ -9784,13 +9962,18 @@ func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) comm }, }, "preferredDuringSchedulingIgnoredDuringExecution": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.WeightedPodAffinityTerm"), }, }, @@ -9801,8 +9984,7 @@ func schema_k8sio_api_core_v1_PodAntiAffinity(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm", - }, + "k8s.io/api/core/v1.PodAffinityTerm", "k8s.io/api/core/v1.WeightedPodAffinityTerm"}, } } @@ -9894,14 +10076,12 @@ func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common. "lastProbeTime": { SchemaProps: spec.SchemaProps{ Description: "Last time we probed the condition.", - Default: map[string]any{}, 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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -9924,8 +10104,7 @@ func schema_k8sio_api_core_v1_PodCondition(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -9937,6 +10116,11 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. Type: []string{"object"}, Properties: map[string]spec.Schema{ "nameservers": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -9952,6 +10136,11 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. }, }, "searches": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -9967,13 +10156,18 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. }, }, "options": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodDNSConfigOption"), }, }, @@ -9984,8 +10178,7 @@ func schema_k8sio_api_core_v1_PodDNSConfig(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodDNSConfigOption", - }, + "k8s.io/api/core/v1.PodDNSConfigOption"}, } } @@ -10072,6 +10265,11 @@ func schema_k8sio_api_core_v1_PodExecOptions(ref common.ReferenceCallback) commo }, }, "command": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Command is the remote command to execute. argv array. Not executed within a shell.", Type: []string{"array"}, @@ -10137,7 +10335,7 @@ func schema_k8sio_api_core_v1_PodList(ref common.ReferenceCallback) common.OpenA "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -10148,7 +10346,7 @@ func schema_k8sio_api_core_v1_PodList(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Pod"), }, }, @@ -10160,8 +10358,7 @@ func schema_k8sio_api_core_v1_PodList(ref common.ReferenceCallback) common.OpenA }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Pod", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Pod", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -10252,8 +10449,7 @@ func schema_k8sio_api_core_v1_PodLogOptions(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -10301,6 +10497,11 @@ func schema_k8sio_api_core_v1_PodPortForwardOptions(ref common.ReferenceCallback }, }, "ports": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "List of ports to forward Required when using WebSockets", Type: []string{"array"}, @@ -10395,7 +10596,7 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com "source": { SchemaProps: spec.SchemaProps{ Description: "Source describes where to find the ResourceClaim.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ClaimSource"), }, }, @@ -10404,8 +10605,7 @@ func schema_k8sio_api_core_v1_PodResourceClaim(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ClaimSource", - }, + "k8s.io/api/core/v1.ClaimSource"}, } } @@ -10501,6 +10701,11 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, "supplementalGroups": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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, the fsGroup (if specified), and group memberships defined in the container image for the uid of the container process. If unspecified, no additional groups are added to any container. Note that group memberships defined in the container image for the uid of the container process are still effective, even if they are not included in this list. Note that this field cannot be set when spec.os.name is windows.", Type: []string{"array"}, @@ -10523,13 +10728,18 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c }, }, "sysctls": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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. Note that this field cannot be set when spec.os.name is windows.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Sysctl"), }, }, @@ -10541,7 +10751,7 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c 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, \"Always\" is used. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Always\"` indicates that volume's ownership and permissions should always be changed whenever volume is mounted inside a Pod. This the default behavior.\n - `\"OnRootMismatch\"` indicates that volume's ownership and permissions will be changed only when permission and ownership of root directory does not match with expected permissions on the volume. This can help shorten the time it takes to change ownership and permissions of a volume.", Type: []string{"string"}, Format: "", - Enum: []any{"Always", "OnRootMismatch"}, + Enum: []interface{}{"Always", "OnRootMismatch"}, }, }, "seccompProfile": { @@ -10550,12 +10760,17 @@ func schema_k8sio_api_core_v1_PodSecurityContext(ref common.ReferenceCallback) c Ref: ref("k8s.io/api/core/v1.SeccompProfile"), }, }, + "appArmorProfile": { + SchemaProps: spec.SchemaProps{ + Description: "appArmorProfile is the AppArmor options to use by the containers in this pod. Note that this field cannot be set when spec.os.name is windows.", + Ref: ref("k8s.io/api/core/v1.AppArmorProfile"), + }, + }, }, }, }, 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", - }, + "k8s.io/api/core/v1.AppArmorProfile", "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.SeccompProfile", "k8s.io/api/core/v1.Sysctl", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, } } @@ -10576,8 +10791,7 @@ func schema_k8sio_api_core_v1_PodSignature(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"}, } } @@ -10591,6 +10805,10 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "volumes": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge,retainKeys", }, @@ -10601,7 +10819,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Volume"), }, }, @@ -10611,6 +10829,10 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "initContainers": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -10621,7 +10843,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Container"), }, }, @@ -10631,6 +10853,10 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "containers": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -10641,7 +10867,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Container"), }, }, @@ -10651,6 +10877,10 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "ephemeralContainers": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -10661,7 +10891,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.EphemeralContainer"), }, }, @@ -10673,7 +10903,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Description: "Restart policy for all containers within the pod. One of Always, OnFailure, Never. In some contexts, only a subset of those values may be permitted. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy\n\nPossible enum values:\n - `\"Always\"`\n - `\"Never\"`\n - `\"OnFailure\"`", Type: []string{"string"}, Format: "", - Enum: []any{"Always", "Never", "OnFailure"}, + Enum: []interface{}{"Always", "Never", "OnFailure"}, }, }, "terminationGracePeriodSeconds": { @@ -10695,7 +10925,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA 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'.\n\nPossible enum values:\n - `\"ClusterFirst\"` indicates that the pod should use cluster DNS first unless hostNetwork is true, if it is available, then fall back on the default (as determined by kubelet) DNS settings.\n - `\"ClusterFirstWithHostNet\"` indicates that the pod should use cluster DNS first, if it is available, then fall back on the default (as determined by kubelet) DNS settings.\n - `\"Default\"` indicates that the pod should use the default (as determined by kubelet) DNS settings.\n - `\"None\"` indicates that the pod should use empty DNS settings. DNS parameters such as nameservers and search paths should be defined via DNSConfig.", Type: []string{"string"}, Format: "", - Enum: []any{"ClusterFirst", "ClusterFirstWithHostNet", "Default", "None"}, + Enum: []interface{}{"ClusterFirst", "ClusterFirstWithHostNet", "Default", "None"}, }, }, "nodeSelector": { @@ -10728,7 +10958,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "serviceAccount": { SchemaProps: spec.SchemaProps{ - Description: "DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", + Description: "DeprecatedServiceAccount is a deprecated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.", Type: []string{"string"}, Format: "", }, @@ -10784,6 +11014,10 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "imagePullSecrets": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -10794,7 +11028,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, @@ -10829,13 +11063,18 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, "tolerations": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "If specified, the pod's tolerations.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Toleration"), }, }, @@ -10845,17 +11084,21 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "hostAliases": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "ip", + }, + "x-kubernetes-list-type": "map", "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.", + Description: "HostAliases is an optional list of hosts and IPs that will be injected into the pod's hosts file if specified.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.HostAlias"), }, }, @@ -10883,13 +11126,18 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, "readinessGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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/580-pod-readiness-gates", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodReadinessGate"), }, }, @@ -10915,7 +11163,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Description: "PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset.\n\nPossible enum values:\n - `\"Never\"` means that pod never preempts other pods with lower priority.\n - `\"PreemptLowerPriority\"` means that pod can preempt other pods with lower priority.", Type: []string{"string"}, Format: "", - Enum: []any{"Never", "PreemptLowerPriority"}, + Enum: []interface{}{"Never", "PreemptLowerPriority"}, }, }, "overhead": { @@ -10926,8 +11174,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -10936,7 +11183,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "topologySpreadConstraints": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "topologyKey", "whenUnsatisfiable", }, @@ -10951,7 +11198,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.TopologySpreadConstraint"), }, }, @@ -10967,7 +11214,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, "os": { SchemaProps: spec.SchemaProps{ - Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", + Description: "Specifies the OS of the containers in the pod. Some pod and container fields are restricted if this is set.\n\nIf the OS field is set to linux, the following fields must be unset: -securityContext.windowsOptions\n\nIf the OS field is set to windows, following fields must be unset: - spec.hostPID - spec.hostIPC - spec.hostUsers - spec.securityContext.appArmorProfile - spec.securityContext.seLinuxOptions - spec.securityContext.seccompProfile - spec.securityContext.fsGroup - spec.securityContext.fsGroupChangePolicy - spec.securityContext.sysctls - spec.shareProcessNamespace - spec.securityContext.runAsUser - spec.securityContext.runAsGroup - spec.securityContext.supplementalGroups - spec.containers[*].securityContext.appArmorProfile - spec.containers[*].securityContext.seLinuxOptions - spec.containers[*].securityContext.seccompProfile - spec.containers[*].securityContext.capabilities - spec.containers[*].securityContext.readOnlyRootFilesystem - spec.containers[*].securityContext.privileged - spec.containers[*].securityContext.allowPrivilegeEscalation - spec.containers[*].securityContext.procMount - spec.containers[*].securityContext.runAsUser - spec.containers[*].securityContext.runAsGroup", Ref: ref("k8s.io/api/core/v1.PodOS"), }, }, @@ -10981,7 +11228,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "schedulingGates": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "name", }, "x-kubernetes-list-type": "map", @@ -10990,12 +11237,12 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, SchemaProps: spec.SchemaProps{ - Description: "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod.\n\nSchedulingGates can only be set at pod creation time, and be removed only afterwards.\n\nThis is a beta feature enabled by the PodSchedulingReadiness feature gate.", + Description: "SchedulingGates is an opaque list of values that if specified will block scheduling the pod. If schedulingGates is not empty, the pod will stay in the SchedulingGated state and the scheduler will not attempt to schedule the pod.\n\nSchedulingGates can only be set at pod creation time, and be removed only afterwards.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodSchedulingGate"), }, }, @@ -11005,7 +11252,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA "resourceClaims": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "name", }, "x-kubernetes-list-type": "map", @@ -11019,7 +11266,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodResourceClaim"), }, }, @@ -11031,8 +11278,7 @@ func schema_k8sio_api_core_v1_PodSpec(ref common.ReferenceCallback) common.OpenA }, }, 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.PodOS", "k8s.io/api/core/v1.PodReadinessGate", "k8s.io/api/core/v1.PodResourceClaim", "k8s.io/api/core/v1.PodSchedulingGate", "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", - }, + "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.PodOS", "k8s.io/api/core/v1.PodReadinessGate", "k8s.io/api/core/v1.PodResourceClaim", "k8s.io/api/core/v1.PodSchedulingGate", "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"}, } } @@ -11048,12 +11294,16 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope 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\n\nPossible enum values:\n - `\"Failed\"` means that all containers in the pod have terminated, and at least one container has terminated in a failure (exited with a non-zero exit code or was stopped by the system).\n - `\"Pending\"` means the pod has been accepted by the system, but one or more of the containers has not been started. This includes time before being bound to a node, as well as time spent pulling images onto the host.\n - `\"Running\"` means the pod has been bound to a node and all of the containers have been started. At least one container is still running or is in the process of being restarted.\n - `\"Succeeded\"` means that all containers in the pod have voluntarily terminated with a container exit code of 0, and the system is not going to restart any of these containers.\n - `\"Unknown\"` means that 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. Deprecated: It isn't being set since 2015 (74da3b14b0c0f658b3bb8d2def5094686d0e9095)", Type: []string{"string"}, Format: "", - Enum: []any{"Failed", "Pending", "Running", "Succeeded", "Unknown"}, + Enum: []interface{}{"Failed", "Pending", "Running", "Succeeded", "Unknown"}, }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, @@ -11064,7 +11314,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodCondition"), }, }, @@ -11113,7 +11363,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.HostIP"), }, }, @@ -11130,6 +11380,10 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope "podIPs": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "ip", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "ip", "x-kubernetes-patch-strategy": "merge", }, @@ -11140,7 +11394,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodIP"), }, }, @@ -11154,13 +11408,18 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, }, "initContainerStatuses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerStatus"), }, }, @@ -11168,13 +11427,18 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, }, "containerStatuses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "The list has one entry per container in the manifest. 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerStatus"), }, }, @@ -11186,17 +11450,22 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope 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://kubernetes.io/docs/concepts/workloads/pods/pod-qos/#quality-of-service-classes\n\nPossible enum values:\n - `\"BestEffort\"` is the BestEffort qos class.\n - `\"Burstable\"` is the Burstable qos class.\n - `\"Guaranteed\"` is the Guaranteed qos class.", Type: []string{"string"}, Format: "", - Enum: []any{"BestEffort", "Burstable", "Guaranteed"}, + Enum: []interface{}{"BestEffort", "Burstable", "Guaranteed"}, }, }, "ephemeralContainerStatuses": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "Status for any ephemeral containers that have run in this pod.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ContainerStatus"), }, }, @@ -11213,7 +11482,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope "resourceClaimStatuses": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "name", }, "x-kubernetes-list-type": "map", @@ -11227,7 +11496,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodResourceClaimStatus"), }, }, @@ -11238,8 +11507,7 @@ func schema_k8sio_api_core_v1_PodStatus(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.HostIP", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodIP", "k8s.io/api/core/v1.PodResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/api/core/v1.ContainerStatus", "k8s.io/api/core/v1.HostIP", "k8s.io/api/core/v1.PodCondition", "k8s.io/api/core/v1.PodIP", "k8s.io/api/core/v1.PodResourceClaimStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -11267,14 +11535,14 @@ func schema_k8sio_api_core_v1_PodStatusResult(ref common.ReferenceCallback) comm "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodStatus"), }, }, @@ -11282,8 +11550,7 @@ func schema_k8sio_api_core_v1_PodStatusResult(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PodStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -11311,14 +11578,14 @@ func schema_k8sio_api_core_v1_PodTemplate(ref common.ReferenceCallback) common.O "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodTemplateSpec"), }, }, @@ -11326,8 +11593,7 @@ func schema_k8sio_api_core_v1_PodTemplate(ref common.ReferenceCallback) common.O }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PodTemplateSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -11355,7 +11621,7 @@ func schema_k8sio_api_core_v1_PodTemplateList(ref common.ReferenceCallback) comm "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -11366,7 +11632,7 @@ func schema_k8sio_api_core_v1_PodTemplateList(ref common.ReferenceCallback) comm Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodTemplate"), }, }, @@ -11378,8 +11644,7 @@ func schema_k8sio_api_core_v1_PodTemplateList(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.PodTemplate", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -11393,14 +11658,14 @@ func schema_k8sio_api_core_v1_PodTemplateSpec(ref common.ReferenceCallback) comm "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodSpec"), }, }, @@ -11408,8 +11673,7 @@ func schema_k8sio_api_core_v1_PodTemplateSpec(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.PodSpec", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -11433,7 +11697,7 @@ func schema_k8sio_api_core_v1_PortStatus(ref common.ReferenceCallback) common.Op Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"SCTP", "TCP", "UDP"}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, }, }, "error": { @@ -11496,14 +11760,13 @@ func schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref common.ReferenceCallback) "podSignature": { SchemaProps: spec.SchemaProps{ Description: "The class of pods.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodSignature"), }, }, "evictionTime": { SchemaProps: spec.SchemaProps{ Description: "Time at which this entry was added to the list.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -11526,8 +11789,7 @@ func schema_k8sio_api_core_v1_PreferAvoidPodsEntry(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodSignature", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/api/core/v1.PodSignature", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -11549,7 +11811,7 @@ func schema_k8sio_api_core_v1_PreferredSchedulingTerm(ref common.ReferenceCallba "preference": { SchemaProps: spec.SchemaProps{ Description: "A node selector term, associated with the corresponding weight.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.NodeSelectorTerm"), }, }, @@ -11558,8 +11820,7 @@ func schema_k8sio_api_core_v1_PreferredSchedulingTerm(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelectorTerm", - }, + "k8s.io/api/core/v1.NodeSelectorTerm"}, } } @@ -11640,8 +11901,7 @@ func schema_k8sio_api_core_v1_Probe(ref common.ReferenceCallback) common.OpenAPI }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.GRPCAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction", - }, + "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.GRPCAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, } } @@ -11680,8 +11940,7 @@ func schema_k8sio_api_core_v1_ProbeHandler(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.GRPCAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction", - }, + "k8s.io/api/core/v1.ExecAction", "k8s.io/api/core/v1.GRPCAction", "k8s.io/api/core/v1.HTTPGetAction", "k8s.io/api/core/v1.TCPSocketAction"}, } } @@ -11693,13 +11952,18 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback Type: []string{"object"}, Properties: map[string]spec.Schema{ "sources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "sources is the list of volume projections", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.VolumeProjection"), }, }, @@ -11717,8 +11981,7 @@ func schema_k8sio_api_core_v1_ProjectedVolumeSource(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.VolumeProjection", - }, + "k8s.io/api/core/v1.VolumeProjection"}, } } @@ -11788,6 +12051,11 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall Type: []string{"object"}, Properties: map[string]spec.Schema{ "monitors": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", Type: []string{"array"}, @@ -11856,8 +12124,7 @@ func schema_k8sio_api_core_v1_RBDPersistentVolumeSource(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -11869,6 +12136,11 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm Type: []string{"object"}, Properties: map[string]spec.Schema{ "monitors": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "monitors is a collection of Ceph monitors. More info: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it", Type: []string{"array"}, @@ -11937,8 +12209,7 @@ func schema_k8sio_api_core_v1_RBDVolumeSource(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -11966,7 +12237,7 @@ func schema_k8sio_api_core_v1_RangeAllocation(ref common.ReferenceCallback) comm "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, @@ -11990,8 +12261,7 @@ func schema_k8sio_api_core_v1_RangeAllocation(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -12019,21 +12289,21 @@ func schema_k8sio_api_core_v1_ReplicationController(ref common.ReferenceCallback "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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ReplicationControllerStatus"), }, }, @@ -12041,8 +12311,7 @@ func schema_k8sio_api_core_v1_ReplicationController(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationControllerSpec", "k8s.io/api/core/v1.ReplicationControllerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.ReplicationControllerSpec", "k8s.io/api/core/v1.ReplicationControllerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -12072,7 +12341,6 @@ func schema_k8sio_api_core_v1_ReplicationControllerCondition(ref common.Referenc "lastTransitionTime": { SchemaProps: spec.SchemaProps{ Description: "The last time the condition transitioned from one status to another.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -12095,8 +12363,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerCondition(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -12124,7 +12391,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerList(ref common.ReferenceCall "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -12135,7 +12402,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerList(ref common.ReferenceCall Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ReplicationController"), }, }, @@ -12147,8 +12414,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerList(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationController", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.ReplicationController", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -12204,8 +12470,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerSpec(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodTemplateSpec", - }, + "k8s.io/api/core/v1.PodTemplateSpec"}, } } @@ -12255,6 +12520,10 @@ func schema_k8sio_api_core_v1_ReplicationControllerStatus(ref common.ReferenceCa "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "type", "x-kubernetes-patch-strategy": "merge", }, @@ -12265,7 +12534,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerStatus(ref common.ReferenceCa Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ReplicationControllerCondition"), }, }, @@ -12277,8 +12546,7 @@ func schema_k8sio_api_core_v1_ReplicationControllerStatus(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ReplicationControllerCondition", - }, + "k8s.io/api/core/v1.ReplicationControllerCondition"}, } } @@ -12329,7 +12597,6 @@ func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback "divisor": { SchemaProps: spec.SchemaProps{ Description: "Specifies the output format of the exposed resources, defaults to \"1\"", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, @@ -12343,8 +12610,7 @@ func schema_k8sio_api_core_v1_ResourceFieldSelector(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -12372,21 +12638,21 @@ func schema_k8sio_api_core_v1_ResourceQuota(ref common.ReferenceCallback) common "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ResourceQuotaStatus"), }, }, @@ -12394,8 +12660,7 @@ func schema_k8sio_api_core_v1_ResourceQuota(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ResourceQuotaSpec", "k8s.io/api/core/v1.ResourceQuotaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.ResourceQuotaSpec", "k8s.io/api/core/v1.ResourceQuotaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -12423,7 +12688,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaList(ref common.ReferenceCallback) co "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -12434,7 +12699,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaList(ref common.ReferenceCallback) co Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ResourceQuota"), }, }, @@ -12446,8 +12711,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaList(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ResourceQuota", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.ResourceQuota", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -12466,14 +12730,18 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, }, }, "scopes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -12498,8 +12766,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaSpec(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ScopeSelector", "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/api/core/v1.ScopeSelector", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -12518,8 +12785,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -12533,8 +12799,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -12544,8 +12809,7 @@ func schema_k8sio_api_core_v1_ResourceQuotaStatus(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -12564,8 +12828,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -12579,8 +12842,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -12589,7 +12851,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) "claims": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "name", }, "x-kubernetes-list-type": "map", @@ -12601,7 +12863,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ResourceClaim"), }, }, @@ -12612,8 +12874,7 @@ func schema_k8sio_api_core_v1_ResourceRequirements(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ResourceClaim", "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/api/core/v1.ResourceClaim", "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -12741,8 +13002,7 @@ func schema_k8sio_api_core_v1_ScaleIOPersistentVolumeSource(ref common.Reference }, }, Dependencies: []string{ - "k8s.io/api/core/v1.SecretReference", - }, + "k8s.io/api/core/v1.SecretReference"}, } } @@ -12829,8 +13089,7 @@ func schema_k8sio_api_core_v1_ScaleIOVolumeSource(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -12842,13 +13101,18 @@ func schema_k8sio_api_core_v1_ScopeSelector(ref common.ReferenceCallback) common Type: []string{"object"}, Properties: map[string]spec.Schema{ "matchExpressions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ScopedResourceSelectorRequirement"), }, }, @@ -12864,8 +13128,7 @@ func schema_k8sio_api_core_v1_ScopeSelector(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ScopedResourceSelectorRequirement", - }, + "k8s.io/api/core/v1.ScopedResourceSelectorRequirement"}, } } @@ -12882,7 +13145,7 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating"}, + Enum: []interface{}{"BestEffort", "CrossNamespacePodAffinity", "NotBestEffort", "NotTerminating", "PriorityClass", "Terminating"}, }, }, "operator": { @@ -12891,10 +13154,15 @@ func schema_k8sio_api_core_v1_ScopedResourceSelectorRequirement(ref common.Refer Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"DoesNotExist", "Exists", "In", "NotIn"}, + Enum: []interface{}{"DoesNotExist", "Exists", "In", "NotIn"}, }, }, "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -12929,7 +13197,7 @@ func schema_k8sio_api_core_v1_SeccompProfile(ref common.ReferenceCallback) commo Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"Localhost", "RuntimeDefault", "Unconfined"}, + Enum: []interface{}{"Localhost", "RuntimeDefault", "Unconfined"}, }, }, "localhostProfile": { @@ -12944,10 +13212,10 @@ func schema_k8sio_api_core_v1_SeccompProfile(ref common.ReferenceCallback) commo }, VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-unions": []any{ - map[string]any{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ "discriminator": "type", - "fields-to-discriminateBy": map[string]any{ + "fields-to-discriminateBy": map[string]interface{}{ "localhostProfile": "LocalhostProfile", }, }, @@ -12982,7 +13250,7 @@ func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAP "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, @@ -13035,8 +13303,7 @@ func schema_k8sio_api_core_v1_Secret(ref common.ReferenceCallback) common.OpenAP }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -13049,7 +13316,8 @@ func schema_k8sio_api_core_v1_SecretEnvSource(ref common.ReferenceCallback) comm 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, @@ -13076,7 +13344,8 @@ func schema_k8sio_api_core_v1_SecretKeySelector(ref common.ReferenceCallback) co 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, @@ -13132,7 +13401,7 @@ func schema_k8sio_api_core_v1_SecretList(ref common.ReferenceCallback) common.Op "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -13143,7 +13412,7 @@ func schema_k8sio_api_core_v1_SecretList(ref common.ReferenceCallback) common.Op Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Secret"), }, }, @@ -13155,8 +13424,7 @@ func schema_k8sio_api_core_v1_SecretList(ref common.ReferenceCallback) common.Op }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Secret", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Secret", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -13169,19 +13437,25 @@ func schema_k8sio_api_core_v1_SecretProjection(ref common.ReferenceCallback) com 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", + Description: "Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names", + Default: "", Type: []string{"string"}, Format: "", }, }, "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "items 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.KeyToPath"), }, }, @@ -13199,8 +13473,7 @@ func schema_k8sio_api_core_v1_SecretProjection(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath", - }, + "k8s.io/api/core/v1.KeyToPath"}, } } @@ -13251,13 +13524,18 @@ func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) c }, }, "items": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "items 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.KeyToPath"), }, }, @@ -13282,8 +13560,7 @@ func schema_k8sio_api_core_v1_SecretVolumeSource(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.KeyToPath", - }, + "k8s.io/api/core/v1.KeyToPath"}, } } @@ -13359,7 +13636,7 @@ func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) comm 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. Note that this field cannot be set when spec.os.name is windows.\n\nPossible enum values:\n - `\"Default\"` uses the container runtime defaults for readonly and masked paths for /proc. Most container runtimes mask certain paths in /proc to avoid accidental security exposure of special devices or information.\n - `\"Unmasked\"` bypasses the default masking behavior of the container runtime and ensures the newly created /proc the container stays in tact with no modifications.", Type: []string{"string"}, Format: "", - Enum: []any{"Default", "Unmasked"}, + Enum: []interface{}{"Default", "Unmasked"}, }, }, "seccompProfile": { @@ -13368,12 +13645,17 @@ func schema_k8sio_api_core_v1_SecurityContext(ref common.ReferenceCallback) comm Ref: ref("k8s.io/api/core/v1.SeccompProfile"), }, }, + "appArmorProfile": { + SchemaProps: spec.SchemaProps{ + Description: "appArmorProfile is the AppArmor options to use by this container. If set, this profile overrides the pod's appArmorProfile. Note that this field cannot be set when spec.os.name is windows.", + Ref: ref("k8s.io/api/core/v1.AppArmorProfile"), + }, + }, }, }, }, 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", - }, + "k8s.io/api/core/v1.AppArmorProfile", "k8s.io/api/core/v1.Capabilities", "k8s.io/api/core/v1.SELinuxOptions", "k8s.io/api/core/v1.SeccompProfile", "k8s.io/api/core/v1.WindowsSecurityContextOptions"}, } } @@ -13401,7 +13683,7 @@ func schema_k8sio_api_core_v1_SerializedReference(ref common.ReferenceCallback) "reference": { SchemaProps: spec.SchemaProps{ Description: "The reference to an object in the system.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ObjectReference"), }, }, @@ -13409,8 +13691,7 @@ func schema_k8sio_api_core_v1_SerializedReference(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", - }, + "k8s.io/api/core/v1.ObjectReference"}, } } @@ -13438,21 +13719,21 @@ func schema_k8sio_api_core_v1_Service(ref common.ReferenceCallback) common.OpenA "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, 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", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ServiceStatus"), }, }, @@ -13460,8 +13741,7 @@ func schema_k8sio_api_core_v1_Service(ref common.ReferenceCallback) common.OpenA }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ServiceSpec", "k8s.io/api/core/v1.ServiceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.ServiceSpec", "k8s.io/api/core/v1.ServiceStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -13489,13 +13769,17 @@ func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) commo "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, "secrets": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "name", "x-kubernetes-patch-strategy": "merge", }, @@ -13506,7 +13790,7 @@ func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) commo Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ObjectReference"), }, }, @@ -13514,13 +13798,18 @@ func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) commo }, }, "imagePullSecrets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LocalObjectReference"), }, }, @@ -13538,8 +13827,7 @@ func schema_k8sio_api_core_v1_ServiceAccount(ref common.ReferenceCallback) commo }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/api/core/v1.LocalObjectReference", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -13567,7 +13855,7 @@ func schema_k8sio_api_core_v1_ServiceAccountList(ref common.ReferenceCallback) c "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -13578,7 +13866,7 @@ func schema_k8sio_api_core_v1_ServiceAccountList(ref common.ReferenceCallback) c Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ServiceAccount"), }, }, @@ -13590,8 +13878,7 @@ func schema_k8sio_api_core_v1_ServiceAccountList(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ServiceAccount", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.ServiceAccount", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -13655,7 +13942,7 @@ func schema_k8sio_api_core_v1_ServiceList(ref common.ReferenceCallback) common.O "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -13666,7 +13953,7 @@ func schema_k8sio_api_core_v1_ServiceList(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.Service"), }, }, @@ -13678,8 +13965,7 @@ func schema_k8sio_api_core_v1_ServiceList(ref common.ReferenceCallback) common.O }, }, Dependencies: []string{ - "k8s.io/api/core/v1.Service", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", - }, + "k8s.io/api/core/v1.Service", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } @@ -13703,7 +13989,7 @@ func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.O Default: "TCP", Type: []string{"string"}, Format: "", - Enum: []any{"SCTP", "TCP", "UDP"}, + Enum: []interface{}{"SCTP", "TCP", "UDP"}, }, }, "appProtocol": { @@ -13724,7 +14010,6 @@ func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.O "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", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -13740,8 +14025,7 @@ func schema_k8sio_api_core_v1_ServicePort(ref common.ReferenceCallback) common.O }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString", - }, + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, } } @@ -13789,7 +14073,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O "ports": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "port", "protocol", }, @@ -13804,7 +14088,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.ServicePort"), }, }, @@ -13864,10 +14148,15 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Description: "type determines how the Service is exposed. Defaults to ClusterIP. Valid options are ExternalName, ClusterIP, NodePort, and LoadBalancer. \"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 or EndpointSlice objects. If clusterIP is \"None\", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a virtual IP. \"NodePort\" builds on ClusterIP and allocates a port on every node which routes to the same endpoints as the clusterIP. \"LoadBalancer\" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the same endpoints as the clusterIP. \"ExternalName\" aliases this service to the specified externalName. Several other fields do not apply to ExternalName services. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types\n\nPossible enum values:\n - `\"ClusterIP\"` means a service will only be accessible inside the cluster, via the cluster IP.\n - `\"ExternalName\"` means a service consists of only a reference to an external name that kubedns or equivalent will return as a CNAME record, with no exposing or proxying of any pods involved.\n - `\"LoadBalancer\"` means a service will be exposed via an external load balancer (if the cloud provider supports it), in addition to 'NodePort' type.\n - `\"NodePort\"` means a service will be exposed on one port of every node, in addition to 'ClusterIP' type.", Type: []string{"string"}, Format: "", - Enum: []any{"ClusterIP", "ExternalName", "LoadBalancer", "NodePort"}, + Enum: []interface{}{"ClusterIP", "ExternalName", "LoadBalancer", "NodePort"}, }, }, "externalIPs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -13887,7 +14176,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O 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\n\nPossible enum values:\n - `\"ClientIP\"` is the Client IP based.\n - `\"None\"` - no session affinity.", Type: []string{"string"}, Format: "", - Enum: []any{"ClientIP", "None"}, + Enum: []interface{}{"ClientIP", "None"}, }, }, "loadBalancerIP": { @@ -13898,6 +14187,11 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O }, }, "loadBalancerSourceRanges": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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/create-external-load-balancer/", Type: []string{"array"}, @@ -13924,7 +14218,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Description: "externalTrafficPolicy describes how nodes distribute service traffic they receive on one of the Service's \"externally-facing\" addresses (NodePorts, ExternalIPs, and LoadBalancer IPs). If set to \"Local\", the proxy will configure the service in a way that assumes that external load balancers will take care of balancing the service traffic between nodes, and so each node will deliver traffic only to the node-local endpoints of the service, without masquerading the client source IP. (Traffic mistakenly sent to a node with no endpoints will be dropped.) The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features). Note that traffic sent to an External IP or LoadBalancer IP from within the cluster will always get \"Cluster\" semantics, but clients sending to a NodePort from within the cluster may need to take traffic policy into account when picking a node.\n\nPossible enum values:\n - `\"Cluster\"`\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"`\n - `\"Local\"` preserves the source IP of the traffic by routing only to endpoints on the same node as the traffic was received on (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []any{"Cluster", "Cluster", "Local", "Local"}, + Enum: []interface{}{"Cluster", "Cluster", "Local", "Local"}, }, }, "healthCheckNodePort": { @@ -13972,7 +14266,7 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Description: "IPFamilyPolicy represents the dual-stack-ness requested or required by this Service. If there is no value provided, then this field will be set to SingleStack. Services can be \"SingleStack\" (a single IP family), \"PreferDualStack\" (two IP families on dual-stack configured clusters or a single IP family on single-stack clusters), or \"RequireDualStack\" (two IP families on dual-stack configured clusters, otherwise fail). The ipFamilies and clusterIPs fields depend on the value of this field. This field will be wiped when updating a service to type ExternalName.\n\nPossible enum values:\n - `\"PreferDualStack\"` indicates that this service prefers dual-stack when the cluster is configured for dual-stack. If the cluster is not configured for dual-stack the service will be assigned a single IPFamily. If the IPFamily is not set in service.spec.ipFamilies then the service will be assigned the default IPFamily configured on the cluster\n - `\"RequireDualStack\"` indicates that this service requires dual-stack. Using IPFamilyPolicyRequireDualStack on a single stack cluster will result in validation errors. The IPFamilies (and their order) assigned to this service is based on service.spec.ipFamilies. If service.spec.ipFamilies was not provided then it will be assigned according to how they are configured on the cluster. If service.spec.ipFamilies has only one entry then the alternative IPFamily will be added by apiserver\n - `\"SingleStack\"` indicates that this service is required to have a single IPFamily. The IPFamily assigned is based on the default IPFamily used by the cluster or as identified by service.spec.ipFamilies field", Type: []string{"string"}, Format: "", - Enum: []any{"PreferDualStack", "RequireDualStack", "SingleStack"}, + Enum: []interface{}{"PreferDualStack", "RequireDualStack", "SingleStack"}, }, }, "allocateLoadBalancerNodePorts": { @@ -13994,15 +14288,21 @@ func schema_k8sio_api_core_v1_ServiceSpec(ref common.ReferenceCallback) common.O Description: "InternalTrafficPolicy describes how nodes distribute service traffic they receive on the ClusterIP. If set to \"Local\", the proxy will assume that pods only want to talk to endpoints of the service on the same node as the pod, dropping the traffic if there are no local endpoints. The default value, \"Cluster\", uses the standard behavior of routing to all endpoints evenly (possibly modified by topology and other features).\n\nPossible enum values:\n - `\"Cluster\"` routes traffic to all endpoints.\n - `\"Local\"` routes traffic only to endpoints on the same node as the client pod (dropping the traffic if there are no local endpoints).", Type: []string{"string"}, Format: "", - Enum: []any{"Cluster", "Local"}, + Enum: []interface{}{"Cluster", "Local"}, + }, + }, + "trafficDistribution": { + SchemaProps: spec.SchemaProps{ + Description: "TrafficDistribution offers a way to express preferences for how traffic is distributed to Service endpoints. Implementations can use this field as a hint, but are not required to guarantee strict adherence. If the field is not set, the implementation will apply its default routing strategy. If set to \"PreferClose\", implementations should prioritize endpoints that are topologically close (e.g., same zone). This is an alpha field and requires enabling ServiceTrafficDistribution feature.", + Type: []string{"string"}, + Format: "", }, }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ServicePort", "k8s.io/api/core/v1.SessionAffinityConfig", - }, + "k8s.io/api/core/v1.ServicePort", "k8s.io/api/core/v1.SessionAffinityConfig"}, } } @@ -14016,14 +14316,14 @@ func schema_k8sio_api_core_v1_ServiceStatus(ref common.ReferenceCallback) common "loadBalancer": { SchemaProps: spec.SchemaProps{ Description: "LoadBalancer contains the current status of the load-balancer, if one is present.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.LoadBalancerStatus"), }, }, "conditions": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ - "x-kubernetes-list-map-keys": []any{ + "x-kubernetes-list-map-keys": []interface{}{ "type", }, "x-kubernetes-list-type": "map", @@ -14037,7 +14337,7 @@ func schema_k8sio_api_core_v1_ServiceStatus(ref common.ReferenceCallback) common Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), }, }, @@ -14048,8 +14348,7 @@ func schema_k8sio_api_core_v1_ServiceStatus(ref common.ReferenceCallback) common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LoadBalancerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", - }, + "k8s.io/api/core/v1.LoadBalancerStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, } } @@ -14070,8 +14369,7 @@ func schema_k8sio_api_core_v1_SessionAffinityConfig(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ClientIPConfig", - }, + "k8s.io/api/core/v1.ClientIPConfig"}, } } @@ -14142,8 +14440,7 @@ func schema_k8sio_api_core_v1_StorageOSPersistentVolumeSource(ref common.Referen }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", - }, + "k8s.io/api/core/v1.ObjectReference"}, } } @@ -14192,8 +14489,7 @@ func schema_k8sio_api_core_v1_StorageOSVolumeSource(ref common.ReferenceCallback }, }, Dependencies: []string{ - "k8s.io/api/core/v1.LocalObjectReference", - }, + "k8s.io/api/core/v1.LocalObjectReference"}, } } @@ -14237,7 +14533,6 @@ func schema_k8sio_api_core_v1_TCPSocketAction(ref common.ReferenceCallback) comm "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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), }, }, @@ -14253,8 +14548,7 @@ func schema_k8sio_api_core_v1_TCPSocketAction(ref common.ReferenceCallback) comm }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString", - }, + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, } } @@ -14286,7 +14580,7 @@ func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPI Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"NoExecute", "NoSchedule", "PreferNoSchedule"}, + Enum: []interface{}{"NoExecute", "NoSchedule", "PreferNoSchedule"}, }, }, "timeAdded": { @@ -14300,8 +14594,7 @@ func schema_k8sio_api_core_v1_Taint(ref common.ReferenceCallback) common.OpenAPI }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -14324,7 +14617,7 @@ func schema_k8sio_api_core_v1_Toleration(ref common.ReferenceCallback) common.Op 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.\n\nPossible enum values:\n - `\"Equal\"`\n - `\"Exists\"`", Type: []string{"string"}, Format: "", - Enum: []any{"Equal", "Exists"}, + Enum: []interface{}{"Equal", "Exists"}, }, }, "value": { @@ -14339,7 +14632,7 @@ func schema_k8sio_api_core_v1_Toleration(ref common.ReferenceCallback) common.Op Description: "Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.\n\nPossible enum values:\n - `\"NoExecute\"` Evict any already-running pods that do not tolerate the taint. Currently enforced by NodeController.\n - `\"NoSchedule\"` Do not allow new pods to schedule onto the node unless they tolerate the taint, but allow all pods submitted to Kubelet without going through the scheduler to start, and allow all already-running pods to continue running. Enforced by the scheduler.\n - `\"PreferNoSchedule\"` Like TaintEffectNoSchedule, but the scheduler tries not to schedule new pods onto the node, rather than prohibiting new pods from scheduling onto the node entirely. Enforced by the scheduler.", Type: []string{"string"}, Format: "", - Enum: []any{"NoExecute", "NoSchedule", "PreferNoSchedule"}, + Enum: []interface{}{"NoExecute", "NoSchedule", "PreferNoSchedule"}, }, }, "tolerationSeconds": { @@ -14371,6 +14664,11 @@ func schema_k8sio_api_core_v1_TopologySelectorLabelRequirement(ref common.Refere }, }, "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"}, @@ -14400,13 +14698,18 @@ func schema_k8sio_api_core_v1_TopologySelectorTerm(ref common.ReferenceCallback) Type: []string{"object"}, Properties: map[string]spec.Schema{ "matchLabelExpressions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "A list of topology selector requirements by labels.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.TopologySelectorLabelRequirement"), }, }, @@ -14422,8 +14725,7 @@ func schema_k8sio_api_core_v1_TopologySelectorTerm(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/api/core/v1.TopologySelectorLabelRequirement", - }, + "k8s.io/api/core/v1.TopologySelectorLabelRequirement"}, } } @@ -14456,7 +14758,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb Default: "", Type: []string{"string"}, Format: "", - Enum: []any{"DoNotSchedule", "ScheduleAnyway"}, + Enum: []interface{}{"DoNotSchedule", "ScheduleAnyway"}, }, }, "labelSelector": { @@ -14467,7 +14769,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, "minDomains": { SchemaProps: spec.SchemaProps{ - Description: "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.\n\nFor example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew.\n\nThis is a beta field and requires the MinDomainsInPodTopologySpread feature gate to be enabled (enabled by default).", + Description: "MinDomains indicates a minimum number of eligible domains. When the number of eligible domains with matching topology keys is less than minDomains, Pod Topology Spread treats \"global minimum\" as 0, and then the calculation of Skew is performed. And when the number of eligible domains with matching topology keys equals or greater than minDomains, this value has no effect on scheduling. As a result, when the number of eligible domains is less than minDomains, scheduler won't schedule more than maxSkew Pods to those domains. If value is nil, the constraint behaves as if MinDomains is equal to 1. Valid values are integers greater than 0. When value is not nil, WhenUnsatisfiable must be DoNotSchedule.\n\nFor example, in a 3-zone cluster, MaxSkew is set to 2, MinDomains is set to 5 and pods with the same labelSelector spread as 2/2/2: | zone1 | zone2 | zone3 | | P P | P P | P P | The number of domains is less than 5(MinDomains), so \"global minimum\" is treated as 0. In this situation, new pod with the same labelSelector cannot be scheduled, because computed skew will be 3(3 - 0) if new Pod is scheduled to any of the three zones, it will violate MaxSkew.", Type: []string{"integer"}, Format: "int32", }, @@ -14477,7 +14779,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb Description: "NodeAffinityPolicy indicates how we will treat Pod's nodeAffinity/nodeSelector when calculating pod topology spread skew. Options are: - Honor: only nodes matching nodeAffinity/nodeSelector are included in the calculations. - Ignore: nodeAffinity/nodeSelector are ignored. All nodes are included in the calculations.\n\nIf this value is nil, the behavior is equivalent to the Honor policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", Type: []string{"string"}, Format: "", - Enum: []any{"Honor", "Ignore"}, + Enum: []interface{}{"Honor", "Ignore"}, }, }, "nodeTaintsPolicy": { @@ -14485,7 +14787,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb Description: "NodeTaintsPolicy indicates how we will treat node taints when calculating pod topology spread skew. Options are: - Honor: nodes without taints, along with tainted nodes for which the incoming pod has a toleration, are included. - Ignore: node taints are ignored. All nodes are included.\n\nIf this value is nil, the behavior is equivalent to the Ignore policy. This is a beta-level feature default enabled by the NodeInclusionPolicyInPodTopologySpread feature flag.\n\nPossible enum values:\n - `\"Honor\"` means use this scheduling directive when calculating pod topology spread skew.\n - `\"Ignore\"` means ignore this scheduling directive when calculating pod topology spread skew.", Type: []string{"string"}, Format: "", - Enum: []any{"Honor", "Ignore"}, + Enum: []interface{}{"Honor", "Ignore"}, }, }, "matchLabelKeys": { @@ -14513,8 +14815,7 @@ func schema_k8sio_api_core_v1_TopologySpreadConstraint(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, } } @@ -14797,8 +15098,7 @@ func schema_k8sio_api_core_v1_Volume(ref common.ReferenceCallback) common.OpenAP }, }, 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", - }, + "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"}, } } @@ -14854,6 +15154,13 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O Format: "", }, }, + "recursiveReadOnly": { + SchemaProps: spec.SchemaProps{ + Description: "RecursiveReadOnly specifies whether read-only mounts should be handled recursively.\n\nIf ReadOnly is false, this field has no meaning and must be unspecified.\n\nIf ReadOnly is true, and this field is set to Disabled, the mount is not made recursively read-only. If this field is set to IfPossible, the mount is made recursively read-only, if it is supported by the container runtime. If this field is set to Enabled, the mount is made recursively read-only if it is supported by the container runtime, otherwise the pod will not be started and an error will be generated to indicate the reason.\n\nIf this field is set to IfPossible or Enabled, MountPropagation must be set to None (or be unspecified, which defaults to None).\n\nIf this field is not specified, it is treated as an equivalent of Disabled.", + Type: []string{"string"}, + Format: "", + }, + }, "mountPath": { SchemaProps: spec.SchemaProps{ Description: "Path within the container at which the volume should be mounted. Must not contain ':'.", @@ -14871,10 +15178,10 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O }, "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.\n\nPossible enum values:\n - `\"Bidirectional\"` means that the volume in a container will receive new mounts from the host or other containers, and its own mounts will be propagated from the container to the host or other containers. Note that this mode is recursively applied to all mounts in the volume (\"rshared\" in Linux terminology).\n - `\"HostToContainer\"` means that the volume in a container will receive new mounts from the host or other containers, but filesystems mounted inside the container won't be propagated to the host or other containers. Note that this mode is recursively applied to all mounts in the volume (\"rslave\" in Linux terminology).\n - `\"None\"` means that the volume in a container will not receive new mounts from the host or other containers, and filesystems mounted inside the container won't be propagated to the host or other containers. Note that this mode corresponds to \"private\" in Linux terminology.", + 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. When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified (which defaults to None).\n\nPossible enum values:\n - `\"Bidirectional\"` means that the volume in a container will receive new mounts from the host or other containers, and its own mounts will be propagated from the container to the host or other containers. Note that this mode is recursively applied to all mounts in the volume (\"rshared\" in Linux terminology).\n - `\"HostToContainer\"` means that the volume in a container will receive new mounts from the host or other containers, but filesystems mounted inside the container won't be propagated to the host or other containers. Note that this mode is recursively applied to all mounts in the volume (\"rslave\" in Linux terminology).\n - `\"None\"` means that the volume in a container will not receive new mounts from the host or other containers, and filesystems mounted inside the container won't be propagated to the host or other containers. Note that this mode corresponds to \"private\" in Linux terminology.", Type: []string{"string"}, Format: "", - Enum: []any{"Bidirectional", "HostToContainer", "None"}, + Enum: []interface{}{"Bidirectional", "HostToContainer", "None"}, }, }, "subPathExpr": { @@ -14891,6 +15198,50 @@ func schema_k8sio_api_core_v1_VolumeMount(ref common.ReferenceCallback) common.O } } +func schema_k8sio_api_core_v1_VolumeMountStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VolumeMountStatus shows status of volume mounts.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name corresponds to the name of the original VolumeMount.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "mountPath": { + SchemaProps: spec.SchemaProps{ + Description: "MountPath corresponds to the original VolumeMount.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "readOnly": { + SchemaProps: spec.SchemaProps{ + Description: "ReadOnly corresponds to the original VolumeMount.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "recursiveReadOnly": { + SchemaProps: spec.SchemaProps{ + Description: "RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, depending on the mount result.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "mountPath"}, + }, + }, + } +} + func schema_k8sio_api_core_v1_VolumeNodeAffinity(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -14908,8 +15259,7 @@ func schema_k8sio_api_core_v1_VolumeNodeAffinity(ref common.ReferenceCallback) c }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSelector", - }, + "k8s.io/api/core/v1.NodeSelector"}, } } @@ -14954,8 +15304,7 @@ func schema_k8sio_api_core_v1_VolumeProjection(ref common.ReferenceCallback) com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ClusterTrustBundleProjection", "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection", - }, + "k8s.io/api/core/v1.ClusterTrustBundleProjection", "k8s.io/api/core/v1.ConfigMapProjection", "k8s.io/api/core/v1.DownwardAPIProjection", "k8s.io/api/core/v1.SecretProjection", "k8s.io/api/core/v1.ServiceAccountTokenProjection"}, } } @@ -14974,8 +15323,7 @@ func schema_k8sio_api_core_v1_VolumeResourceRequirements(ref common.ReferenceCal Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -14989,8 +15337,7 @@ func schema_k8sio_api_core_v1_VolumeResourceRequirements(ref common.ReferenceCal Allows: true, Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), + Ref: ref("k8s.io/apimachinery/pkg/api/resource.Quantity"), }, }, }, @@ -15000,8 +15347,7 @@ func schema_k8sio_api_core_v1_VolumeResourceRequirements(ref common.ReferenceCal }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/api/resource.Quantity", - }, + "k8s.io/apimachinery/pkg/api/resource.Quantity"}, } } @@ -15190,8 +15536,7 @@ func schema_k8sio_api_core_v1_VolumeSource(ref common.ReferenceCallback) common. }, }, 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", - }, + "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"}, } } @@ -15256,7 +15601,7 @@ func schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref common.ReferenceCallba "podAffinityTerm": { SchemaProps: spec.SchemaProps{ Description: "Required. A pod affinity term, associated with the corresponding weight.", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/api/core/v1.PodAffinityTerm"), }, }, @@ -15265,8 +15610,7 @@ func schema_k8sio_api_core_v1_WeightedPodAffinityTerm(ref common.ReferenceCallba }, }, Dependencies: []string{ - "k8s.io/api/core/v1.PodAffinityTerm", - }, + "k8s.io/api/core/v1.PodAffinityTerm"}, } } @@ -15311,85 +15655,60 @@ func schema_k8sio_api_core_v1_WindowsSecurityContextOptions(ref common.Reference } } -func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_ExemptPriorityLevelConfiguration(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.", + Description: "ExemptPriorityLevelConfiguration describes the configurable aspects of the handling of exempt requests. In the mandatory exempt configuration object the values in the fields here can be modified by authorized users, unlike the rest of the `spec`.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "nominalConcurrencyShares": { 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: "", + Description: "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats nominally reserved for this priority level. This DOES NOT limit the dispatching from this priority level but affects the other priority levels through the borrowing mechanism. The server's concurrency limit (ServerCL) is divided among all the priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level. This field has a default value of zero.", + Type: []string{"integer"}, + Format: "int32", }, }, - "apiVersion": { + "lendablePercent": { 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: "", + Description: "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. This value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", + Type: []string{"integer"}, + Format: "int32", }, }, - "name": { + }, + }, + }, + } +} + +func schema_k8sio_api_flowcontrol_v1_FlowDistinguisherMethod(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FlowDistinguisherMethod specifies the method of a flow distinguisher.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { SchemaProps: spec.SchemaProps{ - Description: "name is the name of the group.", + Description: "`type` is the type of flow distinguisher method The supported types are \"ByUser\" and \"ByNamespace\". Required.", Default: "", 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{ - Default: map[string]any{}, - 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.", - Default: map[string]any{}, - 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{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), - }, - }, - }, - }, - }, }, - Required: []string{"name", "versions"}, + Required: []string{"type"}, }, }, - 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 { +func schema_k8sio_api_flowcontrol_v1_FlowSchema(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.", + Description: "FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \"flow distinguisher\".", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -15406,147 +15725,89 @@ func schema_pkg_apis_meta_v1_APIGroupList(ref common.ReferenceCallback) common.O Format: "", }, }, - "groups": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "groups is a list of APIGroup.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup"), - }, - }, - }, + Description: "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "`spec` is the specification of the desired behavior of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.FlowSchemaSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "`status` is the current status of a FlowSchema. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.FlowSchemaStatus"), }, }, }, - Required: []string{"groups"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIGroup", - }, + "k8s.io/api/flowcontrol/v1.FlowSchemaSpec", "k8s.io/api/flowcontrol/v1.FlowSchemaStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_meta_v1_APIResource(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_FlowSchemaCondition(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.", + Description: "FlowSchemaCondition describes conditions for a FlowSchema.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "name": { - SchemaProps: spec.SchemaProps{ - Description: "name is the plural name of the resource.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "singularName": { + "type": { SchemaProps: spec.SchemaProps{ - Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", - Default: "", + Description: "`type` is the type of the condition. Required.", Type: []string{"string"}, Format: "", }, }, - "namespaced": { - SchemaProps: spec.SchemaProps{ - Description: "namespaced indicates if a resource is namespaced or not.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "group": { + "status": { 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\".", + Description: "`status` is the status of the condition. Can be True, False, Unknown. Required.", Type: []string{"string"}, Format: "", }, }, - "version": { + "lastTransitionTime": { 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: "", + Description: "`lastTransitionTime` is the last time the condition transitioned from one status to another.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, - "kind": { + "reason": { SchemaProps: spec.SchemaProps{ - Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", - Default: "", + Description: "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", 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{ - Default: "", - 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{ - Default: "", - 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{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - "storageVersionHash": { + "message": { 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.", + Description: "`message` is a human-readable message indicating details about last transition.", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, }, }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } -func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_FlowSchemaList(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.", + Description: "FlowSchemaList is a list of FlowSchema objects.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -15563,244 +15824,253 @@ func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) commo Format: "", }, }, - "groupVersion": { + "metadata": { SchemaProps: spec.SchemaProps{ - Description: "groupVersion is the group and version this APIResourceList is for.", - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`metadata` is the standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, - "resources": { + "items": { SchemaProps: spec.SchemaProps{ - Description: "resources contains the name of the resources and if they are namespaced.", + Description: "`items` is a list of FlowSchemas.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.APIResource"), + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.FlowSchema"), }, }, }, }, }, }, - Required: []string{"groupVersion", "resources"}, + Required: []string{"items"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.APIResource", - }, + "k8s.io/api/flowcontrol/v1.FlowSchema", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_meta_v1_APIVersions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_FlowSchemaSpec(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.", + Description: "FlowSchemaSpec describes how the FlowSchema's specification looks like.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "priorityLevelConfiguration": { 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: "", + Description: "`priorityLevelConfiguration` should reference a PriorityLevelConfiguration in the cluster. If the reference cannot be resolved, the FlowSchema will be ignored and marked as invalid in its status. Required.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationReference"), }, }, - "apiVersion": { + "matchingPrecedence": { 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: "", + Description: "`matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. Note that if the precedence is not specified, it will be set to 1000 as default.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, - "versions": { + "distinguisherMethod": { SchemaProps: spec.SchemaProps{ - Description: "versions are the api versions that are available.", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, + Description: "`distinguisherMethod` defines how to compute the flow distinguisher for requests that match this schema. `nil` specifies that the distinguisher is disabled and thus will always be the empty string.", + Ref: ref("k8s.io/api/flowcontrol/v1.FlowDistinguisherMethod"), }, }, - "serverAddressByClientCIDRs": { + "rules": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ - Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", + Description: "`rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR"), + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.PolicyRulesWithSubjects"), }, }, }, }, }, }, - Required: []string{"versions", "serverAddressByClientCIDRs"}, + Required: []string{"priorityLevelConfiguration"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ServerAddressByClientCIDR", - }, + "k8s.io/api/flowcontrol/v1.FlowDistinguisherMethod", "k8s.io/api/flowcontrol/v1.PolicyRulesWithSubjects", "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationReference"}, } } -func schema_pkg_apis_meta_v1_ApplyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_FlowSchemaStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "ApplyOptions may be provided when applying an API object. FieldManager is required for apply requests. ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation that speaks specifically to how the options fields relate to apply.", + Description: "FlowSchemaStatus represents the current state of a FlowSchema.", 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: "", + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, }, - }, - "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", + Description: "`conditions` is a list of the current states of FlowSchema.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.FlowSchemaCondition"), }, }, }, }, }, - "force": { - SchemaProps: spec.SchemaProps{ - Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "fieldManager": { + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/flowcontrol/v1.FlowSchemaCondition"}, + } +} + +func schema_k8sio_api_flowcontrol_v1_GroupSubject(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupSubject holds detailed information for group-kind subject.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { 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.", + Description: "name is the user group that matches, or \"*\" to match all user groups. See https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go for some well-known group names. Required.", Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"force", "fieldManager"}, + Required: []string{"name"}, }, }, } } -func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_LimitResponse(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.", + Description: "LimitResponse defines how to handle requests that can not be executed right now.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "type": { SchemaProps: spec.SchemaProps{ - Description: "type of condition in CamelCase or in foo.example.com/CamelCase.", + Description: "`type` is \"Queue\" or \"Reject\". \"Queue\" means that requests that can not be executed upon arrival are held in a queue until they can be executed or a queuing limit is reached. \"Reject\" means that requests that can not be executed upon arrival are rejected. Required.", Default: "", Type: []string{"string"}, Format: "", }, }, - "status": { + "queuing": { SchemaProps: spec.SchemaProps{ - Description: "status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`queuing` holds the configuration parameters for queuing. This field may be non-empty only if `type` is `\"Queue\"`.", + Ref: ref("k8s.io/api/flowcontrol/v1.QueuingConfiguration"), }, }, - "observedGeneration": { + }, + Required: []string{"type"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "queuing": "Queuing", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/flowcontrol/v1.QueuingConfiguration"}, + } +} + +func schema_k8sio_api_flowcontrol_v1_LimitedPriorityLevelConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues:\n - How are requests for this priority level limited?\n - What should be done with requests that exceed the limit?", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nominalConcurrencyShares": { 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.", + Description: "`nominalConcurrencyShares` (NCS) contributes to the computation of the NominalConcurrencyLimit (NominalCL) of this level. This is the number of execution seats available at this priority level. This is used both for requests dispatched from this priority level as well as requests dispatched from other priority levels borrowing seats from this level. The server's concurrency limit (ServerCL) is divided among the Limited priority levels in proportion to their NCS values:\n\nNominalCL(i) = ceil( ServerCL * NCS(i) / sum_ncs ) sum_ncs = sum[priority level k] NCS(k)\n\nBigger numbers mean a larger nominal concurrency limit, at the expense of every other priority level.\n\nIf not specified, this field defaults to a value of 30.\n\nSetting this field to zero supports the construction of a \"jail\" for this priority level that is used to hold some request(s)", Type: []string{"integer"}, - Format: "int64", + Format: "int32", }, }, - "lastTransitionTime": { + "limitResponse": { 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.", - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + Description: "`limitResponse` indicates what to do with requests that can not be executed right now", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.LimitResponse"), }, }, - "reason": { + "lendablePercent": { SchemaProps: spec.SchemaProps{ - Description: "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.", - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`lendablePercent` prescribes the fraction of the level's NominalCL that can be borrowed by other priority levels. The value of this field must be between 0 and 100, inclusive, and it defaults to 0. The number of seats that other levels can borrow from this level, known as this level's LendableConcurrencyLimit (LendableCL), is defined as follows.\n\nLendableCL(i) = round( NominalCL(i) * lendablePercent(i)/100.0 )", + Type: []string{"integer"}, + Format: "int32", }, }, - "message": { + "borrowingLimitPercent": { SchemaProps: spec.SchemaProps{ - Description: "message is a human readable message indicating details about the transition. This may be an empty string.", - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`borrowingLimitPercent`, if present, configures a limit on how many seats this priority level can borrow from other priority levels. The limit is known as this level's BorrowingConcurrencyLimit (BorrowingCL) and is a limit on the total number of seats that this level may borrow at any one time. This field holds the ratio of that limit to the level's nominal concurrency limit. When this field is non-nil, it must hold a non-negative integer and the limit is calculated as follows.\n\nBorrowingCL(i) = round( NominalCL(i) * borrowingLimitPercent(i)/100.0 )\n\nThe value of this field can be more than 100, implying that this priority level can borrow a number of seats that is greater than its own nominal concurrency limit (NominalCL). When this field is left `nil`, the limit is effectively infinite.", + Type: []string{"integer"}, + Format: "int32", }, }, }, - Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/api/flowcontrol/v1.LimitResponse"}, } } -func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_NonResourcePolicyRule(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "CreateOptions may be provided when creating an API object.", + Description: "NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the 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: "", + "verbs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, }, - }, - "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", + Description: "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs. If it is present, it must be the only entry. Required.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ @@ -15813,126 +16083,111 @@ func schema_pkg_apis_meta_v1_CreateOptions(ref common.ReferenceCallback) common. }, }, }, - "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: "", + "nonResourceURLs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, }, - }, - "fieldValidation": { SchemaProps: spec.SchemaProps{ - Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", - Type: []string{"string"}, - Format: "", + Description: "`nonResourceURLs` is a set of url prefixes that a user should have access to and may not be empty. For example:\n - \"/healthz\" is legal\n - \"/hea*\" is illegal\n - \"/hea\" is legal but matches nothing\n - \"/hea/*\" also matches nothing\n - \"/healthz/*\" matches all per-component health checks.\n\"*\" matches all non-resource urls. if it is present, it must be the only entry. Required.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, }, }, }, + Required: []string{"verbs", "nonResourceURLs"}, }, }, } } -func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PolicyRulesWithSubjects(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "DeleteOptions may be provided when deleting an API object.", + Description: "PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the 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: "", + "subjects": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "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", + Description: "subjects is the list of normal user, serviceaccount, or group that this rule cares about. There must be at least one member in this slice. A slice that includes both the system:authenticated and system:unauthenticated user groups matches every request. Required.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.Subject"), + }, + }, + }, }, }, - "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"), + "resourceRules": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "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: "", + Description: "`resourceRules` is a slice of ResourcePolicyRules that identify matching requests according to their verb and the target resource. At least one of `resourceRules` and `nonResourceRules` has to be non-empty.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.ResourcePolicyRule"), + }, + }, + }, }, }, - "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: "", + "nonResourceRules": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "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", + Description: "`nonResourceRules` is a list of NonResourcePolicyRules that identify matching requests according to their verb and the target non-resource URL.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.NonResourcePolicyRule"), }, }, }, }, }, }, + Required: []string{"subjects"}, }, }, 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_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"}, - }, - }, + "k8s.io/api/flowcontrol/v1.NonResourcePolicyRule", "k8s.io/api/flowcontrol/v1.ResourcePolicyRule", "k8s.io/api/flowcontrol/v1.Subject"}, } } -func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PriorityLevelConfiguration(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.", + Description: "PriorityLevelConfiguration represents the configuration of a priority level.", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { @@ -15949,246 +16204,299 @@ func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.Ope Format: "", }, }, - "resourceVersion": { + "metadata": { 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: "", + Description: "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, - }, - }, - }, - } -} - -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": { + "spec": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`spec` is the specification of the desired behavior of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationSpec"), }, }, - "kind": { + "status": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`status` is the current status of a \"request-priority\". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationStatus"), }, }, }, - Required: []string{"group", "kind"}, }, }, + Dependencies: []string{ + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationSpec", "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } -func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationCondition(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", + Description: "PriorityLevelConfigurationCondition defines the condition of priority level.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "group": { + "type": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`type` is the type of the condition. Required.", + Type: []string{"string"}, + Format: "", }, }, - "resource": { + "status": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`status` is the status of the condition. Can be True, False, Unknown. Required.", + Type: []string{"string"}, + Format: "", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "`lastTransitionTime` is 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: "`reason` is a unique, one-word, CamelCase reason for the condition's last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "`message` is a human-readable message indicating details about last transition.", + Type: []string{"string"}, + Format: "", }, }, }, - Required: []string{"group", "resource"}, }, }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } -func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationList(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.", + Description: "PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "group": { + "kind": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + 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: "", }, }, - "version": { + "apiVersion": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + 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: "`metadata` is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "`items` is a list of request-priorities.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.PriorityLevelConfiguration"), + }, + }, + }, }, }, }, - Required: []string{"group", "version"}, + Required: []string{"items"}, }, }, + Dependencies: []string{ + "k8s.io/api/flowcontrol/v1.PriorityLevelConfiguration", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, } } -func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationReference(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.", + Description: "PriorityLevelConfigurationReference contains information that points to the \"request-priority\" being used.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "groupVersion": { - SchemaProps: spec.SchemaProps{ - Description: "groupVersion specifies the API group and version in the form \"group/version\"", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { + "name": { 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.", + Description: "`name` is the name of the priority level configuration being referenced Required.", Default: "", Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"groupVersion", "version"}, + Required: []string{"name"}, }, }, } } -func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", + Description: "PriorityLevelConfigurationSpec specifies the configuration of a priority level.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "group": { + "type": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`type` indicates whether this priority level is subject to limitation on request execution. A value of `\"Exempt\"` means that requests of this priority level are not subject to a limit (and thus are never queued) and do not detract from the capacity made available to other priority levels. A value of `\"Limited\"` means that (a) requests of this priority level _are_ subject to limits and (b) some of the server's limited capacity is made available exclusively to this priority level. Required.", + Default: "", + Type: []string{"string"}, + Format: "", }, }, - "version": { + "limited": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`limited` specifies how requests are handled for a Limited priority level. This field must be non-empty if and only if `type` is `\"Limited\"`.", + Ref: ref("k8s.io/api/flowcontrol/v1.LimitedPriorityLevelConfiguration"), }, }, - "kind": { + "exempt": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`exempt` specifies how requests are handled for an exempt priority level. This field MUST be empty if `type` is `\"Limited\"`. This field MAY be non-empty if `type` is `\"Exempt\"`. If empty and `type` is `\"Exempt\"` then the default values for `ExemptPriorityLevelConfiguration` apply.", + Ref: ref("k8s.io/api/flowcontrol/v1.ExemptPriorityLevelConfiguration"), }, }, }, - Required: []string{"group", "version", "kind"}, + Required: []string{"type"}, }, - }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "type", + "fields-to-discriminateBy": map[string]interface{}{ + "exempt": "Exempt", + "limited": "Limited", + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/flowcontrol/v1.ExemptPriorityLevelConfiguration", "k8s.io/api/flowcontrol/v1.LimitedPriorityLevelConfiguration"}, } } -func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_PriorityLevelConfigurationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", + Description: "PriorityLevelConfigurationStatus represents the current state of a \"request-priority\".", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "group": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, }, - }, - "resource": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`conditions` is the current state of \"request-priority\".", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationCondition"), + }, + }, + }, }, }, }, - Required: []string{"group", "version", "resource"}, }, }, + Dependencies: []string{ + "k8s.io/api/flowcontrol/v1.PriorityLevelConfigurationCondition"}, } } -func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_QueuingConfiguration(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "InternalEvent makes watch.Event versioned", + Description: "QueuingConfiguration holds the configuration parameters for queuing", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "Type": { + "queues": { SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", + Description: "`queues` is the number of queues for this priority level. The queues exist independently at each apiserver. The value must be positive. Setting it to 1 effectively precludes shufflesharding and thus makes the distinguisher method of associated flow schemas irrelevant. This field has a default value of 64.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, - "Object": { + "handSize": { 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"), + Description: "`handSize` is a small positive number that configures the shuffle sharding of requests into queues. When enqueuing a request at this priority level the request's flow identifier (a string pair) is hashed and the hash value is used to shuffle the list of queues and deal a hand of the size specified here. The request is put into one of the shortest queues in that hand. `handSize` must be no larger than `queues`, and should be significantly smaller (so that a few heavy flows do not saturate most of the queues). See the user-facing documentation for more extensive guidance on setting this field. This field has a default value of 8.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "queueLengthLimit": { + SchemaProps: spec.SchemaProps{ + Description: "`queueLengthLimit` is the maximum number of requests allowed to be waiting in a given queue of this priority level at a time; excess requests are rejected. This value must be positive. If not specified, it will be defaulted to 50.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", }, }, }, - Required: []string{"Type", "Object"}, }, }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.Object", - }, } } -func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_ResourcePolicyRule(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.", + Description: "ResourcePolicyRule is a predicate that matches some resource requests, testing the request's verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) either (d1) the request does not specify a namespace (i.e., `Namespace==\"\"`) and clusterScope is true or (d2) the request specifies a namespace and least one member of namespaces matches the request's namespace.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "matchLabels": { + "verbs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, 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, + Description: "`verbs` is a list of matching verbs and may not be empty. \"*\" matches all verbs and, if present, must be the only entry. Required.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: "", @@ -16199,194 +16507,2796 @@ func schema_pkg_apis_meta_v1_LabelSelector(ref common.ReferenceCallback) common. }, }, }, - "matchExpressions": { + "apiGroups": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, SchemaProps: spec.SchemaProps{ - Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", + Description: "`apiGroups` is a list of matching API groups and may not be empty. \"*\" matches all API groups and, if present, must be the only entry. Required.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "resources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "`resources` is a list of matching resources (i.e., lowercase and plural) with, if desired, subresource. For example, [ \"services\", \"nodes/status\" ]. This list may not be empty. \"*\" matches all resources and, if present, must be the only entry. Required.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "clusterScope": { + SchemaProps: spec.SchemaProps{ + Description: "`clusterScope` indicates whether to match requests that do not specify a namespace (which happens either because the resource is not namespaced or the request targets all namespaces). If this field is omitted or false then the `namespaces` field must contain a non-empty list.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "namespaces": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "`namespaces` is a list of target namespaces that restricts matches. A request that specifies a target namespace matches only if either (a) this list contains that target namespace or (b) this list contains \"*\". Note that \"*\" matches any specified namespace but does not match a request that _does not specify_ a namespace (see the `clusterScope` field for that). This list may be empty, but only if `clusterScope` is true.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", }, }, }, }, }, }, + Required: []string{"verbs", "apiGroups", "resources"}, }, - VendorExtensible: spec.VendorExtensible{ - Extensions: spec.Extensions{ - "x-kubernetes-map-type": "atomic", - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement", }, } } -func schema_pkg_apis_meta_v1_LabelSelectorRequirement(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_ServiceAccountSubject(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.", + Description: "ServiceAccountSubject holds detailed information for service-account-kind subject.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "key": { + "namespace": { SchemaProps: spec.SchemaProps{ - Description: "key is the label key that the selector applies to.", + Description: "`namespace` is the namespace of matching ServiceAccount objects. Required.", Default: "", Type: []string{"string"}, Format: "", }, }, - "operator": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", + Description: "`name` is the name of matching ServiceAccount objects, or \"*\" to match regardless of name. Required.", Default: "", 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{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, }, - Required: []string{"key", "operator"}, + Required: []string{"namespace", "name"}, }, }, } } -func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_Subject(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.", + Description: "Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account.", 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", + Description: "`kind` indicates which one of the other fields is non-empty. Required", + Default: "", Type: []string{"string"}, Format: "", }, }, - "apiVersion": { + "user": { 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: "", + Description: "`user` matches based on username.", + Ref: ref("k8s.io/api/flowcontrol/v1.UserSubject"), }, }, - "metadata": { + "group": { SchemaProps: spec.SchemaProps{ - Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + Description: "`group` matches based on user group name.", + Ref: ref("k8s.io/api/flowcontrol/v1.GroupSubject"), }, }, - "items": { + "serviceAccount": { SchemaProps: spec.SchemaProps{ - Description: "List of objects", - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, - Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), - }, - }, + Description: "`serviceAccount` matches ServiceAccounts.", + Ref: ref("k8s.io/api/flowcontrol/v1.ServiceAccountSubject"), + }, + }, + }, + Required: []string{"kind"}, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-unions": []interface{}{ + map[string]interface{}{ + "discriminator": "kind", + "fields-to-discriminateBy": map[string]interface{}{ + "group": "Group", + "serviceAccount": "ServiceAccount", + "user": "User", }, }, }, }, - Required: []string{"items"}, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/runtime.RawExtension", - }, + "k8s.io/api/flowcontrol/v1.GroupSubject", "k8s.io/api/flowcontrol/v1.ServiceAccountSubject", "k8s.io/api/flowcontrol/v1.UserSubject"}, } } -func schema_pkg_apis_meta_v1_ListMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_k8sio_api_flowcontrol_v1_UserSubject(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}.", + Description: "UserSubject holds detailed information for user-kind subject.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "selfLink": { + "name": { SchemaProps: spec.SchemaProps{ - Description: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", + Description: "`name` is the username that matches, or \"*\" to match all usernames. Required.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "resourceVersion": { + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_ConversionRequest(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ConversionRequest describes the conversion request parameters.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "uid": { 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", + Description: "uid is an identifier for the individual request/response. It allows distinguishing instances of requests which are otherwise identical (parallel requests, etc). The UID is meant to track the round trip (request/response) between the Kubernetes API server and the webhook, not the user request. It is suitable for correlating log entries between the webhook and apiserver, for either auditing or debugging.", + Default: "", Type: []string{"string"}, Format: "", }, }, - "continue": { + "desiredAPIVersion": { 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.", + Description: "desiredAPIVersion is the version to convert given objects to. e.g. \"myapi.example.com/v1\"", + Default: "", Type: []string{"string"}, Format: "", }, }, - "remainingItemCount": { + "objects": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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", + Description: "objects is the list of custom resource objects to be converted.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, }, }, }, + Required: []string{"uid", "desiredAPIVersion", "objects"}, }, }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } -func schema_pkg_apis_meta_v1_ListOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_pkg_apis_apiextensions_v1_ConversionResponse(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.", + Description: "ConversionResponse describes a conversion response.", Type: []string{"object"}, Properties: map[string]spec.Schema{ - "kind": { + "uid": { 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", + Description: "uid is an identifier for the individual request/response. This should be copied over from the corresponding `request.uid`.", + Default: "", 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: "", + "convertedObjects": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, }, - }, - "labelSelector": { + SchemaProps: spec.SchemaProps{ + Description: "convertedObjects is the list of converted version of `request.objects` if the `result` is successful, otherwise empty. The webhook is expected to set `apiVersion` of these objects to the `request.desiredAPIVersion`. The list must also have the same size as the input list with the same objects in the same order (equal kind, metadata.uid, metadata.name and metadata.namespace). The webhook is allowed to mutate labels and annotations. Any other change to the metadata is silently ignored.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), + }, + }, + }, + }, + }, + "result": { + SchemaProps: spec.SchemaProps{ + Description: "result contains the result of conversion with extra details if the conversion failed. `result.status` determines if the conversion failed or succeeded. The `result.status` field is required and represents the success or failure of the conversion. A successful conversion must set `result.status` to `Success`. A failed conversion must set `result.status` to `Failure` and provide more details in `result.message` and return http status 200. The `result.message` will be used to construct an error message for the end user.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Status"), + }, + }, + }, + Required: []string{"uid", "convertedObjects", "result"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Status", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, + } +} + +func schema_pkg_apis_apiextensions_v1_ConversionReview(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ConversionReview describes a conversion request/response.", + 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: "", + }, + }, + "request": { + SchemaProps: spec.SchemaProps{ + Description: "request describes the attributes for the conversion request.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionRequest"), + }, + }, + "response": { + SchemaProps: spec.SchemaProps{ + Description: "response describes the attributes for the conversion response.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionResponse"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionRequest", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ConversionResponse"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceColumnDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceColumnDefinition specifies a column for server side printing.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is a human readable name for the column.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "format": { + SchemaProps: spec.SchemaProps{ + Description: "format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column 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 details.", + 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 priority greater than 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "jsonPath": { + SchemaProps: spec.SchemaProps{ + Description: "jsonPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "type", "jsonPath"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceConversion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceConversion describes how to convert different versions of a CR.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "strategy": { + SchemaProps: spec.SchemaProps{ + Description: "strategy specifies how custom resources are converted between versions. Allowed values are: - `\"None\"`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `\"Webhook\"`: API Server will call to an external webhook to do the conversion. Additional information\n is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhook to be set.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "webhook": { + SchemaProps: spec.SchemaProps{ + Description: "webhook describes how to call the conversion webhook. Required when `strategy` is set to `\"Webhook\"`.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.WebhookConversion"), + }, + }, + }, + Required: []string{"strategy"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.WebhookConversion"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.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: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec describes how the user wants the resources to appear", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status indicates the actual state of the CustomResourceDefinition", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionSpec", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionStatus", "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinitionCondition 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. Types include Established, NamesAccepted and Terminating.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the status of the condition. Can be True, False, Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastTransitionTime 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: "reason is a unique, one-word, CamelCase reason for the condition's last transition.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message is a 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_pkg_apis_apiextensions_v1_CustomResourceDefinitionList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinitionList is a list of CustomResourceDefinition 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 object's metadata More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items list individual CustomResourceDefinition objects", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinition"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionNames(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "plural": { + SchemaProps: spec.SchemaProps{ + Description: "plural is the plural name of the resource to serve. The custom resources are served under `/apis///.../`. Must match the name of the CustomResourceDefinition (in the form `.`). Must be all lowercase.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "singular": { + SchemaProps: spec.SchemaProps{ + Description: "singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.", + Type: []string{"string"}, + Format: "", + }, + }, + "shortNames": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get `. It must be all lowercase.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "listKind": { + SchemaProps: spec.SchemaProps{ + Description: "listKind is the serialized kind of the list for this resource. Defaults to \"`kind`List\".", + Type: []string{"string"}, + Format: "", + }, + }, + "categories": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"plural", "kind"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinitionSpec describes how a user wants their resource to appear", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Description: "group is the API group of the defined custom resource. The custom resources are served under `/apis//...`. Must match the name of the CustomResourceDefinition (in the form `.`).", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "names": { + SchemaProps: spec.SchemaProps{ + Description: "names specify the resource and kind names for the custom resource.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionNames"), + }, + }, + "scope": { + SchemaProps: spec.SchemaProps{ + Description: "scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "versions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "versions is the list of all API versions of the defined custom resource. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionVersion"), + }, + }, + }, + }, + }, + "conversion": { + SchemaProps: spec.SchemaProps{ + Description: "conversion defines conversion settings for the CRD.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceConversion"), + }, + }, + "preserveUnknownFields": { + SchemaProps: spec.SchemaProps{ + Description: "preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. This field is deprecated in favor of setting `x-preserve-unknown-fields` to true in `spec.versions[*].schema.openAPIV3Schema`. See https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#field-pruning for details.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"group", "names", "scope", "versions"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceConversion", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionNames", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionVersion"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions indicate state for particular aspects of a CustomResourceDefinition", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionCondition"), + }, + }, + }, + }, + }, + "acceptedNames": { + SchemaProps: spec.SchemaProps{ + Description: "acceptedNames are the names that are actually being used to serve discovery. They may be different than the names in spec.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionNames"), + }, + }, + "storedVersions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "storedVersions lists all versions of CustomResources that were ever persisted. Tracking these versions allows a migration path for stored versions in etcd. The field is mutable so a migration controller can finish a migration to another version (ensuring no old objects are left in storage), and then remove the rest of the versions from this list. Versions may not be removed from `spec.versions` while they exist in this list.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionCondition", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceDefinitionNames"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceDefinitionVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceDefinitionVersion describes a version for CRD.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the version name, e.g. “v1”, “v2beta1”, etc. The custom resources are served under this version at `/apis///...` if `served` is true.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "served": { + SchemaProps: spec.SchemaProps{ + Description: "served is a flag enabling/disabling this version from being served via REST APIs", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "storage": { + SchemaProps: spec.SchemaProps{ + Description: "storage indicates this version should be used when persisting custom resources to storage. There must be exactly one version with storage=true.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "deprecationWarning": { + SchemaProps: spec.SchemaProps{ + Description: "deprecationWarning overrides the default warning returned to API clients. May only be set when `deprecated` is true. The default warning indicates this version is deprecated and recommends use of the newest served version of equal or greater stability, if one exists.", + Type: []string{"string"}, + Format: "", + }, + }, + "schema": { + SchemaProps: spec.SchemaProps{ + Description: "schema describes the schema used for validation, pruning, and defaulting of this version of the custom resource.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceValidation"), + }, + }, + "subresources": { + SchemaProps: spec.SchemaProps{ + Description: "subresources specify what subresources this version of the defined custom resource have.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresources"), + }, + }, + "additionalPrinterColumns": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If no columns are specified, a single column displaying the age of the custom resource is used.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceColumnDefinition"), + }, + }, + }, + }, + }, + "selectableFields": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "selectableFields specifies paths to fields that may be used as field selectors. A maximum of 8 selectable fields are allowed. See https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.SelectableField"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "served", "storage"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceColumnDefinition", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresources", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceValidation", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.SelectableField"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceSubresourceScale(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "specReplicasPath": { + SchemaProps: spec.SchemaProps{ + Description: "specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.spec`. If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "statusReplicasPath": { + SchemaProps: spec.SchemaProps{ + Description: "statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status`. If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource will default to 0.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "labelSelectorPath": { + SchemaProps: spec.SchemaProps{ + Description: "labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status` or `.spec`. Must be set to work with HorizontalPodAutoscaler. The field pointed by this JSON path must be a string field (not a complex selector struct) which contains a serialized label selector in string form. More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` subresource will default to the empty string.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"specReplicasPath", "statusReplicasPath"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceSubresourceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceSubresourceStatus defines how to serve the status subresource for CustomResources. Status is represented by the `.status` JSON path inside of a CustomResource. When set, * exposes a /status subresource for the custom resource * PUT requests to the /status subresource take a custom resource object, and ignore changes to anything except the status stanza * PUT/POST/PATCH requests to the custom resource ignore changes to the status stanza", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceSubresources(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceSubresources defines the status and scale subresources for CustomResources.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status indicates the custom resource should serve a `/status` subresource. When enabled: 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresourceStatus"), + }, + }, + "scale": { + SchemaProps: spec.SchemaProps{ + Description: "scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresourceScale"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresourceScale", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.CustomResourceSubresourceStatus"}, + } +} + +func schema_pkg_apis_apiextensions_v1_CustomResourceValidation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "CustomResourceValidation is a list of validation methods for CustomResources.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "openAPIV3Schema": { + SchemaProps: spec.SchemaProps{ + Description: "openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"}, + } +} + +func schema_pkg_apis_apiextensions_v1_ExternalDocumentation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ExternalDocumentation allows referencing an external resource for extended documentation.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "description": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "url": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_JSON(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSON represents any valid JSON value. These types are supported: bool, int64, float64, string, []interface{}, map[string]interface{} and nil.", + Type: v1.JSON{}.OpenAPISchemaType(), + Format: v1.JSON{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_JSONSchemaProps(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "id": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "$schema": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "$ref": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "format": { + SchemaProps: spec.SchemaProps{ + Description: "format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated:\n\n- bsonobjectid: a bson object ID, i.e. a 24 characters hex string - uri: an URI as parsed by Golang net/url.ParseRequestURI - email: an email address as parsed by Golang net/mail.ParseAddress - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - cidr: a CIDR as parsed by Golang net.ParseCIDR - mac: a MAC address as parsed by Golang net.ParseMAC - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - isbn: an ISBN10 or ISBN13 number string like \"0321751043\" or \"978-0321751041\" - isbn10: an ISBN10 number string like \"0321751043\" - isbn13: an ISBN13 number string like \"978-0321751041\" - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$ with any non digit characters mixed in - ssn: a U.S. social security number following the regex ^\\d{3}[- ]?\\d{2}[- ]?\\d{4}$ - hexcolor: an hexadecimal color code like \"#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - rgbcolor: an RGB color code like rgb like \"rgb(255,255,2559\" - byte: base64 encoded binary data - password: any kind of string - date: a date string like \"2006-01-02\" as defined by full-date in RFC3339 - duration: a duration string like \"22 ns\" as parsed by Golang time.ParseDuration or compatible with Scala duration format - datetime: a date time string like \"2014-12-15T19:30:20.000Z\" as defined by date-time in RFC3339.", + Type: []string{"string"}, + Format: "", + }, + }, + "title": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "default": { + SchemaProps: spec.SchemaProps{ + Description: "default is a default value for undefined object fields. Defaulting is a beta feature under the CustomResourceDefaulting feature gate. Defaulting requires spec.preserveUnknownFields to be false.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + "maximum": { + SchemaProps: spec.SchemaProps{ + Type: []string{"number"}, + Format: "double", + }, + }, + "exclusiveMaximum": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "minimum": { + SchemaProps: spec.SchemaProps{ + Type: []string{"number"}, + Format: "double", + }, + }, + "exclusiveMinimum": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "maxLength": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minLength": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "pattern": { + SchemaProps: spec.SchemaProps{ + Type: []string{"string"}, + Format: "", + }, + }, + "maxItems": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minItems": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "uniqueItems": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "multipleOf": { + SchemaProps: spec.SchemaProps{ + Type: []string{"number"}, + Format: "double", + }, + }, + "enum": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + }, + }, + }, + "maxProperties": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minProperties": { + SchemaProps: spec.SchemaProps{ + Type: []string{"integer"}, + Format: "int64", + }, + }, + "required": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrArray"), + }, + }, + "allOf": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + "oneOf": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + "anyOf": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + "not": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + "properties": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + "additionalProperties": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrBool"), + }, + }, + "patternProperties": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + "dependencies": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrStringArray"), + }, + }, + }, + }, + }, + "additionalItems": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrBool"), + }, + }, + "definitions": { + SchemaProps: spec.SchemaProps{ + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps"), + }, + }, + }, + }, + }, + "externalDocs": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ExternalDocumentation"), + }, + }, + "example": { + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + "nullable": { + SchemaProps: spec.SchemaProps{ + Type: []string{"boolean"}, + Format: "", + }, + }, + "x-kubernetes-preserve-unknown-fields": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-preserve-unknown-fields stops the API server decoding step from pruning fields which are not specified in the validation schema. This affects fields recursively, but switches back to normal pruning behaviour if nested properties or additionalProperties are specified in the schema. This can either be true or undefined. False is forbidden.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "x-kubernetes-embedded-resource": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-embedded-resource defines that the value is an embedded Kubernetes runtime.Object, with TypeMeta and ObjectMeta. The type must be object. It is allowed to further restrict the embedded object. kind, apiVersion and metadata are validated automatically. x-kubernetes-preserve-unknown-fields is allowed to be true, but does not have to be if the object is fully specified (up to kind, apiVersion, metadata).", + Type: []string{"boolean"}, + Format: "", + }, + }, + "x-kubernetes-int-or-string": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-int-or-string specifies that this value is either an integer or a string. If this is true, an empty type is allowed and type as child of anyOf is permitted if following one of the following patterns:\n\n1) anyOf:\n - type: integer\n - type: string\n2) allOf:\n - anyOf:\n - type: integer\n - type: string\n - ... zero or more", + Type: []string{"boolean"}, + Format: "", + }, + }, + "x-kubernetes-list-map-keys": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type `map` by specifying the keys used as the index of the map.\n\nThis tag MUST only be used on lists that have the \"x-kubernetes-list-type\" extension set to \"map\". Also, the values specified for this attribute must be a scalar typed field of the child structure (no nesting is supported).\n\nThe properties specified must either be required or have a default value, to ensure those properties are present for all list items.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "x-kubernetes-list-type": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-list-type annotates an array to further describe its topology. This extension must only be used on lists and may have 3 possible values:\n\n1) `atomic`: the list is treated as a single entity, like a scalar.\n Atomic lists will be entirely replaced when updated. This extension\n may be used on any type of list (struct, scalar, ...).\n2) `set`:\n Sets are lists that must not have multiple items with the same value. Each\n value must be a scalar, an object with x-kubernetes-map-type `atomic` or an\n array with x-kubernetes-list-type `atomic`.\n3) `map`:\n These lists are like maps in that their elements have a non-index key\n used to identify them. Order is preserved upon merge. The map tag\n must only be used on a list with elements of type object.\nDefaults to atomic for arrays.", + Type: []string{"string"}, + Format: "", + }, + }, + "x-kubernetes-map-type": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-map-type annotates an object to further describe its topology. This extension must only be used when type is object and may have 2 possible values:\n\n1) `granular`:\n These maps are actual maps (key-value pairs) and each fields are independent\n from each other (they can each be manipulated by separate actors). This is\n the default behaviour for all maps.\n2) `atomic`: the list is treated as a single entity, like a scalar.\n Atomic maps will be entirely replaced when updated.", + Type: []string{"string"}, + Format: "", + }, + }, + "x-kubernetes-validations": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "rule", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "rule", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-validations describes a list of validation rules written in the CEL expression language. This field is an alpha-level. Using this field requires the feature gate `CustomResourceValidationExpressions` to be enabled.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ValidationRule"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ExternalDocumentation", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaProps", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrArray", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrBool", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSONSchemaPropsOrStringArray", "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ValidationRule"}, + } +} + +func schema_pkg_apis_apiextensions_v1_JSONSchemaPropsOrArray(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes.", + Type: v1.JSONSchemaPropsOrArray{}.OpenAPISchemaType(), + Format: v1.JSONSchemaPropsOrArray{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_JSONSchemaPropsOrBool(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONSchemaPropsOrBool represents JSONSchemaProps or a boolean value. Defaults to true for the boolean property.", + Type: v1.JSONSchemaPropsOrBool{}.OpenAPISchemaType(), + Format: v1.JSONSchemaPropsOrBool{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_JSONSchemaPropsOrStringArray(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONSchemaPropsOrStringArray represents a JSONSchemaProps or a string array.", + Type: v1.JSONSchemaPropsOrStringArray{}.OpenAPISchemaType(), + Format: v1.JSONSchemaPropsOrStringArray{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_SelectableField(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "SelectableField specifies the JSON path of a field that may be used with field selectors.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "jsonPath": { + SchemaProps: spec.SchemaProps{ + Description: "jsonPath is a simple JSON path which is evaluated against each custom resource to produce a field selector value. Only JSON paths without the array notation are allowed. Must point to a field of type string, boolean or integer. Types with enum values and strings with formats are allowed. If jsonPath refers to absent field in a resource, the jsonPath evaluates to an empty string. Must not point to metdata fields. Required.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"jsonPath"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_ServiceReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceReference holds a reference to Service.legacy.k8s.io", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "namespace is the namespace of the service. Required", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the service. Required", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "path is an optional URL path at which the webhook will be contacted.", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "port is an optional service port at which the webhook will be contacted. `port` should be a valid port number (1-65535, inclusive). Defaults to 443 for backward compatibility.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"namespace", "name"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_ValidationRule(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ValidationRule describes a validation rule written in the CEL expression language.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "rule": { + SchemaProps: spec.SchemaProps{ + Description: "Rule represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec The Rule is scoped to the location of the x-kubernetes-validations extension in the schema. The `self` variable in the CEL expression is bound to the scoped value. Example: - Rule scoped to the root of a resource with a status subresource: {\"rule\": \"self.status.actual <= self.spec.maxDesired\"}\n\nIf the Rule is scoped to an object with properties, the accessible properties of the object are field selectable via `self.field` and field presence can be checked via `has(self.field)`. Null valued fields are treated as absent fields in CEL expressions. If the Rule is scoped to an object with additionalProperties (i.e. a map) the value of the map are accessible via `self[mapKey]`, map containment can be checked via `mapKey in self` and all entries of the map are accessible via CEL macros and functions such as `self.all(...)`. If the Rule is scoped to an array, the elements of the array are accessible via `self[i]` and also by macros and functions. If the Rule is scoped to a scalar, `self` is bound to the scalar value. Examples: - Rule scoped to a map of objects: {\"rule\": \"self.components['Widget'].priority < 10\"} - Rule scoped to a list of integers: {\"rule\": \"self.values.all(value, value >= 0 && value < 100)\"} - Rule scoped to a string value: {\"rule\": \"self.startsWith('kube')\"}\n\nThe `apiVersion`, `kind`, `metadata.name` and `metadata.generateName` are always accessible from the root of the object and from any x-kubernetes-embedded-resource annotated objects. No other metadata properties are accessible.\n\nUnknown data preserved in custom resources via x-kubernetes-preserve-unknown-fields is not accessible in CEL expressions. This includes: - Unknown field values that are preserved by object schemas with x-kubernetes-preserve-unknown-fields. - Object properties where the property schema is of an \"unknown type\". An \"unknown type\" is recursively defined as:\n - A schema with no type and x-kubernetes-preserve-unknown-fields set to true\n - An array where the items schema is of an \"unknown type\"\n - An object where the additionalProperties schema is of an \"unknown type\"\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Accessible property names are escaped according to the following rules when accessed in the expression: - '__' escapes to '__underscores__' - '.' escapes to '__dot__' - '-' escapes to '__dash__' - '/' escapes to '__slash__' - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:\n\t \"true\", \"false\", \"null\", \"in\", \"as\", \"break\", \"const\", \"continue\", \"else\", \"for\", \"function\", \"if\",\n\t \"import\", \"let\", \"loop\", \"package\", \"namespace\", \"return\".\nExamples:\n - Rule accessing a property named \"namespace\": {\"rule\": \"self.__namespace__ > 0\"}\n - Rule accessing a property named \"x-prop\": {\"rule\": \"self.x__dash__prop > 0\"}\n - Rule accessing a property named \"redact__d\": {\"rule\": \"self.redact__underscores__d > 0\"}\n\nEquality on arrays with x-kubernetes-list-type of 'set' or 'map' ignores element order, i.e. [1, 2] == [2, 1]. Concatenation on arrays with x-kubernetes-list-type use the semantics of the list type:\n - 'set': `X + Y` performs a union where the array positions of all elements in `X` are preserved and\n non-intersecting elements in `Y` are appended, retaining their partial order.\n - 'map': `X + Y` performs a merge where the array positions of all keys in `X` are preserved but the values\n are overwritten by values in `Y` when the key sets of `X` and `Y` intersect. Elements in `Y` with\n non-intersecting keys are appended, retaining their partial order.\n\nIf `rule` makes use of the `oldSelf` variable it is implicitly a `transition rule`.\n\nBy default, the `oldSelf` variable is the same type as `self`. When `optionalOldSelf` is true, the `oldSelf` variable is a CEL optional\n variable whose value() is the same type as `self`.\nSee the documentation for the `optionalOldSelf` field for details.\n\nTransition rules by default are applied only on UPDATE requests and are skipped if an old value could not be found. You can opt a transition rule into unconditional evaluation by setting `optionalOldSelf` to true.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "Message represents the message displayed when validation fails. The message is required if the Rule contains line breaks. The message must not contain line breaks. If unset, the message is \"failed rule: {Rule}\". e.g. \"must be a URL with the host matching spec.host\"", + Type: []string{"string"}, + Format: "", + }, + }, + "messageExpression": { + SchemaProps: spec.SchemaProps{ + Description: "MessageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails. Since messageExpression is used as a failure message, it must evaluate to a string. If both message and messageExpression are present on a rule, then messageExpression will be used if validation fails. If messageExpression results in a runtime error, the runtime error is logged, and the validation failure message is produced as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset, and the fact that messageExpression produced an empty string/string with only spaces/string with line breaks will be logged. messageExpression has access to all the same variables as the rule; the only difference is the return type. Example: \"x must be less than max (\"+string(self.max)+\")\"", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "reason provides a machine-readable validation failure reason that is returned to the caller when a request fails this validation rule. The HTTP status code returned to the caller will match the reason of the reason of the first failed validation rule. The currently supported reasons are: \"FieldValueInvalid\", \"FieldValueForbidden\", \"FieldValueRequired\", \"FieldValueDuplicate\". If not set, default to use \"FieldValueInvalid\". All future added reasons must be accepted by clients when reading this value and unknown reasons should be treated as FieldValueInvalid.\n\nPossible enum values:\n - `\"FieldValueDuplicate\"` is used to report collisions of values that must be unique (e.g. unique IDs).\n - `\"FieldValueForbidden\"` is used to report valid (as per formatting rules) values which would be accepted under some conditions, but which are not permitted by the current conditions (such as security policy).\n - `\"FieldValueInvalid\"` is used to report malformed values (e.g. failed regex match, too long, out of bounds).\n - `\"FieldValueRequired\"` is used to report required values that are not provided (e.g. empty strings, null values, or empty arrays).", + Type: []string{"string"}, + Format: "", + Enum: []interface{}{"FieldValueDuplicate", "FieldValueForbidden", "FieldValueInvalid", "FieldValueRequired"}, + }, + }, + "fieldPath": { + SchemaProps: spec.SchemaProps{ + Description: "fieldPath represents the field path returned when the validation fails. It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field. e.g. when validation checks if a specific attribute `foo` under a map `testMap`, the fieldPath could be set to `.testMap.foo` If the validation checks two lists must have unique attributes, the fieldPath could be set to either of the list: e.g. `.testList` It does not support list numeric index. It supports child operation to refer to an existing field currently. Refer to [JSONPath support in Kubernetes](https://kubernetes.io/docs/reference/kubectl/jsonpath/) for more info. Numeric index of array is not supported. For field name which contains special characters, use `['specialName']` to refer the field name. e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']`", + Type: []string{"string"}, + Format: "", + }, + }, + "optionalOldSelf": { + SchemaProps: spec.SchemaProps{ + Description: "optionalOldSelf is used to opt a transition rule into evaluation even when the object is first created, or if the old object is missing the value.\n\nWhen enabled `oldSelf` will be a CEL optional whose value will be `None` if there is no old value, or when the object is initially created.\n\nYou may check for presence of oldSelf using `oldSelf.hasValue()` and unwrap it after checking using `oldSelf.value()`. Check the CEL documentation for Optional types for more information: https://pkg.go.dev/github.com/google/cel-go/cel#OptionalTypes\n\nMay not be set unless `oldSelf` is used in `rule`.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"rule"}, + }, + }, + } +} + +func schema_pkg_apis_apiextensions_v1_WebhookClientConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WebhookClientConfig contains the information to make a TLS connection with the webhook.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "url": { + SchemaProps: spec.SchemaProps{ + Description: "url gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.\n\nThe `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.\n\nPlease note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.\n\nThe scheme must be \"https\"; the URL must begin with \"https://\".\n\nA path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.\n\nAttempting to use a user or basic auth e.g. \"user:password@\" is not allowed. Fragments (\"#...\") and query parameters (\"?...\") are not allowed, either.", + Type: []string{"string"}, + Format: "", + }, + }, + "service": { + SchemaProps: spec.SchemaProps{ + Description: "service is a reference to the service for this webhook. Either service or url must be specified.\n\nIf the webhook is running within the cluster, then you should use `service`.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ServiceReference"), + }, + }, + "caBundle": { + SchemaProps: spec.SchemaProps{ + Description: "caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.", + Type: []string{"string"}, + Format: "byte", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.ServiceReference"}, + } +} + +func schema_pkg_apis_apiextensions_v1_WebhookConversion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WebhookConversion describes how to call a conversion webhook", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clientConfig": { + SchemaProps: spec.SchemaProps{ + Description: "clientConfig is the instructions for how to call the webhook if strategy is `Webhook`.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.WebhookClientConfig"), + }, + }, + "conversionReviewVersions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"conversionReviewVersions"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.WebhookClientConfig"}, + } +} + +func schema_pkg_apis_meta_v1_APIGroup(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIGroup contains the name, the supported versions, and the preferred version of a group.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the group.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "versions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "versions are the versions supported in this group.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + 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.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.GroupVersionForDiscovery"), + }, + }, + "serverAddressByClientCIDRs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + 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": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "groups is a list of APIGroup.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + 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.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "singularName": { + SchemaProps: spec.SchemaProps{ + Description: "singularName is the singular name of the resource. This allows clients to handle plural and singular opaquely. The singularName is more correct for reporting status on a single item and both singular and plural are allowed from the kubectl CLI interface.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "namespaced": { + SchemaProps: spec.SchemaProps{ + Description: "namespaced indicates if a resource is namespaced or not.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "group": { + SchemaProps: spec.SchemaProps{ + Description: "group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale\".", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)\".", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind is the kind for the resource (e.g. 'Foo' is the kind for a resource 'foo')", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "verbs": { + SchemaProps: spec.SchemaProps{ + Description: "verbs is a list of supported kube verbs (this includes get, list, watch, create, update, patch, delete, deletecollection, and proxy)", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "shortNames": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "shortNames is a list of suggested short names of the resource.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "categories": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "categories is a list of the grouped resources this resource belongs to (e.g. 'all')", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "storageVersionHash": { + SchemaProps: spec.SchemaProps{ + Description: "The hash value of the storage version, the version this resource is converted to when written to the data store. Value must be treated as opaque by clients. Only equality comparison on the value is valid. This is an alpha feature and may change or be removed in the future. The field is populated by the apiserver only if the StorageVersionHash feature gate is enabled. This field will remain optional even if it graduates.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name", "singularName", "namespaced", "kind", "verbs"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_APIResourceList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "groupVersion": { + SchemaProps: spec.SchemaProps{ + Description: "groupVersion is the group and version this APIResourceList is for.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resources": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "resources contains the name of the resources and if they are namespaced.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + 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": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "versions are the api versions that are available.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "serverAddressByClientCIDRs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + 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_ApplyOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ApplyOptions may be provided when applying an API object. FieldManager is required for apply requests. ApplyOptions is equivalent to PatchOptions. It is provided as a convenience with documentation that speaks specifically to how the options fields relate to apply.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "force": { + SchemaProps: spec.SchemaProps{ + Description: "Force is going to \"force\" Apply requests. It means user will re-acquire conflicting fields owned by other people.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "fieldManager": { + SchemaProps: spec.SchemaProps{ + Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"force", "fieldManager"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Condition contains details for one aspect of the current state of this API Resource.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of condition in CamelCase or in foo.example.com/CamelCase.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status of the condition, one of True, False, Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.", + Ref: ref("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.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message is a human readable message indicating details about the transition. This may be an empty string.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status", "lastTransitionTime", "reason", "message"}, + }, + }, + Dependencies: []string{ + "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": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "fieldManager": { + SchemaProps: spec.SchemaProps{ + Description: "fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.", + Type: []string{"string"}, + Format: "", + }, + }, + "fieldValidation": { + SchemaProps: spec.SchemaProps{ + Description: "fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_DeleteOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "DeleteOptions may be provided when deleting an API object.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "gracePeriodSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "preconditions": { + SchemaProps: spec.SchemaProps{ + Description: "Must be fulfilled before a deletion is carried out. If not possible, a 409 Conflict status will be returned.", + Ref: ref("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": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + 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: metav1.Duration{}.OpenAPISchemaType(), + Format: metav1.Duration{}.OpenAPISchemaFormat(), + }, + }, + } +} + +func schema_pkg_apis_meta_v1_FieldsV1(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.\n\nEach key is either a '.' representing the field itself, and will always map to an empty set, or a string representing a sub-field or item. The string will follow one of these four formats: 'f:', where is the name of a field in a struct, or key in a map 'v:', where is the exact json formatted value of a list item 'i:', where is position of a item in a list 'k:', where is a map of a list item's key fields to their unique values If a key maps to an empty Fields value, the field that key represents is part of the set.\n\nThe exact format is defined in sigs.k8s.io/structured-merge-diff", + Type: []string{"object"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GetOptions(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GetOptions is the standard query options to the standard REST get call.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.\n\nDefaults to unset", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupKind(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupKind specifies a Group and a Kind, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "kind"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupResource specifies a Group and a Resource, but does not force a version. This is useful for identifying concepts during lookup stages without having partially valid types", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "resource"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersion(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersion contains the \"group\" and the \"version\", which uniquely identifies the API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "version"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersionForDiscovery(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "groupVersion": { + SchemaProps: spec.SchemaProps{ + Description: "groupVersion specifies the API group and version in the form \"group/version\"", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"groupVersion", "version"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersionKind(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersionKind unambiguously identifies a kind. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "version", "kind"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_GroupVersionResource(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "GroupVersionResource unambiguously identifies a resource. It doesn't anonymously include GroupVersion to avoid automatic coercion. It doesn't use a GroupVersion to avoid custom marshalling", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "group": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "resource": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"group", "version", "resource"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_InternalEvent(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InternalEvent makes watch.Event versioned", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "Type": { + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "Object": { + SchemaProps: spec.SchemaProps{ + Description: "Object is:\n * If Type is Added or Modified: the new state of the object.\n * If Type is Deleted: the state of the object immediately before deletion.\n * If Type is Bookmark: the object (instance of a type being watched) where\n only ResourceVersion field is set. On successful restart of watch from a\n bookmark resourceVersion, client is guaranteed to not get repeat event\n nor miss any events.\n * If Type is Error: *api.Status is recommended; other types may make sense\n depending on context.", + 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{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "matchExpressions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "matchExpressions is a list of label selector requirements. The requirements are ANDed.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelectorRequirement"), + }, + }, + }, + }, + }, + }, + }, + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-map-type": "atomic", + }, + }, + }, + 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": { + SchemaProps: spec.SchemaProps{ + Description: "key is the label key that the selector applies to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "operator": { + SchemaProps: spec.SchemaProps{ + Description: "operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "values": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"key", "operator"}, + }, + }, + } +} + +func schema_pkg_apis_meta_v1_List(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "List holds a list of objects, which may not be known by the server.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources", + Type: []string{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", + Default: map[string]interface{}{}, + Ref: ref("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: "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.", + Type: []string{"string"}, + Format: "", + }, + }, + "resourceVersion": { + SchemaProps: spec.SchemaProps{ + Description: "String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency", + Type: []string{"string"}, + Format: "", + }, + }, + "continue": { + SchemaProps: spec.SchemaProps{ + Description: "continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message.", + Type: []string{"string"}, + Format: "", + }, + }, + "remainingItemCount": { + SchemaProps: spec.SchemaProps{ + Description: "remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + }, + }, + }, + } +} + +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"}, @@ -16520,8 +19430,7 @@ func schema_pkg_apis_meta_v1_ManagedFieldsEntry(ref common.ReferenceCallback) co }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.FieldsV1", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -16530,8 +19439,8 @@ func schema_pkg_apis_meta_v1_MicroTime(ref common.ReferenceCallback) common.Open Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ Description: "MicroTime is version of Time with microsecond level precision.", - Type: v1.MicroTime{}.OpenAPISchemaType(), - Format: v1.MicroTime{}.OpenAPISchemaFormat(), + Type: metav1.MicroTime{}.OpenAPISchemaType(), + Format: metav1.MicroTime{}.OpenAPISchemaFormat(), }, }, } @@ -16596,7 +19505,6 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope "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", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), }, }, @@ -16648,6 +19556,10 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope "ownerReferences": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "uid", + }, + "x-kubernetes-list-type": "map", "x-kubernetes-patch-merge-key": "uid", "x-kubernetes-patch-strategy": "merge", }, @@ -16658,7 +19570,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference"), }, }, @@ -16668,6 +19580,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope "finalizers": { VendorExtensible: spec.VendorExtensible{ Extensions: spec.Extensions{ + "x-kubernetes-list-type": "set", "x-kubernetes-patch-strategy": "merge", }, }, @@ -16686,13 +19599,18 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, }, "managedFields": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like \"ci-cd\". The set of fields is always in the version that the workflow used when modifying the object.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry"), }, }, @@ -16703,8 +19621,7 @@ func schema_pkg_apis_meta_v1_ObjectMeta(ref common.ReferenceCallback) common.Ope }, }, 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", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ManagedFieldsEntry", "k8s.io/apimachinery/pkg/apis/meta/v1.OwnerReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, } } @@ -16797,7 +19714,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), }, }, @@ -16805,8 +19722,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadata(ref common.ReferenceCallback) }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"}, } } @@ -16834,7 +19750,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallb "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -16845,7 +19761,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallb Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"), }, }, @@ -16857,8 +19773,7 @@ func schema_pkg_apis_meta_v1_PartialObjectMetadataList(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.PartialObjectMetadata"}, } } @@ -16895,6 +19810,11 @@ func schema_pkg_apis_meta_v1_PatchOptions(ref common.ReferenceCallback) common.O }, }, "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", Type: []string{"array"}, @@ -16971,6 +19891,11 @@ func schema_pkg_apis_meta_v1_RootPaths(ref common.ReferenceCallback) common.Open Type: []string{"object"}, Properties: map[string]spec.Schema{ "paths": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "paths are the paths available at root.", Type: []string{"array"}, @@ -17046,7 +19971,7 @@ func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPI "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, @@ -17072,6 +19997,11 @@ func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPI }, }, "details": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, 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"), @@ -17088,8 +20018,7 @@ func schema_pkg_apis_meta_v1_Status(ref common.ReferenceCallback) common.OpenAPI }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.StatusDetails"}, } } @@ -17163,13 +20092,18 @@ func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common. }, }, "causes": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"), }, }, @@ -17187,8 +20121,7 @@ func schema_pkg_apis_meta_v1_StatusDetails(ref common.ReferenceCallback) common. }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.StatusCause"}, } } @@ -17216,18 +20149,23 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID "metadata": { SchemaProps: spec.SchemaProps{ Description: "Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds", - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), }, }, "columnDefinitions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "columnDefinitions describes each column in the returned items array. The number of cells per row will always match the number of column definitions.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition"), }, }, @@ -17235,13 +20173,18 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID }, }, "rows": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "rows is the list of items in the table.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"), }, }, @@ -17253,8 +20196,7 @@ func schema_pkg_apis_meta_v1_Table(ref common.ReferenceCallback) common.OpenAPID }, }, 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", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/apimachinery/pkg/apis/meta/v1.TableColumnDefinition", "k8s.io/apimachinery/pkg/apis/meta/v1.TableRow"}, } } @@ -17354,6 +20296,11 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA Type: []string{"object"}, Properties: map[string]spec.Schema{ "cells": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "cells will be as wide as the column definitions array and may contain strings, numbers (float64 or int64), booleans, simple maps, lists, or null. See the type field of the column definition for a more detailed description.", Type: []string{"array"}, @@ -17368,13 +20315,18 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA }, }, "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "conditions describe additional status of a row that are relevant for a human user. These conditions apply to the row, not to the object, and will be specific to table output. The only defined condition type is 'Completed', for a row that indicates a resource that has run to completion and can be given less visual priority.", Type: []string{"array"}, Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Default: map[string]any{}, + Default: map[string]interface{}{}, Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition"), }, }, @@ -17384,7 +20336,6 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA "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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -17393,8 +20344,7 @@ func schema_pkg_apis_meta_v1_TableRow(ref common.ReferenceCallback) common.OpenA }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension", - }, + "k8s.io/apimachinery/pkg/apis/meta/v1.TableRowCondition", "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -17447,8 +20397,8 @@ func schema_pkg_apis_meta_v1_Time(ref common.ReferenceCallback) common.OpenAPIDe 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(), + Type: metav1.Time{}.OpenAPISchemaType(), + Format: metav1.Time{}.OpenAPISchemaFormat(), }, }, } @@ -17533,6 +20483,11 @@ func schema_pkg_apis_meta_v1_UpdateOptions(ref common.ReferenceCallback) common. }, }, "dryRun": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, SchemaProps: spec.SchemaProps{ Description: "When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed", Type: []string{"array"}, @@ -17584,7 +20539,6 @@ func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.Ope "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.", - Default: map[string]any{}, Ref: ref("k8s.io/apimachinery/pkg/runtime.RawExtension"), }, }, @@ -17593,8 +20547,7 @@ func schema_pkg_apis_meta_v1_WatchEvent(ref common.ReferenceCallback) common.Ope }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/runtime.RawExtension", - }, + "k8s.io/apimachinery/pkg/runtime.RawExtension"}, } } @@ -17676,6 +20629,26 @@ func schema_k8sio_apimachinery_pkg_runtime_Unknown(ref common.ReferenceCallback) } } +func schema_apimachinery_pkg_util_intstr_IntOrString(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.EmbedOpenAPIDefinitionIntoV2Extension(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.", + OneOf: common.GenerateOpenAPIV3OneOfSchema(intstr.IntOrString{}.OpenAPIV3OneOfTypes()), + Format: intstr.IntOrString{}.OpenAPISchemaFormat(), + }, + }, + }, 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(), + }, + }, + }) +} + func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ @@ -17752,3 +20725,300 @@ func schema_k8sio_apimachinery_pkg_version_Info(ref common.ReferenceCallback) co }, } } + +func schema_pkg_apis_apiregistration_v1_APIService(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIService represents a server for a particular GroupVersion. Name must be \"version.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: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "Spec contains information for locating and communicating with a server", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status contains derived information about an API server", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceSpec", "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceStatus"}, + } +} + +func schema_pkg_apis_apiregistration_v1_APIServiceCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIServiceCondition describes the state of an APIService at a particular point", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "Type is the type of the condition.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "Status is the status of the condition. Can be True, False, Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "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_pkg_apis_apiregistration_v1_APIServiceList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIServiceList is a list of APIService 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#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "Items is the list of APIService", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIService"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIService"}, + } +} + +func schema_pkg_apis_apiregistration_v1_APIServiceSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "service": { + SchemaProps: spec.SchemaProps{ + Description: "Service is a reference to the service for this API server. It must communicate on port 443. If the Service is nil, that means the handling for the API groupversion is handled locally on this server. The call will simply delegate to the normal handler chain to be fulfilled.", + Ref: ref("k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.ServiceReference"), + }, + }, + "group": { + SchemaProps: spec.SchemaProps{ + Description: "Group is the API group name this server hosts", + Type: []string{"string"}, + Format: "", + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "Version is the API version this server hosts. For example, \"v1\"", + Type: []string{"string"}, + Format: "", + }, + }, + "insecureSkipTLSVerify": { + SchemaProps: spec.SchemaProps{ + Description: "InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "caBundle": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "CABundle is a PEM encoded CA bundle which will be used to validate an API server's serving certificate. If unspecified, system trust roots on the apiserver are used.", + Type: []string{"string"}, + Format: "byte", + }, + }, + "groupPriorityMinimum": { + SchemaProps: spec.SchemaProps{ + Description: "GroupPriorityMinimum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMinimum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We'd recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "versionPriority": { + SchemaProps: spec.SchemaProps{ + Description: "VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it's inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is \"kube-like\", it will sort above non \"kube-like\" version strings, which are ordered lexicographically. \"Kube-like\" versions start with a \"v\", then are followed by a number (the major version), then optionally the string \"alpha\" or \"beta\" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"groupPriorityMinimum", "versionPriority"}, + }, + }, + Dependencies: []string{ + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.ServiceReference"}, + } +} + +func schema_pkg_apis_apiregistration_v1_APIServiceStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIServiceStatus contains derived information about an API server", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + "x-kubernetes-patch-merge-key": "type", + "x-kubernetes-patch-strategy": "merge", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "Current service state of apiService.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceCondition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1.APIServiceCondition"}, + } +} + +func schema_pkg_apis_apiregistration_v1_ServiceReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ServiceReference holds a reference to Service.legacy.k8s.io", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "Namespace is the namespace of the service", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "Name is the name of the service", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "If specified, the port on the service that hosting webhook. Default to 443 for backward compatibility. `port` should be a valid port number (1-65535, inclusive).", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} diff --git a/pkg/options/authentication_options.go b/pkg/options/authentication_options.go index b03e1c8825d..c175565c9cf 100644 --- a/pkg/options/authentication_options.go +++ b/pkg/options/authentication_options.go @@ -33,7 +33,7 @@ func (o *ClientCertAuthenticationOptions) Validate() []error { // AddFlags adds flags related to ClientCertAuthenticationOptions for a specific server to the // specified FlagSet. -func (o *ClientCertAuthenticationOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *ClientCertAuthenticationOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.ClientCA, "client-ca-file", o.ClientCA, ""+ "If set, any request presenting a client certificate signed by one of "+ "the authorities in the client-ca-file is authenticated with an identity "+ diff --git a/pkg/options/consul_options.go b/pkg/options/consul_options.go index a198b691b2b..2db05e08903 100644 --- a/pkg/options/consul_options.go +++ b/pkg/options/consul_options.go @@ -37,7 +37,7 @@ func (o *ConsulOptions) Validate() []error { } // AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet. -func (o *ConsulOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *ConsulOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Addr, "consul.addr", o.Addr, ""+ "Addr is the address of the consul server.") diff --git a/pkg/options/etcd_options.go b/pkg/options/etcd_options.go index def84afc9ea..257c546dd7e 100644 --- a/pkg/options/etcd_options.go +++ b/pkg/options/etcd_options.go @@ -51,7 +51,7 @@ func (o *EtcdOptions) Validate() []error { } // AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet. -func (o *EtcdOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *EtcdOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { o.TLSOptions.AddFlags(fs, "etcd") fs.StringSliceVar(&o.Endpoints, "etcd.endpoints", o.Endpoints, "Endpoints of etcd cluster.") diff --git a/pkg/options/grpc_options.go b/pkg/options/grpc_options.go index a0913184750..11c8ef18188 100644 --- a/pkg/options/grpc_options.go +++ b/pkg/options/grpc_options.go @@ -51,7 +51,7 @@ func (o *GRPCOptions) Validate() []error { // AddFlags adds flags related to features for a specific api server to the // specified FlagSet. -func (o *GRPCOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *GRPCOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Network, "grpc.network", o.Network, "Specify the network for the gRPC server.") fs.StringVar(&o.Addr, "grpc.addr", o.Addr, "Specify the gRPC server bind address and port.") fs.DurationVar(&o.Timeout, "grpc.timeout", o.Timeout, "Timeout for server connections.") diff --git a/pkg/options/health_options.go b/pkg/options/health_options.go index 291ad4fe2d0..9fa92d4195b 100644 --- a/pkg/options/health_options.go +++ b/pkg/options/health_options.go @@ -44,7 +44,7 @@ func (o *HealthOptions) Validate() []error { } // AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet. -func (o *HealthOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *HealthOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.BoolVar(&o.HTTPProfile, "health.enable-http-profiler", o.HTTPProfile, "Expose runtime profiling data via HTTP.") fs.StringVar(&o.HealthCheckPath, "health.check-path", o.HealthCheckPath, "Specifies liveness health check request path.") fs.StringVar(&o.HealthCheckAddress, "health.check-address", o.HealthCheckAddress, "Specifies liveness health check bind address.") diff --git a/pkg/options/helper.go b/pkg/options/helper.go index f073ea55af4..69079aa9aa6 100644 --- a/pkg/options/helper.go +++ b/pkg/options/helper.go @@ -23,8 +23,8 @@ const ( TiB ) -func join(prefixs ...string) string { - joined := strings.Join(prefixs, ".") +func join(prefixes ...string) string { + joined := strings.Join(prefixes, ".") if joined != "" { joined += "." } diff --git a/pkg/options/http_options.go b/pkg/options/http_options.go index cf6c116c20a..fcfa87611fa 100644 --- a/pkg/options/http_options.go +++ b/pkg/options/http_options.go @@ -53,7 +53,7 @@ func (o *HTTPOptions) Validate() []error { // AddFlags adds flags related to HTTPS server for a specific APIServer to the // specified FlagSet. -func (o *HTTPOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *HTTPOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Network, "http.network", o.Network, "Specify the network for the HTTP server.") fs.StringVar(&o.Addr, "http.addr", o.Addr, "Specify the HTTP server bind address and port.") fs.DurationVar(&o.Timeout, "http.timeout", o.Timeout, "Timeout for server connections.") diff --git a/pkg/options/insecure_serving.go b/pkg/options/insecure_serving.go index 86ebfafa543..579a3a99dea 100644 --- a/pkg/options/insecure_serving.go +++ b/pkg/options/insecure_serving.go @@ -36,6 +36,6 @@ func (s *InsecureServingOptions) Validate() []error { // AddFlags adds flags related to features for a specific api server to the // specified FlagSet. -func (s *InsecureServingOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (s *InsecureServingOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&s.Addr, "insecure.addr", s.Addr, "Specify the HTTP server bind address and port.") } diff --git a/pkg/options/jaeger_options.go b/pkg/options/jaeger_options.go index eb2f8212e78..d0c0f1cc140 100644 --- a/pkg/options/jaeger_options.go +++ b/pkg/options/jaeger_options.go @@ -44,7 +44,7 @@ func (o *JaegerOptions) Validate() []error { } // AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet. -func (o *JaegerOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *JaegerOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Server, "jaeger.server", o.Server, ""+ "Server is the url of the Jaeger server.") fs.StringVar(&o.ServiceName, "jaeger.service-name", o.ServiceName, ""+ diff --git a/pkg/options/jwt_options.go b/pkg/options/jwt_options.go index a975f8e3be1..ae4a76acb88 100644 --- a/pkg/options/jwt_options.go +++ b/pkg/options/jwt_options.go @@ -49,7 +49,7 @@ func (s *JWTOptions) Validate() []error { // AddFlags adds flags related to features for a specific api server to the // specified FlagSet. -func (s *JWTOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (s *JWTOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { if fs == nil { return } diff --git a/pkg/options/kafka_options.go b/pkg/options/kafka_options.go index 2efe55a591c..83cfa1e3e69 100644 --- a/pkg/options/kafka_options.go +++ b/pkg/options/kafka_options.go @@ -245,7 +245,7 @@ func (o *KafkaOptions) Validate() []error { } // AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet. -func (o *KafkaOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *KafkaOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { o.TLSOptions.AddFlags(fs, "kafka") fs.StringSliceVar(&o.Brokers, "kafka.brokers", o.Brokers, "The list of brokers used to discover the partitions available on the kafka cluster.") diff --git a/pkg/options/logs_options.go b/pkg/options/logs_options.go index 60ecaba325b..a9f38a9e562 100644 --- a/pkg/options/logs_options.go +++ b/pkg/options/logs_options.go @@ -58,7 +58,7 @@ func (o *LogsOptions) Validate() []error { } // AddFlags adds command line flags for the configuration. -func (o *LogsOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *LogsOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Format, "logs.format", o.Format, "Sets the log format. Permitted formats: json, text.") fs.DurationVar(&o.FlushFrequency, "log.flush-frequency", o.FlushFrequency, "Maximum number of seconds between log flushes.") fs.VarP(logsapi.VerbosityLevelPflag(&o.Verbosity), "logs.verbosity", "", " Number for the log level verbosity.") diff --git a/pkg/options/metrics_options.go b/pkg/options/metrics_options.go index dbf3d8695cf..4d4a3a0c770 100644 --- a/pkg/options/metrics_options.go +++ b/pkg/options/metrics_options.go @@ -42,7 +42,7 @@ func (o *MetricsOptions) Validate() []error { } // AddFlags adds flags for exposing component metrics. -func (o *MetricsOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *MetricsOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { if o == nil { return } diff --git a/pkg/options/mongo_options.go b/pkg/options/mongo_options.go index 1587a3d5f11..0eac0b81c1f 100644 --- a/pkg/options/mongo_options.go +++ b/pkg/options/mongo_options.go @@ -63,7 +63,7 @@ func (o *MongoOptions) Validate() []error { } // AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet. -func (o *MongoOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *MongoOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { o.TLSOptions.AddFlags(fs, "mongo") fs.DurationVar(&o.Timeout, "mongo.timeout", o.Timeout, "Timeout is the maximum amount of time a dial will wait for a connect to complete.") diff --git a/pkg/options/mysql_options.go b/pkg/options/mysql_options.go index d69533c0876..90587169bd8 100644 --- a/pkg/options/mysql_options.go +++ b/pkg/options/mysql_options.go @@ -53,21 +53,21 @@ func (o *MySQLOptions) Validate() []error { } // AddFlags adds flags related to mysql storage for a specific APIServer to the specified FlagSet. -func (o *MySQLOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { - fs.StringVar(&o.Host, join(prefixs...)+"db.host", o.Host, ""+ +func (o *MySQLOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { + fs.StringVar(&o.Host, join(prefixes...)+"mysql.host", o.Host, ""+ "MySQL service host address. If left blank, the following related mysql options will be ignored.") - fs.StringVar(&o.Username, join(prefixs...)+"db.username", o.Username, "Username for access to mysql service.") - fs.StringVar(&o.Password, join(prefixs...)+"db.password", o.Password, ""+ + fs.StringVar(&o.Username, join(prefixes...)+"mysql.username", o.Username, "Username for access to mysql service.") + fs.StringVar(&o.Password, join(prefixes...)+"mysql.password", o.Password, ""+ "Password for access to mysql, should be used pair with password.") - fs.StringVar(&o.Database, join(prefixs...)+"db.database", o.Database, ""+ + fs.StringVar(&o.Database, join(prefixes...)+"mysql.database", o.Database, ""+ "Database name for the server to use.") - fs.IntVar(&o.MaxIdleConnections, join(prefixs...)+"db.max-idle-connections", o.MaxOpenConnections, ""+ + fs.IntVar(&o.MaxIdleConnections, join(prefixes...)+"mysql.max-idle-connections", o.MaxOpenConnections, ""+ "Maximum idle connections allowed to connect to mysql.") - fs.IntVar(&o.MaxOpenConnections, join(prefixs...)+"db.max-open-connections", o.MaxOpenConnections, ""+ + fs.IntVar(&o.MaxOpenConnections, join(prefixes...)+"mysql.max-open-connections", o.MaxOpenConnections, ""+ "Maximum open connections allowed to connect to mysql.") - fs.DurationVar(&o.MaxConnectionLifeTime, join(prefixs...)+"db.max-connection-life-time", o.MaxConnectionLifeTime, ""+ + fs.DurationVar(&o.MaxConnectionLifeTime, join(prefixes...)+"mysql.max-connection-life-time", o.MaxConnectionLifeTime, ""+ "Maximum connection life time allowed to connect to mysql.") - fs.IntVar(&o.LogLevel, join(prefixs...)+"db.log-mode", o.LogLevel, ""+ + fs.IntVar(&o.LogLevel, join(prefixes...)+"mysql.log-mode", o.LogLevel, ""+ "Specify gorm log level.") } diff --git a/pkg/options/options.go b/pkg/options/options.go index 4f6fffc198f..fe45dc71cb8 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -14,5 +14,5 @@ type IOptions interface { Validate() []error // AddFlags adds flags related to given flagset. - AddFlags(fs *pflag.FlagSet, prefixs ...string) + AddFlags(fs *pflag.FlagSet, prefixes ...string) } diff --git a/pkg/options/polaris_options.go b/pkg/options/polaris_options.go index e218f0e8e0d..ed8df17d9f4 100644 --- a/pkg/options/polaris_options.go +++ b/pkg/options/polaris_options.go @@ -35,7 +35,7 @@ func (o *PolarisOptions) Validate() []error { } // AddFlags adds flags related to Polaris service to the specified FlagSet. -func (o *PolarisOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *PolarisOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Addr, "polaris.addr", o.Addr, "Address of your Polaris service(ip:port).") fs.DurationVar(&o.ReadTimeout, "polaris.read-timeout", o.ReadTimeout, "Timeout for socket reads.") fs.DurationVar(&o.WriteTimeout, "polaris.write-timeout", o.WriteTimeout, "Timeout for socket writes.") diff --git a/pkg/options/redis_options.go b/pkg/options/redis_options.go index 08e54c0e261..ac124b2273a 100644 --- a/pkg/options/redis_options.go +++ b/pkg/options/redis_options.go @@ -68,7 +68,7 @@ func (o *RedisOptions) Validate() []error { } // AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet. -func (o *RedisOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (o *RedisOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&o.Addr, "redis.addr", o.Addr, "Address of your Redis server(ip:port).") fs.StringVar(&o.Username, "redis.username", o.Username, "Username for access to redis service.") fs.StringVar(&o.Password, "redis.password", o.Password, "Optional auth password for redis db.") diff --git a/pkg/options/secure_serving.go b/pkg/options/secure_serving.go index 3506dee234f..e78de41d9c8 100644 --- a/pkg/options/secure_serving.go +++ b/pkg/options/secure_serving.go @@ -82,7 +82,7 @@ func (s *SecureServingOptions) Validate() []error { // AddFlags adds flags related to HTTPS server for a specific APIServer to the // specified FlagSet. -func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { +func (s *SecureServingOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { fs.StringVar(&s.BindAddress, "secure.bind-address", s.BindAddress, ""+ "The IP address on which to listen for the --secure.bind-port port. The "+ "associated interface(s) must be reachable by the rest of the engine, and by CLI/web "+ diff --git a/pkg/options/tls_options.go b/pkg/options/tls_options.go index 7ecb9dc9638..ce8e6bb4fe0 100644 --- a/pkg/options/tls_options.go +++ b/pkg/options/tls_options.go @@ -49,13 +49,13 @@ func (o *TLSOptions) Validate() []error { } // AddFlags adds flags related to redis storage for a specific APIServer to the specified FlagSet. -func (o *TLSOptions) AddFlags(fs *pflag.FlagSet, prefixs ...string) { - fs.BoolVar(&o.UseTLS, join(prefixs...)+"tls.use-tls", o.UseTLS, "Use tls transport to connect the server.") - fs.BoolVar(&o.InsecureSkipVerify, join(prefixs...)+"tls.insecure-skip-verify", o.InsecureSkipVerify, ""+ +func (o *TLSOptions) AddFlags(fs *pflag.FlagSet, prefixes ...string) { + fs.BoolVar(&o.UseTLS, join(prefixes...)+"tls.use-tls", o.UseTLS, "Use tls transport to connect the server.") + fs.BoolVar(&o.InsecureSkipVerify, join(prefixes...)+"tls.insecure-skip-verify", o.InsecureSkipVerify, ""+ "Controls whether a client verifies the server's certificate chain and host name.") - fs.StringVar(&o.CaCert, join(prefixs...)+"tls.ca-cert", o.CaCert, "Path to ca cert for connecting to the server.") - fs.StringVar(&o.Cert, join(prefixs...)+"tls.cert", o.Cert, "Path to cert file for connecting to the server.") - fs.StringVar(&o.Key, join(prefixs...)+"tls.key", o.Key, "Path to key file for connecting to the server.") + fs.StringVar(&o.CaCert, join(prefixes...)+"tls.ca-cert", o.CaCert, "Path to ca cert for connecting to the server.") + fs.StringVar(&o.Cert, join(prefixes...)+"tls.cert", o.Cert, "Path to cert file for connecting to the server.") + fs.StringVar(&o.Key, join(prefixes...)+"tls.key", o.Key, "Path to key file for connecting to the server.") } func (o *TLSOptions) MustTLSConfig() *tls.Config { diff --git a/pkg/ptr/README.md b/pkg/ptr/README.md new file mode 100644 index 00000000000..2ca8073dc73 --- /dev/null +++ b/pkg/ptr/README.md @@ -0,0 +1,3 @@ +# Pointer + +This package provides some functions for pointer-based operations. diff --git a/pkg/ptr/doc.go b/pkg/ptr/doc.go new file mode 100644 index 00000000000..98eb6932c50 --- /dev/null +++ b/pkg/ptr/doc.go @@ -0,0 +1,3 @@ +// Package gptr provides generic operations for pointers. + +package ptr diff --git a/pkg/ptr/ptr.go b/pkg/ptr/ptr.go new file mode 100644 index 00000000000..cac299da42e --- /dev/null +++ b/pkg/ptr/ptr.go @@ -0,0 +1,146 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 ptr + +import ( + "fmt" + "reflect" +) + +// AllPtrFieldsNil tests whether all pointer fields in a struct are nil. This is useful when, +// for example, an API struct is handled by plugins which need to distinguish +// "no plugin accepted this spec" from "this spec is empty". +// +// This function is only valid for structs and pointers to structs. Any other +// type will cause a panic. Passing a typed nil pointer will return true. +func AllPtrFieldsNil(obj interface{}) bool { + v := reflect.ValueOf(obj) + if !v.IsValid() { + panic(fmt.Sprintf("reflect.ValueOf() produced a non-valid Value for %#v", obj)) + } + if v.Kind() == reflect.Ptr { + if v.IsNil() { + return true + } + v = v.Elem() + } + for i := 0; i < v.NumField(); i++ { + if v.Field(i).Kind() == reflect.Ptr && !v.Field(i).IsNil() { + return false + } + } + return true +} + +// To returns a pointer to the given value. +func To[T any](v T) *T { + return &v +} + +// From returns the value pointed to by the pointer p. +// If the pointer is nil, returns the zero value of T instead. +func From[T any](v *T) T { + var zero T + if v != nil { + return *v + } + + return zero +} + +// FromOr dereferences ptr and returns the value it points to if no nil, or else +// returns def. +func FromOr[T any](ptr *T, def T) T { + if ptr != nil { + return *ptr + } + return def +} + +// IsNil returns whether the given pointer v is nil. +func IsNil[T any](p *T) bool { + return p == nil +} + +// IsNotNil is negation of [IsNil]. +func IsNotNil[T any](p *T) bool { + return p != nil +} + +// Clone returns a shallow copy of the slice. +// If the given pointer is nil, nil is returned. +// +// HINT: The element is copied using assignment (=), so this is a shallow clone. +// If you want to do a deep clone, use [CloneBy] with an appropriate element +// clone function. +// +// AKA: Copy +func Clone[T any](p *T) *T { + if p == nil { + return nil + } + clone := *p + return &clone +} + +// CloneBy is variant of [Clone], it returns a copy of the map. +// Element is copied using function f. +// If the given pointer is nil, nil is returned. +func CloneBy[T any](p *T, f func(T) T) *T { + return Map(p, f) +} + +// Equal returns true if both arguments are nil or both arguments +// dereference to the same value. +func Equal[T comparable](a, b *T) bool { + if (a == nil) != (b == nil) { + return false + } + if a == nil { + return true + } + return *a == *b +} + +// EqualTo returns whether the value of pointer p is equal to value v. +// It a shortcut of "x != nil && *x == y". +// +// EXAMPLE: +// +// x, y := 1, 2 +// Equal(&x, 1) ⏩ true +// Equal(&y, 1) ⏩n false +// Equal(nil, 1) ⏩ false +func EqualTo[T comparable](p *T, v T) bool { + return p != nil && *p == v +} + +// Map applies function f to element of pointer p. +// If p is nil, f will not be called and nil is returned, otherwise, +// result of f are returned as a new pointer. +// +// EXAMPLE: +// +// i := 1 +// Map(&i, strconv.Itoa) ⏩ (*string)("1") +// Map[int](nil, strconv.Itoa) ⏩ (*string)(nil) +func Map[F, T any](p *F, f func(F) T) *T { + if p == nil { + return nil + } + return To(f(*p)) +} diff --git a/pkg/ptr/ptr_test.go b/pkg/ptr/ptr_test.go new file mode 100644 index 00000000000..1e54dfec5b9 --- /dev/null +++ b/pkg/ptr/ptr_test.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 ptr + +import ( + "fmt" + "strconv" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestAllPtrFieldsNil(t *testing.T) { + testCases := []struct { + obj interface{} + expected bool + }{ + {struct{}{}, true}, + {struct{ Foo int }{12345}, true}, + {&struct{ Foo int }{12345}, true}, + {struct{ Foo *int }{nil}, true}, + {&struct{ Foo *int }{nil}, true}, + {struct { + Foo int + Bar *int + }{12345, nil}, true}, + {&struct { + Foo int + Bar *int + }{12345, nil}, true}, + {struct { + Foo *int + Bar *int + }{nil, nil}, true}, + {&struct { + Foo *int + Bar *int + }{nil, nil}, true}, + {struct{ Foo *int }{new(int)}, false}, + {&struct{ Foo *int }{new(int)}, false}, + {struct { + Foo *int + Bar *int + }{nil, new(int)}, false}, + {&struct { + Foo *int + Bar *int + }{nil, new(int)}, false}, + {(*struct{})(nil), true}, + } + for i, tc := range testCases { + name := fmt.Sprintf("case[%d]", i) + t.Run(name, func(t *testing.T) { + if actual := AllPtrFieldsNil(tc.obj); actual != tc.expected { + t.Errorf("%s: expected %t, got %t", name, tc.expected, actual) + } + }) + } +} + +func TestRef(t *testing.T) { + type T int + + val := T(0) + pointer := To(val) + if *pointer != val { + t.Errorf("expected %d, got %d", val, *pointer) + } + + val = T(1) + pointer = To(val) + if *pointer != val { + t.Errorf("expected %d, got %d", val, *pointer) + } +} + +func TestFrom(t *testing.T) { + assert.Equal(t, 543, From(To(543))) + assert.Equal(t, "Alice", From(To("Alice"))) + assert.Zero(t, From[int](nil)) + assert.Nil(t, From[interface{}](nil)) + assert.Nil(t, From(To[fmt.Stringer](nil))) +} + +func TestFromOr(t *testing.T) { + type T int + + var val, def T = 1, 0 + + out := FromOr(&val, def) + if out != val { + t.Errorf("expected %d, got %d", val, out) + } + + out = FromOr(nil, def) + if out != def { + t.Errorf("expected %d, got %d", def, out) + } +} + +func TestIsNil(t *testing.T) { + assert.False(t, IsNil(To(1))) + assert.True(t, IsNil[int](nil)) +} + +func TestClone(t *testing.T) { + assert.True(t, IsNil(Clone(((*int)(nil))))) + + v := 1 + assert.True(t, Clone(&v) != &v) + assert.True(t, Equal(Clone(&v), &v)) + + src := To(1) + dst := Clone(&src) + assert.Equal(t, &src, dst) + assert.True(t, src == *dst) +} + +func TestCloneBy(t *testing.T) { + assert.True(t, IsNil(CloneBy(((**int)(nil)), Clone[int]))) + + src := To(1) + dst := CloneBy(&src, Clone[int]) + assert.Equal(t, &src, dst) + assert.False(t, src == *dst) +} + +func TestEqual(t *testing.T) { + type T int + + if !Equal[T](nil, nil) { + t.Errorf("expected true (nil == nil)") + } + if !Equal(To(T(123)), To(T(123))) { + t.Errorf("expected true (val == val)") + } + if Equal(nil, To(T(123))) { + t.Errorf("expected false (nil != val)") + } + if Equal(To(T(123)), nil) { + t.Errorf("expected false (val != nil)") + } + if Equal(To(T(123)), To(T(456))) { + t.Errorf("expected false (val != val)") + } +} + +func TestEqualTo(t *testing.T) { + assert.True(t, EqualTo(To(1), 1)) + assert.False(t, EqualTo(To(2), 1)) + assert.False(t, EqualTo(nil, 0)) +} + +func TestMap(t *testing.T) { + i := 1 + assert.Equal(t, To("1"), Map(&i, strconv.Itoa)) + assert.True(t, Map(nil, strconv.Itoa) == nil) + + assert.NotPanics(t, func() { + _ = Map(nil, func(int) string { + panic("Q_Q") + }) + }) + + assert.Panics(t, func() { + _ = Map(&i, func(int) string { + panic("Q_Q") + }) + }) +} diff --git a/pkg/watch/interface.go b/pkg/watch/interface.go new file mode 100644 index 00000000000..370e8f34cb0 --- /dev/null +++ b/pkg/watch/interface.go @@ -0,0 +1,7 @@ +package watch + +// WatcherInitializer is used for initialization of shareable resources between watcher plugins. +// After initialization the resources have to be set separately. +type WatcherInitializer interface { + Initialize(watcher Watcher) +} diff --git a/pkg/watch/logger.go b/pkg/watch/logger.go new file mode 100644 index 00000000000..20398970b55 --- /dev/null +++ b/pkg/watch/logger.go @@ -0,0 +1,11 @@ +package watch + +import ( + "github.com/robfig/cron/v3" +) + +// Logger is an interface that extends the cron.Logger interface with an additional Debug method. +type Logger interface { + cron.Logger + Debug(msg string, keysAndValues ...interface{}) +} diff --git a/pkg/watch/logger/empty/logger.go b/pkg/watch/logger/empty/logger.go new file mode 100644 index 00000000000..dad0f724245 --- /dev/null +++ b/pkg/watch/logger/empty/logger.go @@ -0,0 +1,24 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package empty + +// cronLogger implement the cron.Logger interface. +type cronLogger struct{} + +// NewLogger returns a cron logger. +func NewLogger() *cronLogger { + return &cronLogger{} +} + +// Debug logs an debug condition. +func (l *cronLogger) Debug(msg string, keysAndValues ...any) {} + +// Info logs routine messages about cron's operation. +func (l *cronLogger) Info(msg string, keysAndValues ...any) {} + +// Error logs an error condition. +func (l *cronLogger) Error(err error, msg string, keysAndValues ...any) {} diff --git a/internal/nightwatch/logger.go b/pkg/watch/logger/onex/logger.go similarity index 75% rename from internal/nightwatch/logger.go rename to pkg/watch/logger/onex/logger.go index 8ccead3bcf4..f973dcd936d 100644 --- a/internal/nightwatch/logger.go +++ b/pkg/watch/logger/onex/logger.go @@ -4,7 +4,7 @@ // this file is https://github.com/superproj/onex. // -package nightwatch +package onex import ( "github.com/superproj/onex/pkg/log" @@ -13,11 +13,16 @@ import ( // cronLogger implement the cron.Logger interface. type cronLogger struct{} -// newCronLogger returns a cron logger. -func newCronLogger() *cronLogger { +// NewLogger returns a cron logger. +func NewLogger() *cronLogger { return &cronLogger{} } +// Debug logs routine messages about cron's operation. +func (l *cronLogger) Debug(msg string, keysAndValues ...any) { + log.Debugw(msg, keysAndValues...) +} + // Info logs routine messages about cron's operation. func (l *cronLogger) Info(msg string, keysAndValues ...any) { log.Infow(msg, keysAndValues...) diff --git a/pkg/watch/options.go b/pkg/watch/options.go new file mode 100644 index 00000000000..92a5147fead --- /dev/null +++ b/pkg/watch/options.go @@ -0,0 +1,37 @@ +// Copyright 2022 Lingfei Kong . All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. The original repo for +// this file is https://github.com/superproj/onex. +// + +package watch + +import ( + "github.com/spf13/pflag" +) + +// Options contains everything necessary to create and run a watch server. +type Options struct { + DisableWatchers []string `json:"disable-watchers" mapstructure:"disable-watchers"` +} + +// NewOptions returns initialized Options. +func NewOptions() *Options { + o := &Options{ + DisableWatchers: []string{}, + } + + return o +} + +// Flags returns flags for a specific server by section name. +func (o *Options) AddFlags(fs *pflag.FlagSet) { + fs.StringSliceVar(&o.DisableWatchers, "disable-watchers", o.DisableWatchers, "The list of watchers that should be disabled.") +} + +// Validate validates all the required options. +func (o *Options) Validate() []error { + errs := []error{} + + return errs +} diff --git a/pkg/watch/watch.go b/pkg/watch/watch.go new file mode 100644 index 00000000000..9796f46ab38 --- /dev/null +++ b/pkg/watch/watch.go @@ -0,0 +1,169 @@ +package watch + +import ( + "context" + "errors" + "time" + + "github.com/go-redsync/redsync/v4" + "github.com/go-redsync/redsync/v4/redis/goredis/v9" + "github.com/redis/go-redis/v9" + "github.com/robfig/cron/v3" + + stringsutil "github.com/superproj/onex/pkg/util/strings" + "github.com/superproj/onex/pkg/watch/logger/empty" +) + +var ( + defaultLockName = "watch-lock" + jobStopTimeout = 3 * time.Minute + extendExpiration = 5 * time.Second + defaultExpiration = 10 * extendExpiration +) + +// Option configures a framework.Registry. +type Option func(nw *Watch) + +// Watch represents a monitoring system that schedules and runs tasks at specified intervals. +type Watch struct { + // Scheduler for running tasks + runner *cron.Cron + // Logger for logging + logger Logger + // Distributed lock name for watch server + lockName string + // distributed lock + locker *redsync.Mutex + // Distributed lock for ensuring only one instance runs at a time + disableWatchers []string + // Function for initializing watchers + initializer WatcherInitializer +} + +// WithInitialize returns an Option function that sets the provided WatcherInitializer function to initialize the Watch. +func WithInitialize(initialize WatcherInitializer) Option { + return func(nw *Watch) { + nw.initializer = initialize + } +} + +// WithLogger returns an Option function that sets the provided Logger to the Watch for logging purposes. +func WithLogger(logger Logger) Option { + return func(nw *Watch) { + nw.logger = logger + } +} + +// WithLockName returns an Option function that sets the provided lockName to the Watch. +func WithLockName(lockName string) Option { + return func(nw *Watch) { + nw.lockName = lockName + } +} + +// NewWatch creates a new Watch monitoring system with the provided options. +func NewWatch(opts *Options, client *redis.Client, withOptions ...Option) (*Watch, error) { + logger := empty.NewLogger() + // Create with default options + nw := &Watch{lockName: defaultLockName, logger: logger, disableWatchers: opts.DisableWatchers} + + // Set with custom options + for _, opt := range withOptions { + opt(nw) + } + + nw.runner = cron.New( + cron.WithSeconds(), + cron.WithLogger(nw.logger), + cron.WithChain(cron.SkipIfStillRunning(nw.logger), cron.Recover(nw.logger)), + ) + + // Create a pool with go-redis which is the pool redisync will + // use while communicating with Redis. This can also be any pool that + // implements the `redis.Pool` interface. + pool := goredis.NewPool(client) + lockOpts := []redsync.Option{ + redsync.WithRetryDelay(50 * time.Microsecond), + redsync.WithTries(3), + redsync.WithExpiry(defaultExpiration), + } + // Create an instance of redisync and obtain a new mutex by using the same name + // for all instances wanting the same lock. + nw.locker = redsync.New(pool).NewMutex(nw.lockName, lockOpts...) + + if err := nw.addWatchers(); err != nil { + return nil, err + } + + return nw, nil +} + +// addWatchers used to initialize all registered watchers and add the watchers as a Cron job. +func (nw *Watch) addWatchers() error { + for n, w := range ListWatchers() { + if stringsutil.StringIn(n, nw.disableWatchers) { + continue + } + + if nw.initializer != nil { + nw.initializer.Initialize(w) + } + + spec := Every3Seconds + if obj, ok := w.(ISpec); ok { + spec = obj.Spec() + } + + if _, err := nw.runner.AddJob(spec, w); err != nil { + nw.logger.Error(err, "Failed to add job to the cron", "watcher", n) + return err + } + } + + return nil +} + +// Run keep retrying to acquire lock and then start the Cron job. +func (nw *Watch) Start(ctx context.Context) { + ticker := time.NewTicker(defaultExpiration + (5 * time.Second)) + for { + // Obtain a lock for our given mutex. After this is successful, no one else + // can obtain the same lock (the same mutex name) until we unlock it. + err := nw.locker.LockContext(ctx) + if err == nil { + nw.logger.Debug("Successfully acquired lock", "lockName", nw.lockName) + break + } + nw.logger.Debug("Failed to acquire lock.", "lockName", nw.lockName, "err", err) + <-ticker.C + } + + go func() { + ticker := time.NewTicker(extendExpiration) + for { + <-ticker.C + if ok, err := nw.locker.ExtendContext(ctx); !ok || err != nil { + nw.logger.Debug("Failed to extend mutex", "err", err, "status", ok) + } + } + }() + + nw.runner.Start() + nw.logger.Info("Successfully started watch server") +} + +// Stop used to blocking waits for the job to complete and releases the lock. +func (nw *Watch) Stop() { + ctx := nw.runner.Stop() + select { + case <-ctx.Done(): + case <-time.After(jobStopTimeout): + nw.logger.Error(errors.New("context was not done immediately"), "timeout", jobStopTimeout.String()) + } + + if ok, err := nw.locker.Unlock(); !ok || err != nil { + nw.logger.Debug("Failed to unlock", "err", err, "status", ok) + } + + nw.logger.Info("Successfully stopped watch server") +} diff --git a/internal/nightwatch/watcher/watcher.go b/pkg/watch/watcher.go similarity index 89% rename from internal/nightwatch/watcher/watcher.go rename to pkg/watch/watcher.go index 421b616d88f..32534f74a76 100644 --- a/internal/nightwatch/watcher/watcher.go +++ b/pkg/watch/watcher.go @@ -4,16 +4,13 @@ // this file is https://github.com/superproj/onex. // -package watcher +package watch import ( - "context" "errors" "sync" "github.com/robfig/cron/v3" - - reflectutil "github.com/superproj/onex/pkg/util/reflect" ) const ( @@ -22,7 +19,6 @@ const ( // Watcher is the interface for watchers. It use cron job as a scheduling engine. type Watcher interface { - Init(ctx context.Context, config *Config) error cron.Job } @@ -49,11 +45,10 @@ var ( ) // Register registers a watcher and save in global variable `registry`. -func Register(watcher Watcher) { +func Register(name string, watcher Watcher) { registryLock.Lock() defer registryLock.Unlock() - name := reflectutil.StructName(watcher) if _, ok := registry[name]; ok { panic("duplicate watcher entry: " + name) } diff --git a/scripts/_update-generated-proto-bindings-dockerized.sh b/scripts/_update-generated-proto-bindings-dockerized.sh new file mode 100755 index 00000000000..0773d32b277 --- /dev/null +++ b/scripts/_update-generated-proto-bindings-dockerized.sh @@ -0,0 +1,52 @@ +#!/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. + +# This script generates `*/api.pb.go` files from protobuf files `*/api.proto`. + +set -o errexit +set -o nounset +set -o pipefail + +ONEX_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../" && pwd -P)" + +source "${ONEX_ROOT}/scripts/lib/init.sh" +source "${ONEX_ROOT}/scripts/lib/protoc.sh" +source "${ONEX_ROOT}/scripts/lib/util.sh" + +if [ "$#" == 0 ]; then + echo "usage: $0 ..." + exit 1 +fi + +kube::protoc::check_protoc + +for api; do + # This can't use `git ls-files` because it runs in a container without the + # .git dir synced. + protos=() + kube::util::read-array protos < <( \ + find "${api}" -type f -name "api.proto") + + if [ "${#protos[@]}" == 0 ]; then + echo "ERROR: no 'api.proto' files under '${api}'" + exit 1 + fi + + for file in "${protos[@]}"; do + dir="$(dirname "${file}")" + kube::protoc::generate_proto "${dir}" + done +done diff --git a/scripts/update-generated-protobuf-dockerized.sh b/scripts/_update-generated-protobuf-dockerized.sh similarity index 69% rename from scripts/update-generated-protobuf-dockerized.sh rename to scripts/_update-generated-protobuf-dockerized.sh index a90f5e345fe..1475c55039c 100755 --- a/scripts/update-generated-protobuf-dockerized.sh +++ b/scripts/_update-generated-protobuf-dockerized.sh @@ -16,7 +16,7 @@ # This script genertates `*/api.pb.go` from the protobuf file `*/api.proto`. # Usage: -# hack/update-generated-protobuf-dockerized.sh "${APIROOTS[@]}" +# scripts/update-generated-protobuf-dockerized.sh "${APIROOTS[@]}" # An example APIROOT is: "k8s.io/api/admissionregistration/v1" set -o errexit @@ -30,17 +30,23 @@ source "${ONEX_ROOT}/scripts/lib/protoc.sh" onex::protoc::check_protoc onex::golang::setup_env -GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf -GO111MODULE=on GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo +if ! command -v go-to-protobuf &> /dev/null ; then + GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf +fi -gotoprotobuf=go-to-protobuf +if ! command -v protoc-gen-gogo &> /dev/null ; then + GOPROXY=off go install k8s.io/code-generator/cmd/go-to-protobuf/protoc-gen-gogo +fi # requires the 'proto' tag to build (will remove when ready) # searches for the protoc-gen-gogo extension in the output directory # satisfies import of github.com/gogo/protobuf/gogoproto/gogo.proto and the # core Google protobuf types PATH="${ONEX_ROOT}/_output/bin:${PATH}" \ - "${gotoprotobuf}" \ - --proto-import="${ONEX_ROOT}/third_party" \ - --packages="$(IFS=, ; echo "$*")" \ - --go-header-file "${ONEX_ROOT}/scripts/boilerplate.go.txt" + go-to-protobuf \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${ONEX_ROOT}/scripts/boilerplate/boilerplate.generatego.txt" \ + --proto-import="${ONEX_ROOT}/third_party/protobuf" \ + --proto-import="${GOPATH}/src" \ + --output-dir="${GOPATH}/src" \ + --packages="$(IFS=, ; echo "$*")" diff --git a/scripts/boilerplate.go.txt b/scripts/boilerplate/boilerplate.generatego.txt similarity index 100% rename from scripts/boilerplate.go.txt rename to scripts/boilerplate/boilerplate.generatego.txt diff --git a/internal/apiserver/doc.go b/scripts/boilerplate/boilerplate.go.txt similarity index 75% rename from internal/apiserver/doc.go rename to scripts/boilerplate/boilerplate.go.txt index 551127f1257..eb7763bdf25 100644 --- a/internal/apiserver/doc.go +++ b/scripts/boilerplate/boilerplate.go.txt @@ -1,7 +1,5 @@ // Copyright 2022 Lingfei Kong . All rights reserved. // Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for +// license that can be found in the LICENSE file. The original repo for // this file is https://github.com/superproj/onex. -// -package apiserver // import "github.com/superproj/onex/pkg/apiserver" diff --git a/scripts/boilerplate.txt b/scripts/boilerplate/boilerplate.txt similarity index 100% rename from scripts/boilerplate.txt rename to scripts/boilerplate/boilerplate.txt diff --git a/scripts/fix-generated.sh b/scripts/fix-generated-client.sh similarity index 100% rename from scripts/fix-generated.sh rename to scripts/fix-generated-client.sh diff --git a/scripts/gen-certs.sh b/scripts/gen-certs.sh index 2953d7b2bb5..e2fa178f6f9 100755 --- a/scripts/gen-certs.sh +++ b/scripts/gen-certs.sh @@ -14,7 +14,9 @@ source "${ONEX_ROOT}/scripts/lib/init.sh" # OUT_DIR can come in from the Makefile, so honor it. readonly LOCAL_OUTPUT_ROOT="${ONEX_ROOT}/${OUT_DIR:-_output}" readonly LOCAL_OUTPUT_CAPATH="${LOCAL_OUTPUT_ROOT}/cert" -readonly ONEX_DOMAIN="onex.io" +readonly PROJ_DOMAIN="superproj.com" +# To ensure that access is available in the default k8s cluster (with cluster domain as cluster.local). +readonly DEFAULT_KUBERNETES_CLUSTER_DOMAIN="cluster.local" # Hostname for the cert #readonly CERT_HOSTNAME="${CERT_HOSTNAME:-onex-apiserver},127.0.0.1,localhost," @@ -85,7 +87,7 @@ EOF fi if [[ ! -r "ca.pem" || ! -r "ca-key.pem" ]]; then - ${CFSSL_BIN} gencert -loglevel 2 -initca ca-csr.json | ${CFSSLJSON_BIN} -bare ca - + ${CFSSL_BIN} gencert -initca ca-csr.json | ${CFSSLJSON_BIN} -bare ca - fi if [[ -z "${prefix}" ]];then @@ -94,7 +96,7 @@ EOF #echo "Generate "${prefix}" certificates..." echo '{"CN":"'"${prefix}"'","hosts":[],"key":{"algo":"rsa","size":2048},"names":[{"C":"CN","ST":"Shenzhen","L":"Shenzhen","O":"tencent","OU":"'"${prefix}"'"}]}' \ - | ${CFSSL_BIN} gencert -loglevel 2 -hostname="${CERT_HOSTNAME},${prefix/-/.}.${ONEX_DOMAIN}" -ca=ca.pem -ca-key=ca-key.pem \ + | ${CFSSL_BIN} gencert -hostname="${CERT_HOSTNAME},${prefix/-/.}.${DEFAULT_KUBERNETES_CLUSTER_DOMAIN},${prefix/-/.}.${PROJ_DOMAIN}" -ca=ca.pem -ca-key=ca-key.pem \ -config=ca-config.json -profile=node - | ${CFSSLJSON_BIN} -bare "${prefix}" # the popd will access `directory stack`, no `real` parameters is actually needed diff --git a/scripts/installation/etcd.sh b/scripts/installation/etcd.sh index 8cbe88ff84b..715a38aa1ad 100755 --- a/scripts/installation/etcd.sh +++ b/scripts/installation/etcd.sh @@ -22,6 +22,7 @@ onex::etcd::docker::install() { onex::common::network docker run -d --name onex-etcd \ + --restart always \ --network onex \ -v ${ONEX_ETCD_DIR}:/etcd-data \ -p ${ONEX_ACCESS_HOST}:${ONEX_ETCD_CLIENT_PORT}:2379 \ diff --git a/scripts/installation/jaeger.sh b/scripts/installation/jaeger.sh index 8372c41e6fb..365d7c2112f 100755 --- a/scripts/installation/jaeger.sh +++ b/scripts/installation/jaeger.sh @@ -19,6 +19,7 @@ onex::jaeger::docker::install() { onex::common::network docker run -d --name onex-jaeger \ + --restart always \ --network onex \ -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \ -p ${ONEX_ACCESS_HOST}:6831:6831/udp \ diff --git a/scripts/installation/kafka.sh b/scripts/installation/kafka.sh index 1834f435adc..0b29e394e54 100755 --- a/scripts/installation/kafka.sh +++ b/scripts/installation/kafka.sh @@ -19,8 +19,9 @@ ONEX_KAFKA_PORT=${ONEX_KAFKA_PORT:-4317} onex::kafka::docker::install() { onex::common::network - docker run -d --name onex-zookeeper --network onex -p 2181:2181 -t wurstmeister/zookeeper + docker run -d --restart always --name onex-zookeeper --network onex -p 2181:2181 -t wurstmeister/zookeeper docker run -d --name onex-kafka --link onex-zookeeper:zookeeper \ + --restart always \ --network onex \ --restart=always \ -v /etc/localtime:/etc/localtime \ diff --git a/scripts/installation/mariadb.sh b/scripts/installation/mariadb.sh index ac5ed841a93..ac0a22e008a 100755 --- a/scripts/installation/mariadb.sh +++ b/scripts/installation/mariadb.sh @@ -12,7 +12,7 @@ ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. [[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh # Set some environment variables. ONEX_MYSQL_HOST=${ONEX_MYSQL_HOST:-127.0.0.1} -ONEX_MYSQL_PORT=${ONEX_MYSQL_PORT:-6379} +ONEX_MYSQL_PORT=${ONEX_MYSQL_PORT:-3306} ONEX_PASSWORD=${ONEX_PASSWORD:-onex(#)666} # Install mariadb using containerization. @@ -23,6 +23,7 @@ onex::mariadb::docker::install() onex::common::network docker run -d --name onex-mariadb \ + --restart always \ --network onex \ -v ${ONEX_THIRDPARTY_INSTALL_DIR}/mariadb:/var/lib/mysql \ -p ${ONEX_ACCESS_HOST}:${ONEX_MYSQL_PORT}:3306 \ diff --git a/scripts/installation/middleware/jaeger.sh b/scripts/installation/middleware/jaeger.sh new file mode 100755 index 00000000000..365d7c2112f --- /dev/null +++ b/scripts/installation/middleware/jaeger.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +ONEX_JAEGER_HOST=${ONEX_JAEGER_HOST:-127.0.0.1} +ONEX_JAEGER_PORT=${ONEX_JAEGER_PORT:-4317} + +# Install Jaeger using containerization. +onex::jaeger::docker::install() +{ + onex::common::network + docker run -d --name onex-jaeger \ + --restart always \ + --network onex \ + -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 \ + -p ${ONEX_ACCESS_HOST}:6831:6831/udp \ + -p ${ONEX_ACCESS_HOST}:6832:6832/udp \ + -p ${ONEX_ACCESS_HOST}:5778:5778 \ + -p ${ONEX_ACCESS_HOST}:16686:16686 \ + -p ${ONEX_ACCESS_HOST}:${ONEX_JAEGER_PORT}:4317 \ + -p ${ONEX_ACCESS_HOST}:4318:4318 \ + -p ${ONEX_ACCESS_HOST}:14250:14250 \ + -p ${ONEX_ACCESS_HOST}:14268:14268 \ + -p ${ONEX_ACCESS_HOST}:14269:14269 \ + -p ${ONEX_ACCESS_HOST}:9411:9411 \ + jaegertracing/all-in-one:1.52 + + sleep 2 + onex::jaeger::status || return 1 + onex::jaeger::info + onex::log::info "install jaeger successfully" +} + +# Uninstall the docker container. +onex::jaeger::docker::uninstall() +{ + docker rm -f onex-jaeger &>/dev/null + onex::log::info "uninstall jaeger successfully" +} + +# Install the jaeger step by step. +# sbs is the abbreviation for "step by step". +onex::jaeger::sbs::install() +{ + onex::jaeger::docker::install + onex::log::info "install jaeger successfully" +} + +# Uninstall the jaeger step by step. +onex::jaeger::sbs::uninstall() +{ + onex::jaeger::docker::uninstall + onex::log::info "uninstall jaeger successfully" +} + +# Print necessary information after docker or sbs installation. +onex::jaeger::info() +{ + echo -e ${C_GREEN}Jaeger has been installed, here are some useful information:${C_NORMAL} + cat << EOF | sed 's/^/ /' +OpenTelemetry Protocol (OTLP) over gRPC Endpoint: ${ONEX_JAEGER_HOST}:${ONEX_JAEGER_PORT} +EOF +} + +# Status check after docker or sbs installation. +onex::jaeger::status() +{ + onex::util::telnet ${ONEX_JAEGER_HOST} ${ONEX_JAEGER_PORT} || return 1 +} + +if [[ "$*" =~ onex::jaeger:: ]]; then + eval $* +fi diff --git a/scripts/installation/middleware/kafka.sh b/scripts/installation/middleware/kafka.sh new file mode 100755 index 00000000000..0b29e394e54 --- /dev/null +++ b/scripts/installation/middleware/kafka.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +ONEX_KAFKA_HOST=${ONEX_KAFKA_HOST:-127.0.0.1} +ONEX_KAFKA_PORT=${ONEX_KAFKA_PORT:-4317} + +# Install kafka using containerization. +# Refer to https://www.baeldung.com/ops/kafka-docker-setup +onex::kafka::docker::install() +{ + onex::common::network + docker run -d --restart always --name onex-zookeeper --network onex -p 2181:2181 -t wurstmeister/zookeeper + docker run -d --name onex-kafka --link onex-zookeeper:zookeeper \ + --restart always \ + --network onex \ + --restart=always \ + -v /etc/localtime:/etc/localtime \ + -p ${ONEX_KAFKA_HOST}:${ONEX_KAFKA_PORT}:9092 \ + --env KAFKA_ZOOKEEPER_CONNECT=zookeeper:2181 \ + --env KAFKA_ADVERTISED_HOST_NAME=${ONEX_KAFKA_HOST} \ + --env KAFKA_ADVERTISED_PORT=${ONEX_KAFKA_PORT} \ + wurstmeister/kafka + + echo "Sleeping to wait for onex-kafka container to complete startup ..." + sleep 5 + onex::kafka::status || return 1 + onex::kafka::info + onex::log::info "install kafka successfully" +} + +# Uninstall the docker container. +onex::kafka::docker::uninstall() +{ + docker rm -f onex-zookeeper &>/dev/null + docker rm -f onex-kafka &>/dev/null + onex::log::info "uninstall kafka successfully" +} + +# Install the kafka step by step. +# sbs is the abbreviation for "step by step". +# Refer to https://kafka.apache.org/documentation/#quickstart +onex::kafka::sbs::install() +{ + onex::kafka::docker::install + onex::log::info "install kafka successfully" +} + +# Uninstall the kafka step by step. +onex::kafka::sbs::uninstall() +{ + onex::kafka::docker::uninstall + onex::log::info "uninstall kafka successfully" +} + +# Print necessary information after docker or sbs installation. +onex::kafka::info() +{ + echo -e ${C_GREEN}kafka has been installed, here are some useful information:${C_NORMAL} + cat << EOF | sed 's/^/ /' +Kafka brokers is: ${ONEX_KAFKA_HOST}:${ONEX_KAFKA_PORT} +EOF +} + +# Status check after docker or sbs installation. +onex::kafka::status() +{ + onex::util::telnet ${ONEX_KAFKA_HOST} ${ONEX_KAFKA_PORT} || return 1 +} + +if [[ $* =~ onex::kafka:: ]]; then + eval $* +fi diff --git a/scripts/installation/mongo.sh b/scripts/installation/mongo.sh index af6b8e4fc66..ccf0361d6b6 100755 --- a/scripts/installation/mongo.sh +++ b/scripts/installation/mongo.sh @@ -28,6 +28,7 @@ onex::mongo::docker::install() onex::common::network docker run -d --name onex-mongo \ + --restart always \ --network onex \ -v ${ONEX_THIRDPARTY_INSTALL_DIR}/mongo:/data \ -p ${ONEX_ACCESS_HOST}:${ONEX_MONGO_PORT}:27017 \ @@ -44,8 +45,11 @@ onex::mongo::docker::install() onex::mongo::pre_install() { + # 获取 MongoDB 公钥 + echo ${LINUX_PASSWORD} | sudo -S wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add - + # 添加 MongoDB APT 源 - echo ${LINUX_PASSWORD} | sudo -S echo "deb [arch=amd64,arm64] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list + echo ${LINUX_PASSWORD} | sudo -S echo "deb [arch=amd64,arm64] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list # 安装libssl1.1,否则安装 mongo 时会报以下错误: # mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1) but it is not installable @@ -74,9 +78,6 @@ onex::mongo::sbs::install() echo ${LINUX_PASSWORD} | sudo -S apt install -y gnupg - # 获取 MongoDB 公钥 - echo ${LINUX_PASSWORD} | sudo -S wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add - - # 安装 MongoDB 服务端 # 以为我们uninstall时会删除配置文件,所以要使用--force-confmiss 重新安装配置文件 onex::util::sudo "apt -y -o Dpkg::Options::="--force-confmiss" --reinstall install mongodb-org mongodb-org-server" diff --git a/scripts/installation/onex.sh b/scripts/installation/onex.sh index e7828790b4e..6f99ddd6e41 100755 --- a/scripts/installation/onex.sh +++ b/scripts/installation/onex.sh @@ -41,6 +41,7 @@ onex::onex::docker::install() # "Failed to get D-Bus connection: Operation not permitted" onex::common::network docker run -d --name onex \ + --restart always \ --network onex \ --privileged \ -v onex-volume:${ONEX_INSTALL_DIR}:rw \ @@ -249,8 +250,8 @@ onex::onex::prepare() pushd "${ONEX_ROOT}" >/dev/null 2>&1 # 2. 配置 $HOME/.bashrc 添加一些便捷入口 - if ! grep -q 'Alias for onex quick access' $HOME/.bashrc; then - cat << 'EOF' >> $HOME/.bashr + if ! grep -q 'Alias and environments for onex quick access' $HOME/.bashrc; then + cat << 'EOF' >> $HOME/.bashrc # Alias and environments for onex quick access export GOSRC="$WORKSPACE/golang/src" # OneX project root directory, used in many places. diff --git a/scripts/installation/onex/common.sh b/scripts/installation/onex/common.sh new file mode 100755 index 00000000000..e63a51c075f --- /dev/null +++ b/scripts/installation/onex/common.sh @@ -0,0 +1,38 @@ +#!/bin/bash +# +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# Common utilities, variables and checks for all build scripts. +set -eEuo pipefail + +# The root of the build/dist directory +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. + +# 所有的 OneX 都会统一加载 scripts/common.sh 脚本 +source "${ONEX_ROOT}/scripts/common.sh" + +# 设置 ONEX_ENV_FILE(重要) +ONEX_ENV_FILE=${ONEX_ENV_FILE:-${ONEX_ROOT}/manifests/env.local} +# 加载本地安装环境变量(非常重要的一步,后面很多步骤都依赖于env.local中的变量设置) +source ${ONEX_ENV_FILE} + +COMMON_SOURCED=true # Sourced flag + +# 设置本地/容器化安装的环境变量,主要是为了避免端口冲突 +export ONEX_CONTROLLER_MANAGER_METRICS_PORT=59081 +export ONEX_CONTROLLER_MANAGER_HEALTHZ_PORT=59082 +export ONEX_MINERSET_CONTROLLER_METRICS_PORT=60081 +export ONEX_MINERSET_CONTROLLER_HEALTHZ_PORT=60082 +export ONEX_MINER_CONTROLLER_METRICS_PORT=61081 +export ONEX_MINER_CONTROLLER_HEALTHZ_PORT=61082 + +# 确保 onex 容器网络存在。 +# 在 uninstall 时,可不删除 onex 容器网络,可以作为一个无害的无用数据 +onex::common::network() +{ + docker network ls |grep -q onex || docker network create onex +} diff --git a/scripts/installation/onex/install.sh b/scripts/installation/onex/install.sh new file mode 100755 index 00000000000..2c46bb07c54 --- /dev/null +++ b/scripts/installation/onex/install.sh @@ -0,0 +1,178 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +INSTALL_DIR=${ONEX_ROOT}/scripts/installation + +source ${INSTALL_DIR}/jaeger.sh +source ${INSTALL_DIR}/kafka.sh +source ${INSTALL_DIR}/mariadb.sh +source ${INSTALL_DIR}/mongo.sh +source ${INSTALL_DIR}/redis.sh +source ${INSTALL_DIR}/etcd.sh +source ${INSTALL_DIR}/onex.sh +source ${INSTALL_DIR}/test.sh + +# OneX 容器化快速安装 +onex::install::docker::install() +{ + # 安装前置依赖 + onex::install::pre_install + + # 安装存储组件 + onex::install::storage::docker::install + + # 安装中间件 + onex::install::middleware::docker::install + + # 安装 OneX 各组件 + onex::onex::docker::install + + # 等待所有服务启动 + echo "Sleeping to wait for all onex container to complete startup ..." + sleep 10 + # 安装后测试 + onex::test::test +} + +# OneX 安装前的一些前置处理 +onex::install::pre_install() +{ + # 为了确保 Debian 系统具有最新的安全补丁和软件,这里先更新系统软件包。 + # 如果你要做存量软件的版本升级,可以执行`sudo apt upgrade`,但不建议 + # `apt update` 命令会更新系统中的软件包版本 + onex::util::sudo "apt update" + + onex::util::sudo "apt install -y software-properties-common dirmngr apt-transport-https" + + # 配置 hosts + if ! egrep -q 'onex.*.superproj.com' /etc/hosts; then + echo ${LINUX_PASSWORD} | sudo -S cat << EOF | sudo tee -a /etc/hosts + +# host configs for onex project +${ONEX_ACCESS_HOST} onex.usercenter.superproj.com +${ONEX_ACCESS_HOST} onex.gateway.superproj.com +${ONEX_ACCESS_HOST} onex.apiserver.superproj.com +${ONEX_ACCESS_HOST} onex.nightwatch.superproj.com +${ONEX_ACCESS_HOST} onex.pump.superproj.com +EOF + fi +} + +# OneX 幂等卸载,注意卸载顺序 +onex::install::docker::uninstall() +{ + onex::onex::docker::uninstall || true + onex::install::middleware::docker::uninstall || true + onex::install::storage::docker::uninstall || true + + # 删除安装目录 + onex::util::sudo "rm -rf ${ONEX_INSTALL_DIR}" + onex::util::sudo "rm -rf ${ONEX_THIRDPARTY_INSTALL_DIR}" + + # 卸载 onex 网络,始终返回成功 + docker network rm onex &>/dev/null || true +} + +# 安装所有的存储组件 +onex::install::storage::docker::install() +{ + onex::mariadb::docker::install + onex::redis::docker::install + onex::mongo::docker::install + onex::etcd::docker::install +} + +# 卸载所有的存储组件 +onex::install::storage::docker::uninstall() +{ + onex::mariadb::docker::uninstall + onex::redis::docker::uninstall + onex::mongo::docker::uninstall + onex::etcd::docker::uninstall +} + +# 安装其他中间件 +onex::install::middleware::docker::install() +{ + onex::jaeger::docker::install + onex::kafka::docker::install +} + +# 卸载其他中间件 +onex::install::middleware::docker::uninstall() +{ + onex::jaeger::docker::uninstall + onex::kafka::docker::uninstall +} + +# OneX 脚本自动化安装 +# 你可以直接阅读安装脚本,学习安装的所有细节 +# 有些组件本地化手动安装会比较复杂,仍然会采用容器化安装,比如:kafka。 +onex::install::sbs::install() +{ + onex::install::pre_install + onex::install::storage::sbs::install + onex::install::middleware::sbs::install + onex::onex::sbs::install + + # 等待所有服务启动 + echo "Sleeping to wait for all onex container to complete startup ..." + sleep 10 + onex::test::test +} + +# OneX 幂等卸载,注意卸载顺序 +onex::install::sbs::uninstall() +{ + onex::onex::sbs::uninstall || true + onex::install::middleware::sbs::uninstall || true + onex::install::storage::sbs::uninstall || true + onex::util::sudo "rm -rf ${ONEX_INSTALL_DIR}" +} + +# 安装所有的存储组件 +onex::install::storage::sbs::install() +{ + onex::mariadb::sbs::install + onex::redis::sbs::install + onex::mongo::sbs::install + onex::etcd::sbs::install +} + +# 卸载所有的存储组件 +onex::install::storage::sbs::uninstall() +{ + onex::mariadb::sbs::uninstall + onex::redis::sbs::uninstall + onex::mongo::sbs::uninstall + onex::etcd::sbs::uninstall +} + +# 安装其他中间件 +# 因为 jaeger 和 kafka 手动安装比较复杂,这里仍然采用 docker 安装 +onex::install::middleware::sbs::install() +{ + onex::jaeger::docker::install + onex::kafka::docker::install +} + +# 卸载其他中间件 +onex::install::middleware::sbs::uninstall() +{ + onex::jaeger::sbs::uninstall + onex::kafka::sbs::uninstall +} + +if [[ "$*" =~ onex::install:: ]]; then + eval $* +fi diff --git a/scripts/installation/onex/man.sh b/scripts/installation/onex/man.sh new file mode 100755 index 00000000000..61da87184b3 --- /dev/null +++ b/scripts/installation/onex/man.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +# Copyright 2020 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh + +# 安装后打印必要的信息 +onex::man::info() { +cat << EOF +use: man onex-xxx to see onex-xxx help. +EOF +} + +# 安装 +onex::man::install() +{ + pushd ${ONEX_ROOT} + + # 生成各个组件的 man1 文件 + ${ONEX_ROOT}/scripts/update-generated-docs.sh + onex::util::sudo "cp docs/man/man1/* /usr/share/man/man1/" + onex::man::status || return 1 + onex::man::info + + onex::log::info "install man pages successfully" + popd +} + +# 卸载 +onex::man::uninstall() +{ + onex::util::sudo "rm -f /usr/share/man/man1/onex-*" + onex::log::info "uninstall onex man pages successfully" +} + +# 状态检查 +onex::man::status() +{ + ls /usr/share/man/man1/onex-* &>/dev/null || { + onex::log::error "onex man files not exist, maybe not installed properly" + return 1 + } +} + +if [[ $* =~ onex::man:: ]]; then + eval $* +fi diff --git a/scripts/installation/onex/onex.sh b/scripts/installation/onex/onex.sh new file mode 100755 index 00000000000..6f99ddd6e41 --- /dev/null +++ b/scripts/installation/onex/onex.sh @@ -0,0 +1,297 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. + +source $(dirname "${BASH_SOURCE[0]}")/man.sh + +# Install onex using containerization. +onex::onex::docker::install() +{ + onex::onex::prepare + + if [[ "${INSTALL_WITH_FRESH_IMAGE}" -eq 1 ]];then + make -C ${ONEX_ROOT} image IMAGES=onex-allinone VERSION=${ONEX_IMAGE_VERSION} + fi + + # 创建一个数据卷,将 onex 容器中的安装目录挂载到宿主机上 + onex::util::sudo "mkdir -p ${ONEX_INSTALL_DIR}" + # docker 命名卷挂在规则: + # 1. 如果host目录为空(目录可以存在,但里面不能有文件),容器目录不为空, + # 则将容器目录内容先复制到host目录,再以host目录为主 + # 2. 如果host目录不为空,则以host目录位置 + # 为了将 onex 容器中 /opt/onex 目录内容挂载到 host 上的 /opt/onex 目录,方便更新容器中的安装文件 + # 需要将存储组件的数据保存在类似 /data/onex.thirdpart 目录下,而非:/opt/onex/thirdpart 目录下 + # 并且,再创建时,要确保 /opt/onex 目录下内容为空 + # 请参考:https://stackoverflow.com/questions/66474191/how-does-volume-mount-from-container-to-host-and-vice-versa-work + docker volume create --driver local -o type=none -o device=${ONEX_INSTALL_DIR} -o o=bind onex-volume + + echo "Create onex using ccr.ccs.tencentyun.com/superproj/onex-allinone-amd64:${ONEX_IMAGE_VERSION}" + # 启动 onex 容器 + # 注意:启动时需要通过 --privileged 容器 root 权限,否则可能会报以下错误: + # "Failed to get D-Bus connection: Operation not permitted" + onex::common::network + docker run -d --name onex \ + --restart always \ + --network onex \ + --privileged \ + -v onex-volume:${ONEX_INSTALL_DIR}:rw \ + -p ${ONEX_ACCESS_HOST}:${ONEX_FAKESERVER_HTTP_PORT}:${ONEX_FAKESERVER_HTTP_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_FAKESERVER_GRPC_PORT}:${ONEX_FAKESERVER_GRPC_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_USERCENTER_HTTP_PORT}:${ONEX_USERCENTER_HTTP_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_USERCENTER_GRPC_PORT}:${ONEX_USERCENTER_GRPC_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_APISERVER_SECURE_PORT}:${ONEX_APISERVER_SECURE_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_GATEWAY_HTTP_PORT}:${ONEX_GATEWAY_HTTP_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_GATEWAY_GRPC_PORT}:${ONEX_GATEWAY_GRPC_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_NIGHTWATCH_HEALTH_CHECK_PORT}:${ONEX_NIGHTWATCH_HEALTH_CHECK_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_PUMP_HEALTH_CHECK_PORT}:${ONEX_PUMP_HEALTH_CHECK_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_CACHESERVER_GRPC_PORT}:${ONEX_CACHESERVER_GRPC_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_CONTROLLER_MANAGER_METRICS_PORT}:${ONEX_CONTROLLER_MANAGER_METRICS_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_CONTROLLER_MANAGER_HEALTHZ_PORT}:${ONEX_CONTROLLER_MANAGER_HEALTHZ_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_MINERSET_CONTROLLER_METRICS_PORT}:${ONEX_MINERSET_CONTROLLER_METRICS_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_MINERSET_CONTROLLER_HEALTHZ_PORT}:${ONEX_MINERSET_CONTROLLER_HEALTHZ_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_MINER_CONTROLLER_METRICS_PORT}:${ONEX_MINER_CONTROLLER_METRICS_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_MINER_CONTROLLER_HEALTHZ_PORT}:${ONEX_MINER_CONTROLLER_HEALTHZ_PORT} \ + -p ${ONEX_ACCESS_HOST}:${ONEX_TOYBLC_HTTP_PORT}:${ONEX_TOYBLC_HTTP_PORT} \ + ccr.ccs.tencentyun.com/superproj/onex-allinone-amd64:${ONEX_IMAGE_VERSION} + onex::onex::info +} + +# Uninstall the docker container. +onex::onex::docker::uninstall() +{ + docker rm -f onex &>/dev/null + docker volume rm onex-volume &>/dev/null + onex::log::info "uninstall onex successfully" +} + +onex::onex::build_artifacts() +{ + # 设置 Makefile 构建出产物的保存位置 + export OUTPUT_DIR=${LOCAL_OUTPUT_ROOT} + + # 进入到 OneX 项目仓库根目录,开始安装操作 + pushd "${ONEX_ROOT}" >/dev/null 2>&1 + + # 构建需要的产物 + # 构建服务二进制文件 + echo "Building onex artifacts, this may take a while as it requires download go packages ..." + make build + + # 生成 Systemd Unit 文件 + make gen.systemd + + # 生成应用配置文件 + make gen.appconfig + + # 生成 CA 证书 + make gen.ca + + # 生成 kubectl admin kubeconfig 文件 + make gen.kubeconfig +} + +# Install the onex step by step. +# sbs is the abbreviation for "step by step". +onex::onex::sbs::install() +{ + onex::onex::prepare + + # 编译构建产物 + onex::onex::build_artifacts + + # 强制停止所有 OneX Systemd 服务,防止复制文件失败 + for service in "${ONEX_SERVER_SIDE_COMPONENTS[@]}" + do + set +o errexit + onex::util::sudo "systemctl stop ${service}" &>/dev/null + set -o errexit + done + + OS=$(go env GOOS) + ARCH=$(go env GOARCH) + + # 复制构建产物到指定的目录下 + # 为了确保当 ONEX_INSTALL_DIR 设置为 /opt/onex 时,也能安装成功,这里始终用 + # root 权限去安装 + ## 复制所有的二进制文件到安装目录 + echo "===========> Copying binaries" + [ ! -d ${ONEX_BIN_DIR} ] && onex::util::sudo "mkdir -p ${ONEX_BIN_DIR}" + onex::util::sudo "cp ${LOCAL_OUTPUT_ROOT}/platforms/${OS}/${ARCH}/* ${ONEX_BIN_DIR}/" + + ## 复制所有的配置文件到配置目录 + [ ! -d ${ONEX_CONFIG_DIR} ] && onex::util::sudo "mkdir -p ${ONEX_CONFIG_DIR}" + echo "===========> Copying configurations" + onex::util::sudo "cp ${LOCAL_OUTPUT_ROOT}/appconfig/* ${ONEX_CONFIG_DIR}/" + + ## 复制 CA 文件到配置目录 + echo "===========> Copying cert directory" + onex::util::sudo "cp -r ${LOCAL_OUTPUT_ROOT}/cert ${ONEX_CONFIG_DIR}/" + + ## 复制 admin kubeconfig 文件到配置目录 + echo "===========> Copying kubeconfig file" + onex::util::sudo "cp ${LOCAL_OUTPUT_ROOT}/config ${ONEX_CONFIG_DIR}/" + + echo "===========> Copying systemd unit files" + onex::util::sudo "cp ${LOCAL_OUTPUT_ROOT}/systemd/* /etc/systemd/system/" + + # 启动 Systemd 服务 + # 依次启动服务 + onex::util::sudo "systemctl daemon-reload" + for service in "${ONEX_SERVER_SIDE_COMPONENTS[@]}" + do + echo "===========> Starting ${service} service" + onex::util::sudo "systemctl enable ${service}" &>/dev/null + onex::util::sudo "systemctl restart ${service}" + done + + onex::man::install + onex::onex::info + onex::log::info "install onex successfully" +} + +# Uninstall the onex step by step. +onex::onex::sbs::uninstall() +{ + # 防止删除 / 目录 + [[ -z ${ONEX_INSTALL_DIR} ]] || [[ ${ONEX_INSTALL_DIR} == "/" ]] && + onex::log::error "OneX installation directory must be setted" + + # 这里要注意 uninstall 顺序 + # + # 停掉所有的 OneX Systemd 服务 + for service in "${ONEX_SERVER_SIDE_COMPONENTS[@]}" + do + set +o errexit + onex::util::sudo "systemctl stop ${service}" &>/dev/null + set -o errexit + done + + # 注意:这里不能删除整个 ${ONEX_INSTALL_DIR},因为还有其他组件也安装在这个目录下,例如:thirdparty 目录 + onex::util::sudo "rm -rf ${ONEX_INSTALL_DIR}" + onex::util::sudo "rm -f /etc/systemd/system/onex-*.service" + onex::man::uninstall + onex::log::info "uninstall onex successfully" +} + +# Print necessary information after docker or sbs installation. +onex::onex::info() +{ + echo -e ${C_GREEN}onex has been installed, here are some useful information:${C_NORMAL} + cat << EOF | sed 's/^/ /' +onex-fakeserver: + http port: ${ONEX_FAKESERVER_HTTP_ADDR} + grpc port: ${ONEX_FAKESERVER_GRPC_ADDR} +onex-usercenter: + http port: ${ONEX_USERCENTER_HTTP_ADDR} + grpc port: ${ONEX_USERCENTER_GRPC_ADDR} +onex-apiserver: + http secure port: ${ONEX_APISERVER_SECURE_PORT} + access onex-apiserver via kubectl: kubectl --kubeconfig=${ONEX_ADMIN_KUBECONFIG} api-resources +onex-gateway: + http port: ${ONEX_GATEWAY_HTTP_ADDR} + grpc port: ${ONEX_GATEWAY_GRPC_ADDR} +onex-nightwatch: + health check port : ${ONEX_NIGHTWATCH_HEALTH_CHECK_PORT} + health check path: ${ONEX_NIGHTWATCH_HEALTH_CHECK_PATH} +onex-pump: + health check port : ${ONEX_PUMP_HEALTH_CHECK_PORT} + health check path: ${ONEX_PUMP_HEALTH_CHECK_PATH} +onex-controller-manager: + health check port: ${ONEX_CONTROLLER_MANAGER_HEALTHZ_PORT} + metrics port: ${ONEX_CONTROLLER_MANAGER_METRICS_PORT} +onex-minerset-controller: + health check port: ${ONEX_MINERSET_CONTROLLER_HEALTHZ_PORT} + metrics port: ${ONEX_MINERSET_CONTROLLER_METRICS_PORT} +onex-miner-controller: + health check port: ${ONEX_MINER_CONTROLLER_HEALTHZ_PORT} + metrics port: ${ONEX_MINER_CONTROLLER_METRICS_PORT} +onex-cacheserver: + grpc port: ${ONEX_CACHESERVER_GRPC_ADDR} +onex-toyblc: + toyblc address: 0x210d9eD12CEA87E33a98AA7Bcb4359eABA9e800e + toyblc p2p port: 6001 + toyblc peers: ws://localhost:6001 + toyblc http port: 56080 +EOF +} + +# Status check after docker or sbs installation. +onex::onex::sbs::status() +{ + has_failed=false + for service in "${ONEX_SERVER_SIDE_COMPONENTS[@]}" + do + # 查看 service 的运行状态,如果输出中包含 active (running) 字样说明 service 成功启动。 + if ! systemctl status ${service} | grep -q 'active';then + has_failed=true + onex::log::info "$(printf "${C_RED}%25s failed to start, maybe not installed properly.${C_NORMAL}" ${service})" + else + onex::log::info "$(printf "${C_GREEN}%25s started successfully.${C_NORMAL}" ${service})" + fi + done + + # 只要有一个启动失败则认为启动失败 + [[ ${has_failed} == "true" ]] && return 1 +} + +# 要实现幂等 +onex::onex::prepare() +{ + pushd "${ONEX_ROOT}" >/dev/null 2>&1 + + # 2. 配置 $HOME/.bashrc 添加一些便捷入口 + if ! grep -q 'Alias and environments for onex quick access' $HOME/.bashrc; then + cat << 'EOF' >> $HOME/.bashrc +# Alias and environments for onex quick access +export GOSRC="$WORKSPACE/golang/src" +# OneX project root directory, used in many places. +export ONEX_ROOT="$GOSRC/github.com/superproj/onex" +# Allows you to run latest compiled onex components like executing +# Linux commands, for example: onexctl. +export PATH=${ONEX_ROOT}/_output/platforms/linux/amd64:${ONEX_ROOT}/scripts:$PATH +export OVERSION=v1.0.0 +# a very convenient alias used to enter superproj root directory. +alias sp="cd $GOSRC/github.com/superproj" +# a very convenient alias used to enter onex root directory. +alias o="cd $GOSRC/github.com/superproj/onex" +EOF + fi + + # 初始化 MariaDB 数据库,创建 onex 数据库 + # 登录数据库并创建 onex 用户 + # 注意:给一个 MySQL 用户授权时,最好遵循最小权原则,只赋给他需要的数据库权限,例如:onex.*。 + # 但为了方便大家安装访问,这里授权 onex 用户可以访问所有数据库所有表的权限 + mariadb -h${ONEX_MYSQL_HOST} -P${ONEX_MYSQL_PORT} -u"${ONEX_MYSQL_ADMIN_USERNAME}" -p"${ONEX_MYSQL_ADMIN_PASSWORD}" << EOF +GRANT ALL PRIVILEGES ON *.* TO ${ONEX_MYSQL_USERNAME}@'%' identified by "${ONEX_MYSQL_PASSWORD}"; +FLUSH PRIVILEGES; +EOF + + # 用 onex 用户登录 MySQL,执行 onex.sql 文件,创建 onex 数据库 + mariadb -h${ONEX_MYSQL_HOST} -P${ONEX_MYSQL_PORT} -u"${ONEX_MYSQL_ADMIN_USERNAME}" -p"${ONEX_MYSQL_ADMIN_PASSWORD}" << 'EOF' +source configs/onex.sql; +use onex; +INSERT INTO `uc_user` VALUES (0,'user-admin','admin',1,'admin','$2a$10$KeHjeGtHOuUYs6l76fgLSeDdjBgfv7loo89svN6p5r40XItHc/NV2', 'colin404@foxmail.com','181X',now(),now()); +EOF + + # 初始化 MongoDB,创建 onex 用户 + encoded=$(echo -n "${ONEX_MONGO_ADMIN_PASSWORD}"|jq -sRr @uri) + mongosh --quiet mongodb://${ONEX_MONGO_ADMIN_USERNAME}:${encoded}@${ONEX_MONGO_URL}/${ONEX_MONGO_DATABASE}?authSource=admin << EOF +db.createUser({user:"${ONEX_MONGO_USERNAME}",pwd:"${ONEX_MONGO_PASSWORD}",roles:["dbOwner"]}) +db.auth("${ONEX_MONGO_USERNAME}", "${ONEX_MONGO_PASSWORD}") +quit; +EOF +} + +if [[ "$*" =~ onex::onex:: ]]; then + eval $* +fi diff --git a/scripts/installation/onex/test.sh b/scripts/installation/onex/test.sh new file mode 100755 index 00000000000..59b81510c38 --- /dev/null +++ b/scripts/installation/onex/test.sh @@ -0,0 +1,391 @@ +#!/usr/bin/env bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh + +ONEX_USERCENTER_ADDR=${ONEX_ACCESS_HOST}:${ONEX_USERCENTER_HTTP_PORT} +ONEX_GATEWAY_ADDR=${ONEX_ACCESS_HOST}:${ONEX_GATEWAY_HTTP_PORT} +ONEX_NIGHTWATCH_ADDR=${ONEX_ACCESS_HOST}:${ONEX_NIGHTWATCH_HEALTH_CHECK_PORT} +ONEX_PUMP_ADDR=${ONEX_ACCESS_HOST}:${ONEX_PUMP_HEALTH_CHECK_PORT} +ONEX_TOYBLC_ADDR=${ONEX_ACCESS_HOST}:${ONEX_TOYBLC_HTTP_PORT} + +Header="-HContent-Type:application/json" +CURLARGS="-S" +CCURL="curl ${CURLARGS} -XPOST ${Header}" # Create +UCURL="curl ${CURLARGS} -XPUT ${Header}" # Update +RCURL="curl ${CURLARGS} -XGET" # Retrieve +DCURL="curl ${CURLARGS} -XDELETE" # Delete + +# 重要:kubectl 访问 onex-apiserver,需要正确设置 KUBECONFIG 环境变量 +export KUBECONFIG=${ONEX_ADMIN_KUBECONFIG} + +# 确保 kubectl 命令被安装 +if [[ "$(command -v kubectl)" == "" ]];then + make -C ${ONEX_ROOT} tools.install.kubectl +fi + +# 测试整个 OneX 项目 +onex::test::test() +{ + onex::test::usercenter + onex::test::apiserver + onex::test::gateway + onex::test::pump + onex::test::nightwatch + onex::test::controller # onex-controller-manager, onex-minerset-controller, onex-miner-controller + onex::test::toyblc + onex::test::onexctl + onex::test::fakeserver + onex::test::cacheserver + + onex::log::info "$(echo -e ${C_GREEN}===========\> all test passed!${C_NORMAL})" +} + +# 幂等创建 colin 用户 +onex::test::ensure_user() +{ + tester="colin" + if [[ "$1" != "" ]];then + tester="$1" + fi + + curl -s -XPOST ${Header} http://${ONEX_USERCENTER_ADDR}/v1/users \ + -d'{"username":"'${tester}'","password":"onex(#)666","nickname":"colin","realName":"孔令飞","email":"colin404@foxmail.com","phone":"1812884xxxx"}' | grep -q 'User already exists' && return 0 +} + +# 默认 admin 用户登录 +# 如果是 `tester` 用户则会先创建 `tester` 用户 +# 返回的是 refreshToken +onex::test::refresh_token() +{ + user="admin" + if [[ "$1" != "" ]];then + user=$1 + fi + + if [[ $user == "tester" ]];then + onex::test::ensure_user tester + fi + + ${CCURL} http://${ONEX_USERCENTER_ADDR}/v1/auth/login -d'{"username":"'$user'","password":"onex(#)666"}' | grep -Po 'refreshToken[" :]+\K[^"]+' +} + +# 类似 onex::test::refresh_token,但返回的是 accessToken +onex::test::access_token() +{ + user="admin" + if [[ "$1" != "" ]];then + user=$1 + fi + + if [[ $user == "tester" ]];then + onex::test::ensure_user tester + fi + + ${CCURL} http://${ONEX_USERCENTER_ADDR}/v1/auth/login -d'{"username":"'$user'","password":"onex(#)666"}' | grep -Po 'accessToken[" :]+\K[^"]+' +} + +# 测试 onex-usercenter 组件 user 资源 +onex::test::usercenter::user() +{ + admin_token_header="-HAuthorization: Bearer $(onex::test::refresh_token)" + + # 1. 如果有 colin、mark、john 用户先清空 + ${DCURL} "${admin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/colin; echo + ${DCURL} "${admin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/mark; echo + ${DCURL} "${admin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/john; echo + + # 2. 创建 colin、mark、john 用户 + ${CCURL} http://${ONEX_USERCENTER_ADDR}/v1/users \ + -d'{"username":"colin","password":"onex(#)666","nickname":"colin","realName":"孔令飞","email":"colin404@ foxmail.com","phone":"1812884xxxx"}'; echo + + # 3. 列出所有用户 + ${RCURL} "${admin_token_header}" "http://${ONEX_USERCENTER_ADDR}/v1/users?offset=0&limit=10"; echo + + # 4. 获取 colin 用户的详细信息 + colin_token_header="-HAuthorization: Bearer $(onex::test::refresh_token colin)" + ${RCURL} "${colin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/colin; echo + + # 5. 修改 colin 用户 + ${UCURL} "${colin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/colin \ + -d'{"nickname":"colin","email":"colin_modified@foxmail.com","phone":"1812884xxxx"}'; echo + + # 6. 修改用户密码 + ${UCURL} "${colin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/colin/update-password \ + -d'{"oldPassword":"onex(#)666","newPassword":"onex(#)888"}'; echo + + # 7. 删除 colin 用户 + ${DCURL} "${colin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/users/colin; echo + onex::log::info "$(echo -e ${C_GREEN}===========\> /v1/user test passed!${C_NORMAL})" +} + +# 测试 onex-usercenter auth 资源 +onex::test::usercenter::auth() +{ + # Login + tester_token_header="-HAuthorization: Bearer $(onex::test::refresh_token tester)" + + # RefreshToken + token_string=$(${CCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/auth/refresh-token) + refresh_token=$(echo ${token_string} | jq -r .refreshToken) + access_token=$(echo ${token_string} | jq -r .accessToken) + refresh_token_header="-HAuthorization: Bearer ${refresh_token}" + access_token_header="-HAuthorization: Bearer ${access_token}" + + # Authenticate + ${CCURL} "${access_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/auth/authenticate \ + -d'{"token":"'${access_token}'"}'; echo + + # /v1/auth/authorize 不需要认证 + ${CCURL} http://${ONEX_USERCENTER_ADDR}/v1/auth/authorize -d'{"sub":"tester","obj":"tester","act":"delete"}'; echo + + # Auth + ${CCURL} "${access_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/auth/auth \ + -d'{"token":"'${access_token}'","obj":"tester","act":"delete"}'; echo + + # Logout + #${CCURL} "${refresh_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/auth/logout; echo + + onex::log::info "$(echo -e ${C_GREEN}===========\> /v1/auth test passed!${C_NORMAL})" +} + +# 测试 onex-usercenter secret 资源 +onex::test::usercenter::secret() +{ + admin_token_header="-HAuthorization: Bearer $(onex::test::refresh_token admin)" + tester_token_header="-HAuthorization: Bearer $(onex::test::refresh_token tester)" + + # 1. 如果有 secret0 密钥先清空 + ${DCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets/secret0; echo + + # 2. 创建 secret0 密钥 + ${CCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets \ + -d'{"name":"secret0","expires":0,"description":"tester secret"}'; echo + + # 3. 列出所有密钥 + ${RCURL} "${admin_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets; echo + + # 4. 获取 secret0 密钥的详细信息 + ${RCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets/secret0; echo + + # 5. 修改 secret0 密钥 + ${UCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets/secret0 \ + -d'{"expires":4072326717,"description":"tester secret(modified)"}'; echo + + # 6. 获取 secret0 密钥的详细信息 + ${RCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets/secret0; echo + + # 7. 删除 secret0 密钥 + ${DCURL} "${tester_token_header}" http://${ONEX_USERCENTER_ADDR}/v1/secrets/secret0; echo + onex::log::info "$(echo -e ${C_GREEN}===========\> /v1/secret test passed!${C_NORMAL})" +} + +# 注意:这里要sleep等待controller调和资源 +# 包含了 onex-controller-manager, onex-minerset-controller, onex-miner-controller 3 个 controller 的测试 +onex::test::controller() +{ + NS=user-admin + # 先幂等删除 + kubectl delete -f ${ONEX_ROOT}/manifests/sample/onex/chain.yaml &>/dev/null || true + kubectl delete -f ${ONEX_ROOT}/manifests/sample/onex/minerset.yaml &>/dev/null || true + kubectl delete -f ${ONEX_ROOT}/manifests/sample/onex/miner.yaml &>/dev/null || true + + # 等待 2s 等 controller 删除资源 + sleep 2 + + # 创建一个私有链 + kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/chain.yaml + kubectl -n kube-system get chain --no-headers|grep -q genesis + sleep 1 + kubectl -n kube-system get miner | egrep -q 'genesis.*Running' + + # 创建一个矿机池 + kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/minerset.yaml + sleep 2 + kubectl -n ${NS} get minerset | grep -q test + kubectl -n ${NS} get miner | egrep test-.*Running + + # 创建一个游离的矿机 + kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/miner.yaml + sleep 1 + kubectl -n ${NS} get miner | egrep freeminer.*Running + + onex::log::info "$(echo -e ${C_GREEN}===========\> onex controller test passed!${C_NORMAL})" +} + +# 测试 onex-apiserver 组件 +onex::test::apiserver() +{ + kubectl api-resources | egrep -q 'apps.onex.io' +} + +# 测试 onex-gateway 组件 +onex::test::gateway() +{ + + onex::test::gateway::chain + onex::test::gateway::minerset + onex::test::gateway::miner + + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-gateway test passed!${C_NORMAL})" +} + + +# 确保创世区块存在 +onex::test::gateway::ensure_genesis_chain() +{ + kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/chain.yaml || true + kubectl -n kube-system get chain genesis +} + +# 测试 onex-gateway chacin 资源 +onex::test::gateway::chain() +{ + # 创建一个创世区块链 + kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/chain.yaml || true + kubectl -n kube-system get chain genesis + + onex::log::info "$(echo -e ${C_GREEN}===========\> /v1/chains test passed!${C_NORMAL})" +} + +# 测试 onex-fakeserver +onex::test::fakeserver() +{ + # Leave to you to implement it. + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-fakeserver test passed!${C_NORMAL})" +} + +# 测试 onex-cacheserver 组件 +onex::test::cacheserver() +{ + # Leave to you to implement it. + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-cacheserver test passed!${C_NORMAL})" +} + +# 测试 onex-gateway 组件 +onex::test::gateway::minerset() +{ + # 确保依赖的创世链存在 + onex::test::gateway::ensure_genesis_chain + + # Login + tester_token_header="-HAuthorization: Bearer $(onex::test::access_token tester)" + + # 先幂等删除 + ${DCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/minersets/minerset0; echo + + # 获取幂等 token + idempotent_token=$(${RCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/idempotents | jq -r .token) + + # 创建 minerset0 矿机池 + ${CCURL} "${tester_token_header}" -H"X-Idempotent-ID: ${idempotent_token}" http://${ONEX_GATEWAY_ADDR}/v1/minersets \ + -d'{"apiVersion":"apps.onex.io/v1beta1","kind":"MinerSet","metadata":{"name":"minerset0"},"spec":{"deletePolicy":"Random","displayName":"test-minerset","replicas":2,"template":{"spec":{"chainName":"genesis","minerType":"M1.MEDIUM2"}}}}'; echo + + # 矿机池列表 + ${RCURL} "${tester_token_header}" "http://${ONEX_GATEWAY_ADDR}/v1/minersets?offset=0&limit=10"; echo + + # 获取矿机池详情 + ${RCURL} "${tester_token_header}" "http://${ONEX_GATEWAY_ADDR}/v1/minersets/minerset0"; echo + + # 更新矿机池 + ${UCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/minersets -d'{"metadata":{"name":"minerset0"},"spec":{"replicas":2,"selector":{},"template":{"metadata":{},"spec":{"metadata":{},"minerType":"M1.MEDIUM2","chainName":"genesis"}},"displayName":"test-minerset-modified"}}'; echo + + # 扩缩容矿机池 + # 等待 1 s,等待上一次操作调和完成 + sleep 1 + ${UCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/minersets/minerset0/scale -d'{"replicas":3}'; echo + + # 删除矿机池 + ${DCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/minersets/minerset0; echo + + onex::log::info "$(echo -e ${C_GREEN}===========\> /v1/minersets test passed!${C_NORMAL})" +} + +# 测试 onex-miner-controller +onex::test::gateway::miner() +{ + # 确保依赖的创世链存在 + onex::test::gateway::ensure_genesis_chain + + # Login + tester_token_header="-HAuthorization: Bearer $(onex::test::access_token tester)" + + # 先幂等删除 + ${DCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/miners/miner0; echo + + # 获取幂等 token + idempotent_token=$(${RCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/idempotents | jq -r .token) + + # 创建 miner0 矿机池 + ${CCURL} "${tester_token_header}" -H"X-Idempotent-ID: ${idempotent_token}" http://${ONEX_GATEWAY_ADDR}/v1/miners \ + -d'{"metadata":{"name":"miner0"},"spec":{"chainName":"genesis","minerType":"M1.MEDIUM2"},"apiVersion":"apps.onex.io/v1beta1","kind":"Miner"}'; echo + + # 矿机池列表 + ${RCURL} "${tester_token_header}" "http://${ONEX_GATEWAY_ADDR}/v1/miners?offset=0&limit=10"; echo + + # 获取矿机池详情 + ${RCURL} "${tester_token_header}" "http://${ONEX_GATEWAY_ADDR}/v1/miners/miner0"; echo + + # 更新矿机池 + ${UCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/miners \ + -d'{"metadata":{"name":"miner0"},"spec":{"chainName":"genesis","minerType":"M1.MEDIUM2","displayName":"test-for-gateway"},"apiVersion":"apps.onex.io/v1beta1","kind":"Miner"}'; echo + + # 删除矿机池 + ${DCURL} "${tester_token_header}" http://${ONEX_GATEWAY_ADDR}/v1/miners/miner0; echo + + onex::log::info "$(echo -e ${C_GREEN}===========\> /v1/miners test passed!${C_NORMAL})" +} + +# 测试 onex-usercenter 组件 +onex::test::usercenter() +{ + onex::test::usercenter::user + onex::test::usercenter::secret + onex::test::usercenter::auth + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-usercenter test passed!${C_NORMAL})" +} + +# 测试 onex-pump 组件 +onex::test::pump() +{ + ${RCURL} http://${ONEX_PUMP_ADDR}${ONEX_PUMP_HEALTH_CHECK_PATH} | egrep 'status.*ok' + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-pump test passed!${C_NORMAL})" +} + +# 测试 onex-nightwatch 组件 +onex::test::nightwatch() +{ + ${RCURL} http://${ONEX_NIGHTWATCH_ADDR}${ONEX_NIGHTWATCH_HEALTH_CHECK_PATH} | egrep 'status.*ok' + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-nightwatch test passed!${C_NORMAL})" +} + +# 测试 onex-toyblc 组件 +onex::test::toyblc() +{ + ${RCURL} -u${ONEX_TOYBLC_USERNAME}:${ONEX_TOYBLC_PASSWORD} http://${ONEX_TOYBLC_ADDR}/v1/blocks; echo + ${RCURL} -u${ONEX_TOYBLC_USERNAME}:${ONEX_TOYBLC_PASSWORD} http://${ONEX_TOYBLC_ADDR}/v1/peers; echo + + onex::log::info "$(echo -e ${C_GREEN}===========\> onex-toyblc test passed!${C_NORMAL})" +} + +# 测试 onexctl 组件 +onex::test::onexctl() +{ + # 创建一个测试矿机池 + kubectl delete -f ${ONEX_ROOT}/manifests/sample/onex/minerset.yaml &>/dev/null || true + kubectl create -f ${ONEX_ROOT}/manifests/sample/onex/minerset.yaml + ${ONEX_BIN_DIR}/onexctl --config ${ONEX_CONFIG_DIR}/onexctl.yaml minerset list | grep -q testminerset + + onex::log::info "$(echo -e ${C_GREEN}===========\> onexctl test passed!${C_NORMAL})" +} + +if [[ "$*" =~ onex::test:: ]]; then + eval $* +fi diff --git a/scripts/installation/redis.sh b/scripts/installation/redis.sh index 3b807dcca6a..f497cd7eebe 100755 --- a/scripts/installation/redis.sh +++ b/scripts/installation/redis.sh @@ -22,6 +22,7 @@ onex::redis::docker::install() onex::common::network docker run -d --name onex-redis \ + --restart always \ --network onex \ -v ${ONEX_THIRDPARTY_INSTALL_DIR}/redis:/data \ -p ${ONEX_ACCESS_HOST}:${ONEX_REDIS_PORT}:6379 \ diff --git a/scripts/installation/storage/etcd.sh b/scripts/installation/storage/etcd.sh new file mode 100755 index 00000000000..715a38aa1ad --- /dev/null +++ b/scripts/installation/storage/etcd.sh @@ -0,0 +1,150 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +ONEX_ETCD_HOST=${ONEX_ETCD_HOST:-127.0.0.1} +ONEX_ETCD_CLIENT_PORT=${ONEX_ETCD_CLIENT_PORT:-2379} +ONEX_ETCD_PEER_PORT=${ONEX_ETCD_PEER_PORT:-2380} +ONEX_ETCD_VERSION=${ETCD_VERSION:-3.5.11} +ONEX_ETCD_DIR=${ONEX_ETCD_DIR:-${ONEX_THIRDPARTY_INSTALL_DIR}/etcd} + +# Install etcd using containerization. +onex::etcd::docker::install() +{ + onex::common::network + docker run -d --name onex-etcd \ + --restart always \ + --network onex \ + -v ${ONEX_ETCD_DIR}:/etcd-data \ + -p ${ONEX_ACCESS_HOST}:${ONEX_ETCD_CLIENT_PORT}:2379 \ + -p ${ONEX_ACCESS_HOST}:${ONEX_ETCD_PEER_PORT}:2380 \ + quay.io/coreos/etcd:v3.5.13 \ + /usr/local/bin/etcd \ + --advertise-client-urls http://0.0.0.0:2379 \ + --listen-client-urls http://0.0.0.0:2379 \ + --data-dir /etcd-data + + sleep 10 + onex::etcd::status || return 1 + onex::etcd::info + onex::log::info "install etcd successfully" +} + +# Uninstall the docker container. +onex::etcd::docker::uninstall() +{ + docker rm -f onex-etcd &>/dev/null + onex::util::sudo "rm -rf ${ONEX_ETCD_DIR}" + onex::log::info "uninstall etcd successfully" +} + +# Install the etcd step by step. +# sbs is the abbreviation for "step by step". +onex::etcd::sbs::install() +{ + local os + local arch + + os=$(onex::util::host_os) + arch=$(onex::util::host_arch) + + download_file_name="etcd-v${ONEX_ETCD_VERSION}-${os}-${arch}" + download_file="/tmp/${download_file_name}.tar.gz" + url="https://github.com/coreos/etcd/releases/download/v${ONEX_ETCD_VERSION}/${download_file_name}.tar.gz" + onex::util::download_file "${url}" "${download_file}" + tar -xvzf "${download_file}" -C /tmp/ + echo ${LINUX_PASSWORD} | sudo -S cp /tmp/${download_file_name}/{etcd,etcdctl,etcdutl} /usr/bin/ + rm "${download_file}" + rm -rf /tmp/${download_file_name} + + # 创建 Etcd 配置文件 + onex::util::sudo "mkdir -p /etc/etcd" + # Etcd 会输出日志到 ${ONEX_LOG_DIR},所以需要先创建该目录 + onex::util::sudo "mkdir -p ${ONEX_LOG_DIR}" + + echo ${LINUX_PASSWORD} | sudo -S cat << EOF | sudo tee /etc/etcd/config.yaml +name: onex +data-dir: ${ONEX_ETCD_DIR} +advertise-client-urls: http://0.0.0.0:${ONEX_ETCD_CLIENT_PORT} +listen-client-urls: http://0.0.0.0:${ONEX_ETCD_CLIENT_PORT} +initial-advertise-peer-urls: http://0.0.0.0:${ONEX_ETCD_PEER_PORT} +initial-cluster: onex=http://0.0.0.0:${ONEX_ETCD_PEER_PORT} +log-outputs: [${ONEX_LOG_DIR}/etcd.log] +log-level: debug +EOF + + echo ${LINUX_PASSWORD} | sudo -S cat << EOF | sudo tee /lib/systemd/system/etcd.service +# Etcd systemd unit template from +# https://github.com/etcd-io/etcd/blob/main/contrib/systemd/etcd.service +[Unit] +Description=etcd key-value store # 指定了单元的描述,即 etcd 键值存储 +Documentation=https://github.com/etcd-io/etcd # 提供了指向 etcd 项目文档的链接 +After=network-online.target local-fs.target remote-fs.target time-sync.target # 指定了服务的启动顺序 +Wants=network-online.target local-fs.target remote-fs.target time-sync.target # 指定了服务的启动依赖 + +[Service] +Type=notify # 指定了服务的类型。notify 类型表示服务会在准备就绪时发送通知 +ExecStart=/usr/bin/etcd --config-file=/etc/etcd/config.yaml # 指定了服务启动时要执行的命令,这里是使用指定的配置文件启动 etcd +Restart=always # 指定了服务的重启行为。always 表示服务会在退出时总是被重启 +RestartSec=10s # 指定了重启的间隔时间 +LimitNOFILE=40000 # 指定了服务的文件描述符限制,这里设置为 40000 + +[Install] +WantedBy=multi-user.target # 指定了服务的安装目标,这里表示服务会被添加到 multi-user.target,以便在多用户模式下启动 +EOF + + onex::util::sudo "systemctl daemon-reload" + onex::util::sudo "systemctl start etcd" + onex::util::sudo "systemctl enable etcd" + + onex::etcd::status || return 1 + onex::etcd::info + onex::log::info "install etcd v${ONEX_ETCD_VERSION} successfully" +} + +# Uninstall the etcd step by step. +onex::etcd::sbs::uninstall() +{ + #set +o errexit + #etcd_pids=$(pgrep -f $HOME/bin/etcd) + #set -o errexit + #if [[ ${etcd_pids} != "" ]];then + #echo ${LINUX_PASSWORD} | sudo -S kill -9 ${etcd_pids} || true + #fi + + # etcd, etcdctl, etcdutl 3 个文件这里不需要删除,因为下次安装时,文件会被覆盖,仍然是幂等安装 + onex::util::sudo "systemctl stop etcd" + onex::util::sudo "rm -rf ${ONEX_ETCD_DIR}" + onex::log::info "uninstall etcd successfully" +} + +# Print necessary information after docker or sbs installation. +onex::etcd::info() +{ + onex::color::green "etcd has been installed, here are some useful information:" + cat << EOF | sed 's/^/ /' +Etcd endpoint is: ${ONEX_ETCD_HOST}:${ONEX_ETCD_CLIENT_PORT} +EOF +} + +# Status check after docker or sbs installation. +onex::etcd::status() +{ + onex::util::telnet ${ONEX_ETCD_HOST} ${ONEX_ETCD_CLIENT_PORT} || return 1 + + #echo "Waiting for etcd to come up." + #onex::util::wait_for_url "http://${ONEX_ETCD_HOST}:${ONEX_ETCD_CLIENT_PORT}/health" "etcd: " 0.25 80 +} + +if [[ "$*" =~ onex::etcd:: ]]; then + eval $* +fi diff --git a/scripts/installation/storage/mariadb.sh b/scripts/installation/storage/mariadb.sh new file mode 100755 index 00000000000..ac0a22e008a --- /dev/null +++ b/scripts/installation/storage/mariadb.sh @@ -0,0 +1,133 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +ONEX_MYSQL_HOST=${ONEX_MYSQL_HOST:-127.0.0.1} +ONEX_MYSQL_PORT=${ONEX_MYSQL_PORT:-3306} +ONEX_PASSWORD=${ONEX_PASSWORD:-onex(#)666} + +# Install mariadb using containerization. +onex::mariadb::docker::install() +{ + # 安装客户端工具,访问 MariaDB + onex::util::sudo "apt install -y mariadb-client" + + onex::common::network + docker run -d --name onex-mariadb \ + --restart always \ + --network onex \ + -v ${ONEX_THIRDPARTY_INSTALL_DIR}/mariadb:/var/lib/mysql \ + -p ${ONEX_ACCESS_HOST}:${ONEX_MYSQL_PORT}:3306 \ + -e MYSQL_ROOT_PASSWORD=${ONEX_PASSWORD} \ + mariadb:11.2.2 + + echo "Sleeping to wait for all onex-mariadb container to complete startup ..." + sleep 10 + onex::mariadb::status || return 1 + + onex::mariadb::info + onex::log::info "install mariadb successfully" +} + +# Uninstall the docker container. +onex::mariadb::docker::uninstall() +{ + docker rm -f onex-mariadb &>/dev/null + onex::util::sudo "rm -rf ${ONEX_THIRDPARTY_INSTALL_DIR}/mariadb" + onex::log::info "uninstall mariadb successfully" +} + +# Install the mariadb step by step. +# sbs is the abbreviation for "step by step". +onex::mariadb::sbs::install() +{ + # 本机 apt 安装后 MySQL 端口固定位 3306 + export ONEX_MYSQL_PORT=3306 + + # 从指定的 URL中获取 MariaDB 的发布密钥。这个密钥用于验证 MariaDB + # 软件包的签名,确保软件包在下载和安装过程中的完整性和安全性 + echo ${LINUX_PASSWORD} | sudo -S apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc' + # 配置 MariaDB 11.2.2 apt 源(docker install 和 sbs install 版本都要保持一致) + echo ${LINUX_PASSWORD} | sudo -S echo "deb [arch=amd64,arm64] https://mirrors.aliyun.com/mariadb/repo/11.2.2/debian/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mariadb-11.2.2.list + + # 注意:一定要执行 `apt update`,否则可能安装的还是旧的软件包 + onex::util::sudo "apt update" + + # 需要先创建 /var/lib/mysql/ 目录,否则 `systemctl start mariadb` 时可能会报错 + onex::util::sudo "mkdir -p /var/lib/mysql" + + # 执行以下命令,防止uninstall后,出现:`update-alternatives: error: alternative path /etc/mysql/mariadb.cnf doesn't exist` 错误 + # 安装 MariaDB 客户端和 MariaDB 服务端 + onex::util::sudo "apt install -y -o Dpkg::Options::="--force-confmiss" --reinstall mariadb-client mariadb-server" + + # 启动 MariaDB,并设置开机启动 + onex::util::sudo "systemctl enable mariadb" + + # 为了方便你访问 MySQL,这里我们设置 MySQL 允许从所有机器网卡访问 + echo ${LINUX_PASSWORD} | sudo -S sed -i 's/^bind-address.*/bind-address = 0.0.0.0/g' /etc/mysql/mariadb.conf.d/50-server.cnf + + onex::util::sudo "systemctl restart mariadb" + + # 设置 root 初始密码 + onex::util::sudo "mysqladmin -u${ONEX_MYSQL_ADMIN_USERNAME} password ${ONEX_MYSQL_ADMIN_PASSWORD}" + + onex::mariadb::status || return 1 + onex::mariadb::info + onex::log::info "install mariadb successfully" +} + +# Uninstall the mariadb step by step. +onex::mariadb::sbs::uninstall() +{ + # `|| true` 实现幂等 + onex::util::sudo "systemctl stop mariadb" || true + onex::util::sudo "systemctl disable mariadb" || true + onex::util::sudo "apt remove -y mariadb-client mariadb-server" || true + + # 删除配置文件和数据目录,以及其他关联安装文件 + onex::util::sudo "rm -rvf /var/lib/mysql" + onex::util::sudo "rm -rvf /etc/mysql" + onex::util::sudo "rm -rvf /usr/share/keyrings/mariadb.gpg" + onex::util::sudo "rm -vf /etc/apt/sources.list.d/mariadb-11.2.2.list" + onex::log::info "uninstall mariadb successfully" +} + +# Print necessary information after docker or sbs installation. +onex::mariadb::info() +{ + onex::color::green "mariadb has been installed, here are some useful information:" + cat << EOF | sed 's/^/ /' +MySQL access endpoint is: ${ONEX_MYSQL_HOST}:${ONEX_MYSQL_PORT} + root password is: ${ONEX_PASSWORD} +# `mysql` will be deprecated in the future, so here use `mariadb` instead. +Access command: mariadb -h ${ONEX_MYSQL_HOST} -P ${ONEX_MYSQL_PORT} -u root -p'${ONEX_PASSWORD}' +EOF +} + +# Status check after docker or sbs installation. +onex::mariadb::status() +{ + sleep 20 + # 基础检查:检查端口,基础检查 + onex::util::telnet ${ONEX_MYSQL_HOST} ${ONEX_MYSQL_PORT} || return 1 + + # 终态检查:检查 MySQL 是否成功运行 + echo mariadb -h${ONEX_MYSQL_HOST} -P${ONEX_MYSQL_PORT} -u${ONEX_MYSQL_ADMIN_USERNAME} -p${ONEX_MYSQL_ADMIN_PASSWORD} -e quit + mariadb -h${ONEX_MYSQL_HOST} -P${ONEX_MYSQL_PORT} -u${ONEX_MYSQL_ADMIN_USERNAME} -p${ONEX_MYSQL_ADMIN_PASSWORD} -e quit &>/dev/null || { + onex::log::error "can not login with root, mariadb maybe not initialized properly." + return 1 + } +} + +if [[ "$*" =~ onex::mariadb:: ]]; then + eval $* +fi diff --git a/scripts/installation/storage/mongo.sh b/scripts/installation/storage/mongo.sh new file mode 100755 index 00000000000..ccf0361d6b6 --- /dev/null +++ b/scripts/installation/storage/mongo.sh @@ -0,0 +1,154 @@ +#!/bin/bash + +# Copyright 2022 Lingfei Kong . All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +ONEX_MONGO_HOST=${ONEX_MONGO_HOST:-127.0.0.1} +ONEX_MONGO_PORT=${ONEX_MONGO_PORT:-27017} +ONEX_MONGO_URL=${ONEX_MONGO_HOST}:${ONEX_MONGO_PORT} +ONEX_MONGO_DATABASE=${ONEX_MONGO_DATABASE:-onex} +ONEX_MONGO_ADMIN_USERNAME=${ONEX_MONGO_ADMIN_USERNAME:-root} +ONEX_MONGO_ADMIN_PASSWORD=${ONEX_MONGO_ADMIN_PASSWORD:-'onex(#)666'} +#ONEX_MONGO_ADMIN_AUTH=${ONEX_MONGO_ADMIN_USERNAME}:"'${ONEX_MONGO_ADMIN_PASSWORD}'" +ONEX_MONGO_ADMIN_AUTH=${ONEX_MONGO_ADMIN_USERNAME}:${ONEX_MONGO_ADMIN_PASSWORD} + +# Install mongo using containerization. +onex::mongo::docker::install() +{ + onex::mongo::pre_install + + onex::common::network + docker run -d --name onex-mongo \ + --restart always \ + --network onex \ + -v ${ONEX_THIRDPARTY_INSTALL_DIR}/mongo:/data \ + -p ${ONEX_ACCESS_HOST}:${ONEX_MONGO_PORT}:27017 \ + -e MONGO_INITDB_ROOT_USERNAME=${ONEX_MONGO_ADMIN_USERNAME} \ + -e MONGO_INITDB_ROOT_PASSWORD=${ONEX_MONGO_ADMIN_PASSWORD} \ + mongodb/mongodb-community-server:7.0.3-ubuntu2204 + + sleep 10 + onex::mongo::status || return 1 + onex::mongo::info + onex::log::info "install mongo successfully" +} + + +onex::mongo::pre_install() +{ + # 获取 MongoDB 公钥 + echo ${LINUX_PASSWORD} | sudo -S wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add - + + # 添加 MongoDB APT 源 + echo ${LINUX_PASSWORD} | sudo -S echo "deb [arch=amd64,arm64] https://repo.mongodb.org/apt/debian $(lsb_release -cs)/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list + + # 安装libssl1.1,否则安装 mongo 时会报以下错误: + # mongodb-org-mongos : Depends: libssl1.1 (>= 1.1.1) but it is not installable + wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb -P /tmp/ + echo ${LINUX_PASSWORD} | sudo -S -i dpkg -i /tmp/libssl1.1_1.1.1f-1ubuntu2_amd64.deb + + onex::util::sudo "apt update" + + # 安装 MongoDB 客户端 + onex::util::sudo "apt install -y mongodb-mongosh" +} + +# Uninstall the docker container. +onex::mongo::docker::uninstall() +{ + docker rm -f onex-mongo &>/dev/null + onex::util::sudo "rm -rf ${ONEX_THIRDPARTY_INSTALL_DIR}/mongo" + onex::log::info "uninstall mongo successfully" +} + +# Install the mongo step by step. +# sbs is the abbreviation for "step by step". +onex::mongo::sbs::install() +{ + onex::mongo::pre_install + + echo ${LINUX_PASSWORD} | sudo -S apt install -y gnupg + + # 安装 MongoDB 服务端 + # 以为我们uninstall时会删除配置文件,所以要使用--force-confmiss 重新安装配置文件 + onex::util::sudo "apt -y -o Dpkg::Options::="--force-confmiss" --reinstall install mongodb-org mongodb-org-server" + + # 开启外网访问权限和登录验证 + echo ${LINUX_PASSWORD} | sudo -S sed -i '/bindIp/{s/127.0.0.1/0.0.0.0/}' /etc/mongod.conf + # 关闭认证以创建 root 用户 + echo ${LINUX_PASSWORD} | sudo -S sed -i '/^#security/a\security:\n authorization: disabled' /etc/mongod.conf + + # 启动 MongoDB,并设置开机启动 + onex::util::sudo "systemctl enable mongod" + onex::util::sudo "systemctl restart mongod" + echo "Sleeping 5s to wait for mongo to complete startup ..." + sleep 5 + + # 创建管理员账号,设置管理员密码 + echo ${LINUX_PASSWORD} | sudo -S mongosh --quiet "mongodb://${ONEX_MONGO_URL}" <. All rights reserved. +# Use of this source code is governed by a MIT style +# license that can be found in the LICENSE file. The original repo for +# this file is https://github.com/superproj/onex. +# + +# The root of the build/dist directory. +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/../.. +# If common.sh has already been sourced, it will not be sourced again here. +[[ -z ${COMMON_SOURCED} ]] && source ${ONEX_ROOT}/scripts/installation/common.sh +# Set some environment variables. +ONEX_REDIS_HOST=${ONEX_REDIS_HOST:-127.0.0.1} +ONEX_REDIS_PORT=${ONEX_REDIS_PORT:-6379} +ONEX_PASSWORD=${ONEX_PASSWORD:-onex(#)666} + +# Install redis using containerization. +onex::redis::docker::install() +{ + onex::redis::pre_install + + onex::common::network + docker run -d --name onex-redis \ + --restart always \ + --network onex \ + -v ${ONEX_THIRDPARTY_INSTALL_DIR}/redis:/data \ + -p ${ONEX_ACCESS_HOST}:${ONEX_REDIS_PORT}:6379 \ + redis:7.2.3 \ + redis-server \ + --appendonly yes \ + --save 60 1 \ + --protected-mode no \ + --requirepass ${ONEX_PASSWORD} \ + --loglevel debug + + sleep 2 + onex::redis::status || return 1 + onex::redis::info + onex::log::info "install redis successfully" +} + +# Uninstall the docker container. +onex::redis::docker::uninstall() +{ + docker rm -f onex-redis &>/dev/null + onex::util::sudo "rm -rf ${ONEX_THIRDPARTY_INSTALL_DIR}/redis" + onex::log::info "uninstall redis successfully" +} + +# Install the redis step by step. +# sbs is the abbreviation for "step by step". +onex::redis::sbs::install() +{ + onex::redis::pre_install + + # 创建 `/var/lib/redis` 目录,否则 `redis-server` 命令启动时 + # 会报:`Can't chdir to '/var/lib/redis': No such file or directory` 错误 + onex::util::sudo "mkdir -p /var/lib/redis" + + # 安装 Redis + onex::util::sudo "apt install -y -o Dpkg::Options::="--force-confmiss" --reinstall redis-server" + + # 配置 Redis + # 修改 `/etc/redis/redis.conf` 文件,将 daemonize 由 no 改成 yes,表示允许 Redis 在后台启动 + redis_conf=/etc/redis/redis.conf + # 注意:有的系统 redis 配置文件路径为 `/etc/redis.conf` + [[ -f /etc/redis.conf ]] && redis_conf=/etc/redis.conf + + echo ${LINUX_PASSWORD} | sudo -S sed -i '/^daemonize/{s/no/yes/}' ${redis_conf} + + # 修改 Redis 端口为 ${ONEX_REDIS_PORT} + echo ${LINUX_PASSWORD} | sudo -S sed -i "s/^port.*/port ${ONEX_REDIS_PORT}/g" ${redis_conf} + + # 在 `bind 127.0.0.1` 前面添加 `#` 将其注释掉,默认情况下只允许本地连接,注释掉后外网可以连接 Redis + echo ${LINUX_PASSWORD} | sudo -S sed -i '/^bind .*127.0.0.1/s/^/# /' ${redis_conf} + + # 修改 requirepass 配置,设置 Redis 密码 + echo ${LINUX_PASSWORD} | sudo -S sed -i 's/^# requirepass.*$/requirepass '"${ONEX_REDIS_PASSWORD}"'/' ${redis_conf} + + # 因为我们上面配置了密码登录,需要将 protected-mode 设置为 no,关闭保护模式 + echo ${LINUX_PASSWORD} | sudo -S sed -i '/^protected-mode/{s/yes/no/}' ${redis_conf} + + # 为了能够远程连上 Redis,需要执行以下命令关闭防火墙,并禁止防火墙开机启动(如果不需要远程连接,可忽略此步骤) + set +o errexit + #onex::util::sudo "systemctl stop firewalld.service" + #onex::util::sudo "systemctl disable firewalld.service" + set -o errexit + + # 重启 Redis + #onex::util::sudo "redis-server ${redis_conf}" + onex::util::sudo "systemctl restart redis-server" + + onex::redis::status || return 1 + onex::redis::info + onex::log::info "install redis successfully" +} + +onex::redis::pre_install() +{ + onex::util::sudo "apt install -y redis-tools" +} + +# Uninstall the redis step by step. +onex::redis::sbs::uninstall() +{ + # 先删除 redis-server 进程,否则 `systemctl stop redis-server` 可能会卡主 + redis_pid=$(pgrep -f redis-server) + [[ ${redis_pid} != "" ]] && onex::util::sudo "kill -9 ${redis_pid}" + + set +o errexit + onex::util::sudo "systemctl stop redis-server" + onex::util::sudo "systemctl disable redis-server" + onex::util::sudo "apt remove -y redis-server" + onex::util::sudo "rm -rf /var/lib/redis" + set -o errexit + onex::log::info "uninstall redis successfully" +} + +# Print necessary information after docker or sbs installation. +onex::redis::info() +{ + echo -e ${C_GREEN}redis has been installed, here are some useful information:${C_NORMAL} + cat << EOF | sed 's/^/ /' +Redis access endpoint is: ${ONEX_REDIS_HOST}:${ONEX_REDIS_PORT} + Redis password is: ${ONEX_PASSWORD} + Redis Login Command: redis-cli --no-auth-warning -h ${ONEX_REDIS_HOST} -p ${ONEX_REDIS_PORT} -a '${ONEX_REDIS_PASSWORD}' +EOF +} + +# Status check after docker or sbs installation. +onex::redis::status() +{ + onex::util::telnet ${ONEX_REDIS_HOST} ${ONEX_REDIS_PORT} || return 1 + redis-cli --no-auth-warning -h ${ONEX_REDIS_HOST} -p ${ONEX_REDIS_PORT} -a "${ONEX_REDIS_PASSWORD}" --hotkeys || { + onex::log::error "can not login with ${ONEX_REDIS_USERNAME}, redis maybe not initialized properly." + return 1 + } +} + +if [[ "$*" =~ onex::redis:: ]]; then + eval $* +fi diff --git a/scripts/installation/template.sh b/scripts/installation/template.sh index b0138d4e2d1..2a34796c309 100755 --- a/scripts/installation/template.sh +++ b/scripts/installation/template.sh @@ -17,7 +17,7 @@ ONEX_TEMPLATE_PORT=${ONEX_TEMPLATE_PORT:-xxxx} # Install template using containerization. onex::template::docker::install() { - # docker run -d --name onex-xxx ... + # docker run -d --restart always --name onex-xxx ... onex::template::status || return 1 onex::template::info onex::log::info "install template successfully" diff --git a/scripts/installation/test.sh b/scripts/installation/test.sh index 760163204cb..59b81510c38 100755 --- a/scripts/installation/test.sh +++ b/scripts/installation/test.sh @@ -17,8 +17,7 @@ ONEX_PUMP_ADDR=${ONEX_ACCESS_HOST}:${ONEX_PUMP_HEALTH_CHECK_PORT} ONEX_TOYBLC_ADDR=${ONEX_ACCESS_HOST}:${ONEX_TOYBLC_HTTP_PORT} Header="-HContent-Type:application/json" -CURLARGS="-f -s" -#CURLARGS="" +CURLARGS="-S" CCURL="curl ${CURLARGS} -XPOST ${Header}" # Create UCURL="curl ${CURLARGS} -XPUT ${Header}" # Update RCURL="curl ${CURLARGS} -XGET" # Retrieve diff --git a/scripts/lib/init.sh b/scripts/lib/init.sh index b91e1865e44..45964814766 100755 --- a/scripts/lib/init.sh +++ b/scripts/lib/init.sh @@ -39,10 +39,9 @@ source "${ONEX_ROOT}/scripts/lib/golang.sh" # list of all available group versions. This should be used when generated code # or when starting an API server that you want to have everything. # most preferred version for a group should appear first +# UPDATEME: New group need to update here. ONEX_AVAILABLE_GROUP_VERSIONS="${ONEX_AVAILABLE_GROUP_VERSIONS:-\ apps/v1beta1 \ -coordination/v1 \ -core/v1 \ }" # This emulates "readlink -f" which is not available on MacOS X. diff --git a/scripts/lib/swagger.sh b/scripts/lib/swagger.sh deleted file mode 100755 index 3f113fd9617..00000000000 --- a/scripts/lib/swagger.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. -# - - -# Contains swagger related util functions. -# -set -o errexit -set -o nounset -set -o pipefail - -# Generates types_swagger_doc_generated file for the given group version. -# $1: Name of the group version -# $2: Path to the directory where types.go for that group version exists. This -# is the directory where the file will be generated. -onex::swagger::gen_types_swagger_doc() { - local group_version=$1 - local gv_dir=$2 - local TMPFILE - TMPFILE="${TMPDIR:-/tmp}/types_swagger_doc_generated.$(date +%s).go" - - echo "Generating swagger type docs for ${group_version} at ${gv_dir}" - - { - echo -e "$(cat ${ONEX_ROOT}/scripts/boilerplate.go.txt)\n" - echo "package ${group_version##*/}" - cat < "${TMPFILE}" - - if ! which genswaggertypedocs >/dev/null; then - # build if needed - go install k8s.io/kubernetes/cmd/genswaggertypedocs - fi - - for types in $(find ${gv_dir} -regex "/\(.*_\)types.go$") - do - genswaggertypedocs -s ${types} -f - >> "${TMPFILE}" - done - - echo "// AUTO-GENERATED FUNCTIONS END HERE" >> "${TMPFILE}" - - gofmt -w -s "${TMPFILE}" - mv "${TMPFILE}" "${gv_dir}/types_swagger_doc_generated.go" -} diff --git a/scripts/lib/util.sh b/scripts/lib/util.sh index 5a5b6021bb0..be41626edf4 100755 --- a/scripts/lib/util.sh +++ b/scripts/lib/util.sh @@ -235,69 +235,6 @@ function onex::util::find-binary() { onex::util::find-binary-for-platform "$1" "$(onex::util::host_platform)" } -# Run all known doc generators (today gendocs and genman for nodectl) -# $1 is the directory to put those generated documents -function onex::util::gen-docs() { - local dest="$1" - - # Find binary - gendocs=$(onex::util::find-binary "gen-docs") - genonexdocs=$(onex::util::find-binary "gen-onex-docs") - genman=$(onex::util::find-binary "gen-man") - genyaml=$(onex::util::find-binary "gen-yaml") - - mkdir -p "${dest}/docs/guide/en-US/cmd/onexctl" - "${gendocs}" "${dest}/docs/guide/en-US/cmd/onexctl/" - - mkdir -p "${dest}/docs/guide/en-US/cmd" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-fakeserver" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-usercenter" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-apiserver" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-gateway" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-nightwatch" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-pump" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-toyblc" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-controller-manager" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-minerset-controller" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-miner-controller" - "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/onexctl" "onexctl" - - mkdir -p "${dest}/docs/man/man1/" - "${genman}" "${dest}/docs/man/man1/" "onex-fakeserver" - "${genman}" "${dest}/docs/man/man1/" "onex-usercenter" - "${genman}" "${dest}/docs/man/man1/" "onex-apiserver" - "${genman}" "${dest}/docs/man/man1/" "onex-gateway" - "${genman}" "${dest}/docs/man/man1/" "onex-nightwatch" - "${genman}" "${dest}/docs/man/man1/" "onex-pump" - "${genman}" "${dest}/docs/man/man1/" "onex-toyblc" - "${genman}" "${dest}/docs/man/man1/" "onex-controller-manager" - "${genman}" "${dest}/docs/man/man1/" "onex-minerset-controller" - "${genman}" "${dest}/docs/man/man1/" "onex-miner-controller" - "${genman}" "${dest}/docs/man/man1/" "onexctl" - - mkdir -p "${dest}/docs/guide/en-US/yaml/onexctl/" - "${genyaml}" "${dest}/docs/guide/en-US/yaml/onexctl/" - - # create the list of generated files - pushd "${dest}" > /dev/null || return 1 - touch docs/.generated_docs - find . -type f | cut -sd / -f 2- | LC_ALL=C sort > docs/.generated_docs - popd > /dev/null || return 1 -} - -# Removes previously generated docs-- we don't want to check them in. $ONEX_ROOT -# must be set. -function onex::util::remove-gen-docs() { - if [ -e "${ONEX_ROOT}/docs/.generated_docs" ]; then - # remove all of the old docs; we don't want to check them in. - while read -r file; do - rm "${ONEX_ROOT}/${file}" 2>/dev/null || true - done <"${ONEX_ROOT}/docs/.generated_docs" - # The docs/.generated_docs file lists itself, so we don't need to explicitly - # delete it. - fi -} - # Takes a group/version and returns the path to its location on disk, sans # "pkg". E.g.: # * default behavior: extensions/v1beta1 -> apis/extensions/v1beta1 @@ -307,6 +244,7 @@ function onex::util::remove-gen-docs() { # * Very special handling for when both group and version are "": / -> api # # $ONEX_ROOT must be set. +# UPDATEME: When add new api group. function onex::util::group-version-to-pkg-path() { local group_version="$1" @@ -318,15 +256,18 @@ function onex::util::group-version-to-pkg-path() { __internal) echo "pkg/apis/core" ;; - core/v1) - echo "${ONEX_ROOT}/pkg/apis/core/v1" - ;; + #core/v1) + #echo "${ONEX_ROOT}/pkg/apis/core/v1" + #;; apps/v1beta1) echo "${ONEX_ROOT}/pkg/apis/apps/v1beta1" ;; - coordination/v1) - echo "${ONEX_ROOT}/pkg/apis/coordination/v1" - ;; + #coordination/v1) + #echo "${ONEX_ROOT}/pkg/apis/coordination/v1" + #;; + #apiextensions/v1) + #echo "${ONEX_ROOT}/pkg/apis/apiextensions/v1" + #;; *) echo "pkg/apis/${group_version%__internal}" ;; diff --git a/scripts/lib/verify-generated.sh b/scripts/lib/verify-generated.sh new file mode 100755 index 00000000000..6f082be115f --- /dev/null +++ b/scripts/lib/verify-generated.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# Copyright 2014 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Short-circuit if verify-generated.sh has already been sourced. +[[ $(type -t onex::verify::generated::loaded) == function ]] && return 0 + +source "${ONEX_ROOT}/scripts/lib/init.sh" + +# This function verifies whether generated files are up-to-date. The first two +# parameters are messages that get printed to stderr when changes are found, +# the rest are the function or command and its parameters for generating files +# in the work tree. +# +# Example: onex::verify::generated "Mock files are out of date" "Please run 'scripts/update-mocks.sh'" scripts/update-mocks.sh +onex::verify::generated() { + ( # a subshell prevents environment changes from leaking out of this function + local failure_header=$1 + shift + local failure_tail=$1 + shift + + onex::util::ensure_clean_working_dir + + # This sets up the environment, like GOCACHE, which keeps the worktree cleaner. + onex::golang::setup_env + + _tmpdir="$(onex::realpath "$(mktemp -d -t "verify-generated-$(basename "$1").XXXXXX")")" + git worktree add -f -q "${_tmpdir}" HEAD + onex::util::trap_add "git worktree remove -f ${_tmpdir}" EXIT + cd "${_tmpdir}" + + # Update generated files. + "$@" + + # Test for diffs + diffs=$(git status --porcelain | wc -l) + if [[ ${diffs} -gt 0 ]]; then + if [[ -n "${failure_header}" ]]; then + echo "${failure_header}" >&2 + fi + git status >&2 + git diff >&2 + if [[ -n "${failure_tail}" ]]; then + echo "" >&2 + echo "${failure_tail}" >&2 + fi + return 1 + fi + ) +} + +# Marker function to indicate verify-generated.sh has been fully sourced. +onex::verify::generated::loaded() { + return 0 +} diff --git a/scripts/make-rules/all.mk b/scripts/make-rules/all.mk index 51d7544798f..ce02b165234 100644 --- a/scripts/make-rules/all.mk +++ b/scripts/make-rules/all.mk @@ -4,7 +4,7 @@ include scripts/make-rules/tools.mk # include at second order include scripts/make-rules/golang.mk -include scripts/make-rules/generate-k8s.mk +#include scripts/make-rules/generate-k8s.mk include scripts/make-rules/generate.mk include scripts/make-rules/image.mk include scripts/make-rules/chart.mk diff --git a/scripts/make-rules/common-versions.mk b/scripts/make-rules/common-versions.mk index 07a30581b1d..aeba388a67f 100644 --- a/scripts/make-rules/common-versions.mk +++ b/scripts/make-rules/common-versions.mk @@ -9,7 +9,7 @@ HADOLINT_VER ?= v2.10.0 CHART_VERSION ?= 1.0.0 #KIND_VERSION ?= v0.22.0 KIND_VERSION ?= v0.19.0 -HELM_VERSION ?= v3.8.1 +HELM_VERSION ?= v3.15.1 GO_TESTS_SUM_VERSION ?=v1.6.4 GOLANGCI_LINT_VERSION := v1.55.2 YQ_VERSION ?= v4.25.2 @@ -31,7 +31,7 @@ GO_JUNIT_REPORT_VERSION ?= v2.1.0 GO_TESTS_VERSION ?= v1.6.0 GO_IMPORTS_VERSION ?= v0.14.2 GO_GIT_LINT_VERSION ?= v1.1.1 -GSEMVER_VERSION ?= v0.9.0 +GSEMVER_VERSION ?= v0.9.1 GIT_CHGLOG_VERSION ?= v0.15.4 ADDLICENSE_VERSION ?= v0.0.2 KUSTOMIZE_VERSION ?= v5.3.0 diff --git a/scripts/make-rules/deploy.mk b/scripts/make-rules/deploy.mk index a9df8ddec88..93b670e58d4 100644 --- a/scripts/make-rules/deploy.mk +++ b/scripts/make-rules/deploy.mk @@ -5,19 +5,23 @@ KUBECTL := kubectl NAMESPACE ?= onex -CONTEXT ?= kind-onex -DEPLOYS=onex-usercenter onex-gateway +DEPLOYS ?= onex-usercenter onex-gateway -.PHONY: deploy.kind -deploy.kind: $(addprefix deploy.deploy., $(addprefix $(PLATFORM)., $(DEPLOYS))) ## Deploy all configured services. +.PHONY: deploy.run +deploy.run: $(addprefix deploy.run., $(addprefix $(PLATFORM)., $(DEPLOYS))) ## Deploy all configured services. -.PHONY: deploy.kind.% -deploy.kind.%: image.build.% ## Deploy a specified service. (Note: Use `make deploy.` to deploy a specific service.) +.PHONY: deploy.run.% +deploy.run.%: image.push.% ## Deploy a specified service. $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM)))) $(eval DEPLOY := $(word 2,$(subst ., ,$*))) - @echo "===========> Deploying $(REGISTRY_PREFIX)/$(DEPLOY)-$(ARCH):$(VERSION)" - @$(KUBECTL) -n $(NAMESPACE) --context=$(CONTEXT) set image deployment/$(DEPLOY) $(DEPLOY)=$(REGISTRY_PREFIX)/$(DEPLOY)-$(ARCH):$(VERSION) + # In the SemVer versioning specification, the use of the "+" sign is possible, but container image tag names + # do not support the "+" character. Therefore, it is necessary to replace the "+" with "-" in the version number. + # For example, the version number "v0.18.0+20240121235656" should be transformed into "v0.18.0-20240121235656" for + # use as a container tag name. + $(eval IMAGE_TAG := $(subst +,-,$(VERSION))) + @echo "===========> Deploying $(REGISTRY_PREFIX)/$(DEPLOY)-$(ARCH):$(IMAGE_TAG)" + @$(KUBECTL) -n $(NAMESPACE) set image deployment/$(DEPLOY) $(DEPLOY)=$(REGISTRY_PREFIX)/$(DEPLOY)-$(ARCH):$(IMAGE_TAG) .PHONY: deploy.docker deploy.docker: diff --git a/scripts/make-rules/generate-k8s.mk b/scripts/make-rules/generate-k8s.mk index 172736034e6..63df58004f0 100644 --- a/scripts/make-rules/generate-k8s.mk +++ b/scripts/make-rules/generate-k8s.mk @@ -1,6 +1,7 @@ # ============================================================================== # Makefile helper functions used to generate kubernetes related files and go functions. # +# Deprecated: Please use scripts/update-codegen.sh. This Makefile script is kept for possible future reference. # Don't allow an implicit 'all' rule. This is not a user-facing file. #ifeq ($(MAKECMDGOALS),) diff --git a/scripts/make-rules/generate.mk b/scripts/make-rules/generate.mk index de6f845144c..323ea48ebbc 100644 --- a/scripts/make-rules/generate.mk +++ b/scripts/make-rules/generate.mk @@ -31,7 +31,7 @@ gen.docgo.check: gen.docgo.doc ## Check missing doc.go for go packages. .PHONY: gen.docs gen.docs: ## Update generated swagger docs. - @${SCRIPTS_DIR}/update-generated-swagger-docs.sh + @${SCRIPTS_DIR}/update-codegen.sh swagger .PHONY: gen.appdocs gen.appdocs: ## Update generated application docs. @@ -63,7 +63,7 @@ gen.protoc: ## Generate go source files from protobuf files. @protoc \ --proto_path=$(APIROOT) \ --proto_path=$(APISROOT) \ - --proto_path=$(ONEX_ROOT)/third_party \ + --proto_path=$(ONEX_ROOT)/third_party/protobuf \ --go_out=paths=source_relative:$(APIROOT) \ --go-http_out=paths=source_relative:$(APIROOT) \ --go-grpc_out=paths=source_relative:$(APIROOT) \ @@ -79,13 +79,13 @@ gen.protoc: ## Generate go source files from protobuf files. @protoc \ --proto_path=$(APIROOT) \ --proto_path=$(APISROOT) \ - --proto_path=$(ONEX_ROOT)/third_party \ + --proto_path=$(ONEX_ROOT)/third_party/protobuf \ --grpc-gateway_out=paths=source_relative:$(APIROOT) \ $(shell find $(APIROOT)/fakeserver -name *.proto) .PHONY: gen.apisprotobuf gen.apisprotobuf: ## Generate protobuf files from structs. - @$(SCRIPTS_DIR)/update-codegen.sh + #@$(SCRIPTS_DIR)/update-codegen.sh @cp $(ONEX_ROOT)/manifests/generated.pb.go.fix $(ONEX_ROOT)/pkg/apis/apps/v1beta1/generated.pb.go .PHONY: go.generate diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index 43720b3aaf1..d2ff6c71842 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -6,12 +6,55 @@ GO := go # Minimum supported go version. GO_MINIMUM_VERSION ?= 1.22 +ifeq ($(PRJ_SRC_PATH),) + $(error the variable PRJ_SRC_PATH must be set prior to including golang.mk) +endif +ifeq ($(ONEX_ROOT),) + $(error the variable ONEX_ROOT must be set prior to including golang.mk) +endif + + +VERSION_PACKAGE := github.com/superproj/onex/pkg/version +# Check if the tree is dirty. default to dirty +GIT_TREE_STATE:="dirty" +ifeq (, $(shell git status --porcelain 2>/dev/null)) + GIT_TREE_STATE="clean" +endif +GIT_COMMIT:=$(shell git rev-parse HEAD) + +GO_LDFLAGS += \ + -X $(VERSION_PACKAGE).gitVersion=$(VERSION) \ + -X $(VERSION_PACKAGE).gitCommit=$(GIT_COMMIT) \ + -X $(VERSION_PACKAGE).gitTreeState=$(GIT_TREE_STATE) \ + -X $(VERSION_PACKAGE).buildDate=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ') \ + -X main.Version=$(VERSION) +ifneq ($(DLV),) + GO_BUILD_FLAGS += -gcflags "all=-N -l" +else + # -s removes symbol information; -w removes DWARF debugging information; The final program cannot be debugged with gdb + GO_BUILD_FLAGS += -ldflags "-s -w" +endif + +# Available cpus for compiling, please refer to https://github.com/caicloud/engineering/issues/8186#issuecomment-518656946 for more info +CPUS := $(shell /bin/bash $(ONEX_ROOT)/scripts/read_cpus_available.sh) + +# Default golang flags used in build and test +# -p: the number of programs that can be run in parallel +# -ldflags: arguments to pass on each go tool link invocation +GO_BUILD_FLAGS += -p="$(CPUS)" -ldflags "$(GO_LDFLAGS)" + +ifeq ($(GOOS),windows) + GO_OUT_EXT := .exe +endif + GOPATH := $(shell go env GOPATH) ifeq ($(origin GOBIN), undefined) GOBIN := $(GOPATH)/bin endif -COMMANDS ?= $(filter-out %.md, $(wildcard ${ONEX_ROOT}/cmd/*)) +CMD_DIRS := $(wildcard $(ONEX_ROOT)/cmd/*) +# Filter out directories without Go files, as these directories cannot be compiled. +COMMANDS := $(filter-out $(wildcard %.md), $(foreach dir, $(CMD_DIRS), $(if $(wildcard $(dir)/*.go), $(dir),))) BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd})) ifeq (${COMMANDS},) diff --git a/scripts/make-rules/image.mk b/scripts/make-rules/image.mk index f19b49b1491..f8c148cd39d 100644 --- a/scripts/make-rules/image.mk +++ b/scripts/make-rules/image.mk @@ -20,10 +20,10 @@ _DOCKER_BUILD_EXTRA_ARGS += $(EXTRA_ARGS) endif # Determine image files by looking into cmd/* -IMAGES_DIR ?= $(wildcard ${ONEX_ROOT}/cmd/*) -# Determine images names by stripping out the dir names -IMAGES ?= $(filter-out tools,$(foreach image,${IMAGES_DIR},$(notdir ${image}))) - +CMD_DIRS ?= $(wildcard ${ONEX_ROOT}/cmd/*) +# Determine images names by stripping out the dir names. +# Filter out directories without Go files, as these directories cannot be compiled to build a docker image. +IMAGES ?= $(filter-out tools, $(foreach dir, $(CMD_DIRS), $(notdir $(if $(wildcard $(dir)/*.go), $(dir),)))) ifeq (${IMAGES},) $(error Could not determine IMAGES, set ONEX_ROOT or run in source dir) endif @@ -73,7 +73,12 @@ image.build.%: go.build.% image.dockerfile.% ## Build specified docker image. $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM)))) $(eval DOCKERFILE := Dockerfile) $(eval DST_DIR := $(TMP_DIR)/$(IMAGE)) - @echo "===========> Building docker image $(IMAGE) $(VERSION) for $(IMAGE_PLAT)" + # In the SemVer versioning specification, the use of the "+" sign is possible, but container image tag names + # do not support the "+" character. Therefore, it is necessary to replace the "+" with "-" in the version number. + # For example, the version number "v0.18.0+20240121235656" should be transformed into "v0.18.0-20240121235656" for + # use as a container tag name. + $(eval IMAGE_TAG := $(subst +,-,$(VERSION))) + @echo "===========> Building docker image $(IMAGE) $(IMAGE_TAG) for $(IMAGE_PLAT)" @mkdir -p $(TMP_DIR)/$(IMAGE) @cp -r $(OUTPUT_DIR)/platforms/$(IMAGE_PLAT)/$(IMAGE) $(TMP_DIR)/$(IMAGE)/ @@ -86,7 +91,8 @@ image.build.%: image.dockerfile.% ## Build specified docker image in multistage $(eval ARCH := $(word 2,$(subst _, ,$(PLATFORM)))) $(eval DOCKERFILE := Dockerfile.multistage) $(eval DST_DIR := $(ONEX_ROOT)) - @echo "===========> Building docker image $(IMAGE) $(VERSION) for $(IMAGE_PLAT)" + $(eval IMAGE_TAG := $(subst +,-,$(VERSION))) + @echo "===========> Building docker image $(IMAGE) $(IMAGE_TAG) for $(IMAGE_PLAT)" endif @export OUTPUT_DIR=$(OUTPUT_DIR) @if [ -f $(ONEX_ROOT)/build/docker/$(IMAGE)/build.sh ] ; then \ @@ -99,7 +105,7 @@ endif --build-arg ARCH=$(ARCH) \ --build-arg goproxy=$($(GO) env GOPROXY) \ --label $(DOCKER_LABELS) \ - -t $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(VERSION) \ + -t $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(IMAGE_TAG) \ $(DST_DIR)) @if [ $(shell $(GO) env GOARCH) != $(ARCH) ] ; then \ $(MAKE) image.daemon.verify ; \ @@ -117,8 +123,9 @@ image.push.multiarch: image.verify go.build.verify $(foreach p,$(PLATFORMS),$(ad .PHONY: image.push.% image.push.%: image.build.% ## Build and push specified docker image. - @echo "===========> Pushing image $(IMAGE) $(VERSION) to $(REGISTRY_PREFIX)" - $(DOCKER) push $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(VERSION) + # NOTICE: The `IMAGE_TAG` variable is inherited from the `image.build.%` makefile rule. + @echo "===========> Pushing image $(IMAGE) $(IMAGE_TAG) to $(REGISTRY_PREFIX)" + $(DOCKER) push $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(IMAGE_TAG) .PHONY: image.manifest.push image.manifest.push: export DOCKER_CLI_EXPERIMENTAL := enabled @@ -126,13 +133,13 @@ image.manifest.push: image.verify go.build.verify $(addprefix image.manifest.pus .PHONY: image.manifest.push.% image.manifest.push.%: image.push.% image.manifest.remove.% - @echo "===========> Pushing manifest $(IMAGE) $(VERSION) to $(REGISTRY_PREFIX) and then remove the local manifest list" - @$(DOCKER) manifest create $(REGISTRY_PREFIX)/$(IMAGE):$(VERSION) \ - $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(VERSION) - @$(DOCKER) manifest annotate $(REGISTRY_PREFIX)/$(IMAGE):$(VERSION) \ - $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(VERSION) \ + @echo "===========> Pushing manifest $(IMAGE) $(IMAGE_TAG) to $(REGISTRY_PREFIX) and then remove the local manifest list" + @$(DOCKER) manifest create $(REGISTRY_PREFIX)/$(IMAGE):$(IMAGE_TAG) \ + $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(IMAGE_TAG) + @$(DOCKER) manifest annotate $(REGISTRY_PREFIX)/$(IMAGE):$(IMAGE_TAG) \ + $(REGISTRY_PREFIX)/$(IMAGE)-$(ARCH):$(IMAGE_TAG) \ --os $(OS) --arch ${ARCH} - @$(DOCKER) manifest push --purge $(REGISTRY_PREFIX)/$(IMAGE):$(VERSION) + @$(DOCKER) manifest push --purge $(REGISTRY_PREFIX)/$(IMAGE):$(IMAGE_TAG) # Docker cli has a bug: https://github.com/docker/cli/issues/954 # If you find your manifests were not updated, @@ -140,13 +147,13 @@ image.manifest.push.%: image.push.% image.manifest.remove.% # and re-run. .PHONY: image.manifest.remove.% image.manifest.remove.%: - @rm -rf ${HOME}/.docker/manifests/docker.io_$(REGISTRY_PREFIX)_$(IMAGE)-$(VERSION) + @rm -rf ${HOME}/.docker/manifests/docker.io_$(REGISTRY_PREFIX)_$(IMAGE)-$(IMAGE_TAG) .PHONY: image.manifest.push.multiarch image.manifest.push.multiarch: image.push.multiarch $(addprefix image.manifest.push.multiarch., $(IMAGES)) .PHONY: image.manifest.push.multiarch.% image.manifest.push.multiarch.%: - @echo "===========> Pushing manifest $* $(VERSION) to $(REGISTRY_PREFIX) and then remove the local manifest list" - REGISTRY_PREFIX=$(REGISTRY_PREFIX) PLATFROMS="$(PLATFORMS)" IMAGE=$* VERSION=$(VERSION) DOCKER_CLI_EXPERIMENTAL=enabled \ + @echo "===========> Pushing manifest $* $(IMAGE_TAG) to $(REGISTRY_PREFIX) and then remove the local manifest list" + REGISTRY_PREFIX=$(REGISTRY_PREFIX) PLATFROMS="$(PLATFORMS)" IMAGE=$* VERSION=$(IMAGE_TAG) DOCKER_CLI_EXPERIMENTAL=enabled \ $(ONEX_ROOT)/build/lib/create-manifest.sh diff --git a/scripts/make-rules/release.mk b/scripts/make-rules/release.mk index 2a81988d22f..160e3eee26b 100644 --- a/scripts/make-rules/release.mk +++ b/scripts/make-rules/release.mk @@ -8,13 +8,9 @@ .PHONY: release.run release.run: tools.verify.uplift release._check ## Generate and commit CHANGELOG, then tag the git repo. - @uplift release --fetch-all --skip-bumps + @uplift release --fetch-all release._check: - @if [[ "$(shell git symbolic-ref --short HEAD)" != "master" ]]; then \ - echo "Branch format is incorrect. Please switch to master branch"; \ - exit 1; \ - fi @if ! git diff --quiet; then \ echo "Git repository is not clean"; \ exit 1; \ diff --git a/scripts/make-rules/tools.mk b/scripts/make-rules/tools.mk index aba92d2b26a..bb8c8f324f1 100644 --- a/scripts/make-rules/tools.mk +++ b/scripts/make-rules/tools.mk @@ -5,7 +5,8 @@ # like `make _install.gotests`, you should run `make tools.install.gotests` instead. # # Specify tools category. -CODE_GENERATOR_TOOLS= client-gen lister-gen informer-gen defaulter-gen deepcopy-gen prerelease-lifecycle-gen conversion-gen openapi-gen +CODE_GENERATOR_TOOLS= client-gen conversion-gen deepcopy-gen defaulter-gen informer-gen lister-gen prerelease-lifecycle-gen \ + register-gen applyconfiguration-gen go-to-protobuf # code-generator is a makefile target not a real tool. CI_WORKFLOW_TOOLS := code-generator golangci-lint goimports wire # unused tools in this project: gentool @@ -46,12 +47,12 @@ _install.ci: $(addprefix tools.install., $(CI_WORKFLOW_TOOLS)) ## Install necess _install.other: $(addprefix tools.install., $(OTHER_TOOLS)) .PHONY: _install.code-generator -_install.code-generator: $(addprefix tools.install.code-generator., $(CODE_GENERATOR_TOOLS)) ## Install all necessary code-generator tools. +_install.code-generator: $(addprefix _install.code-generator., $(CODE_GENERATOR_TOOLS)) ## Install all necessary code-generator tools. .PHONY: _install.code-generator.% _install.code-generator.%: ## Install specified code-generator tool. - @$(GO) install k8s.io/code-generator/cmd/$*@$(CODE_GENERATOR_VERSION) - #@$(GO) install github.com/colin404/code-generator/cmd/$*@$(CODE_GENERATOR_VERSION) + @echo "===========> Installing code-generator: $*" + $(GO) install k8s.io/code-generator/cmd/$*@$(CODE_GENERATOR_VERSION) .PHONY: _install.swagger _install.swagger: @@ -173,7 +174,7 @@ _install.kubeconform: ## Install kubeconform command line tool. .PHONY: _install.kubectl _install.kubectl: ## Install kubectl command line tool. - @curl --create-dirs -L -o $$HOME/bin/kubectl "https://dl.k8s.io/release/$(shell curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + @curl --create-dirs -L -o $$HOME/bin/kubectl "https://dl.k8s.io/release/$(shell curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/$(shell $(GO) env GOHOSTARCH)/kubectl" @chmod +x $$HOME/bin/kubectl @$(SCRIPTS_DIR)/add-completion.sh kubectl bash @@ -212,6 +213,7 @@ _install.kubebuilder : ## Install kubebuilder tool which is used to building Kub @curl -sL -o kubebuilder https://go.kubebuilder.io/dl/latest/$(shell $(GO) env GOOS)/$(shell $(GO) env GOARCH) @mkdir -p ${HOME}/bin @chmod +x kubebuilder && mv kubebuilder ${HOME}/bin + @$(SCRIPTS_DIR)/add-completion.sh kubebuilder bash # gomodifytags -all -add-tags json -w -transform camelcase --skip-unexported -file *.go .PHONY: _install.gomodifytags diff --git a/scripts/mksuger.sh b/scripts/mksuger.sh index 857ceb7d8b4..9a62f3ebcab 100755 --- a/scripts/mksuger.sh +++ b/scripts/mksuger.sh @@ -29,11 +29,21 @@ getcomponents() { # Load docker images to kind cluster load_docker_image() { + # Only kind cluster need to load image. + if ! kubectl config view | grep -q 'cluster: kind-';then + return + fi + NODES=${KIND_LOAD_NODES:-$(kubectl get nodes|awk '/Ready/ && !/SchedulingDisabled/{nodes=nodes$1","} END{gsub(/,$/,"",nodes);print nodes}')} local comp="$1" - kind load docker-image --name ${ONEX_KIND_CLUSTER_NAME} --nodes ${NODES} ccr.ccs.tencentyun.com/superproj/${comp}-amd64:${OVERSION} + # In the SemVer versioning specification, the use of the "+" sign is possible, but container image tag names + # do not support the "+" character. Therefore, it is necessary to replace the "+" with "-" in the version number. + # For example, the version number "v0.18.0+20240121235656" should be transformed into "v0.18.0-20240121235656" for + # use as a container tag name. + kind load docker-image --name ${ONEX_KIND_CLUSTER_NAME} --nodes ${NODES} \ + ccr.ccs.tencentyun.com/superproj/${comp}-amd64:$(echo ${OVERSION} | sed 's/+/-/') } # Build docker images @@ -43,10 +53,7 @@ build_image() { for comp in "${COMPONENTS[@]}" do - # 容器镜像标签名不支持 "+" 字符,所以需要将版本号中的 "+" 替换为 "-"。例如将 - # 版本号"v0.18.0+20240121235656",转换为 "v0.18.0-20240121235656" 作为容器标签名 - # 转换方式为:VERSION=$(echo ${OVERSION} | sed 's/+/-/') - make -C ${ONEX_ROOT} ${cmd} IMAGES=${comp} VERSION=$(echo ${OVERSION} | sed 's/+/-/') MULTISTAGE=0 + make -C ${ONEX_ROOT} ${cmd} IMAGES=${comp} VERSION=${OVERSION} MULTISTAGE=0 [[ "$LOAD" == true ]] && load_docker_image ${comp} done } diff --git a/scripts/pin-dependency.sh b/scripts/pin-dependency.sh index ef075795c9d..6c1abb6e136 100755 --- a/scripts/pin-dependency.sh +++ b/scripts/pin-dependency.sh @@ -25,19 +25,19 @@ set -o pipefail ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${ONEX_ROOT}/scripts/lib/init.sh" -# Explicitly opt into go modules, even though we're inside a GOPATH directory -export GO111MODULE=on -# Explicitly set GOFLAGS to ignore vendor, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor -export GOFLAGS=-mod=mod # Detect problematic GOPROXY settings that prevent lookup of dependencies if [[ "${GOPROXY:-}" == "off" ]]; then onex::log::error "Cannot run with \$GOPROXY=off" exit 1 fi -onex::golang::verify_go_version +onex::golang::setup_env onex::util::require-jq +# Explicitly set GOFLAGS to ignore vendor, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor +export GOWORK=off +export GOFLAGS=-mod=mod + dep="${1:-}" sha="${2:-}" @@ -64,20 +64,11 @@ if [[ -z "${dep}" || -z "${replacement}" || -z "${sha}" ]]; then echo " scripts/pin-dependency.sh github.com/docker/docker=github.com/johndoe/docker my-experimental-branch" echo "" echo "Replacing with a different repository is useful for testing but" - echo "the result should never be merged into OneX!" + echo "the result should never be merged into Kubernetes!" echo "" exit 1 fi -_tmp="${ONEX_ROOT}/_tmp" -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT -cleanup -mkdir -p "${_tmp}" - - # Find the resolved version before trying to use it. echo "Running: go mod download ${replacement}@${sha}" if meta=$(go mod download -json "${replacement}@${sha}"); then diff --git a/scripts/update-codegen.sh b/scripts/update-codegen.sh index 7a611472d5f..60b5a6ba169 100755 --- a/scripts/update-codegen.sh +++ b/scripts/update-codegen.sh @@ -20,7 +20,7 @@ set -o nounset set -o pipefail # This tool wants a different default than usual. -ONEX_VERBOSE="${ONEX_VERBOSE:-1}" +KUBE_VERBOSE="${KUBE_VERBOSE:-1}" ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${ONEX_ROOT}/scripts/lib/init.sh" @@ -35,9 +35,12 @@ UPDATE_API_KNOWN_VIOLATIONS="${UPDATE_API_KNOWN_VIOLATIONS:-}" API_KNOWN_VIOLATIONS_DIR="${API_KNOWN_VIOLATIONS_DIR:-"${ONEX_ROOT}/api/api-rules"}" OUT_DIR="_output" -PRJ_SRC_PATH="k8s.io/kubernetes" -BOILERPLATE_FILENAME="hack/boilerplate/boilerplate.generatego.txt" -APPLYCONFIG_PKG="k8s.io/client-go/applyconfigurations" +BOILERPLATE_FILENAME="scripts/boilerplate/boilerplate.go.txt" +ONEX_MODULE_NAME="github.com/superproj/onex" +PLURAL_EXCEPTIONS="Endpoints:Endpoints,ResourceClaimParameters:ResourceClaimParameters,ResourceClassParameters:ResourceClassParameters" +EXTRA_GENERATE_PKG=(k8s.io/api/core/v1 k8s.io/api/coordination/v1 k8s.io/api/flowcontrol/v1 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1) +OUTPUT_PKG="github.com/superproj/onex/pkg/generated" +APPLYCONFIG_PKG="${OUTPUT_PKG}/applyconfigurations" # Any time we call sort, we want it in the same locale. export LC_ALL="C" @@ -49,11 +52,20 @@ if [[ "${DBG_CODEGEN}" == 1 ]]; then onex::log::status "DBG: starting generated_files" fi +# Generate a list of directories we don't want to play in. +DIRS_TO_AVOID=() +onex::util::read-array DIRS_TO_AVOID < <( + git ls-files -cmo --exclude-standard -- ':!:vendor/*' ':(glob)*/**/go.work' \ + | while read -r F; do \ + echo ':!:'"$(dirname "${F}")"; \ + done + ) + function git_find() { # Similar to find but faster and easier to understand. We want to include # modified and untracked files because this might be running against code # which is not tracked by git yet. - git ls-files -cmo --exclude-standard ':!:manifests/*' ':!:third_party/*' ':!:vendor/*' "$@" + git ls-files -cmo --exclude-standard ':!:vendor/*' "${DIRS_TO_AVOID[@]}" "$@" } function git_grep() { @@ -61,9 +73,30 @@ function git_grep() { # running against code which is not tracked by git yet. # We need vendor exclusion added at the end since it has to be part of # the pathspecs which are specified last. - git grep --untracked "$@" ':!:vendor/*' + git grep --untracked "$@" ':!:vendor/*' "${DIRS_TO_AVOID[@]}" } +# Generate a list of all files that have a `+k8s:` comment-tag. This will be +# used to derive lists of files/dirs for generation tools. +if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s: tags" +fi +ALL_K8S_TAG_FILES=() +onex::util::read-array ALL_K8S_TAG_FILES < <( + git_grep -l \ + -e '^// *+k8s:' `# match +k8s: tags` \ + -- \ + ':!:*/testdata/*' `# not under any testdata` \ + ':(glob)**/*.go' `# in any *.go file` \ + ) +if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#ALL_K8S_TAG_FILES[@]} +k8s: tagged files" +fi + +# +# Code generation logic. +# + # protobuf generation # # Some of the later codegens depend on the results of this, so it needs to come @@ -79,7 +112,7 @@ function codegen::protobuf() { -e '// +k8s:protobuf-gen=package' \ -- \ cmd pkg \ - | xargs -0 -n1 dirname \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ | sed 's|^|github.com/superproj/onex/|;s|k8s.io/kubernetes/staging/src/||' \ | sort -u) @@ -90,13 +123,871 @@ function codegen::protobuf() { onex::log::status "DBG: $dir" done fi + # NOTICE: must include k8s.io/api/core/v1, otherwise it will generate the message ObjectReference + # in pkg/apis/apps/v1beta1/generated.proto, which will cause a compilation error when compiling + # onex-apiserver: undefined: ObjectReference. + apis+=("${EXTRA_GENERATE_PKG}") + + # Comment this out, otherwise it will delete some useful protobuf files. + #git_find -z \ + #':(glob)**/generated.proto' \ + #':(glob)**/generated.pb.go' \ + #| xargs -0 rm -f + + if onex::protoc::check_protoc >/dev/null; then + scripts/_update-generated-protobuf-dockerized.sh "${apis[@]}" + else + onex::log::status "protoc ${PROTOC_VERSION} not found (can install with scripts/install-protoc.sh); generating containerized..." + build/run.sh scripts/_update-generated-protobuf-dockerized.sh "${apis[@]}" + fi + + # Fix `pkg/apis/apps/v1beta1/generated.pb.go:49:10: undefined: ObjectReference` compile errors + # cp ${ONEX_ROOT}/manifests/generated.pb.go.fix ${ONEX_ROOT}/pkg/apis/apps/v1beta1/generated.pb.go +} + +# Deep-copy generation +# +# Any package that wants deep-copy functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:deepcopy-gen= +# +# The may be one of: +# generate: generate deep-copy functions into the package +# register: generate deep-copy functions and register them with a +# scheme +function codegen::deepcopy() { + # Build the tool. + GOPROXY=off go install \ + k8s.io/code-generator/cmd/deepcopy-gen + + # The result file, in each pkg, of deep-copy generation. + local output_file="${GENERATED_FILE_PREFIX}deepcopy.go" + + # Find all the directories that request deep-copy generation. + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s:deepcopy-gen tags" + fi + local tag_dirs=() + onex::util::read-array tag_dirs < <( \ + grep -l --null '+k8s:deepcopy-gen=' "${ALL_K8S_TAG_FILES[@]}" \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ + | sort -u) + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#tag_dirs[@]} +k8s:deepcopy-gen tagged dirs" + fi + + local tag_pkgs=() + for dir in "${tag_dirs[@]}"; do + tag_pkgs+=("./$dir") + done + + onex::log::status "Generating deepcopy code for ${#tag_pkgs[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running deepcopy-gen for:" + for dir in "${tag_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + git_find -z ':(glob)**'/"${output_file}" | xargs -0 rm -f + + deepcopy-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --output-file "${output_file}" \ + --bounding-dirs "${ONEX_MODULE_NAME},k8s.io/api" \ + "${tag_pkgs[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated deepcopy code" + fi +} + +# Generates types_swagger_doc_generated file for the given group version. +# $1: Name of the group version +# $2: Path to the directory where types.go for that group version exists. This +# is the directory where the file will be generated. +function gen_types_swagger_doc() { + local group_version="$1" + local gv_dir="$2" + local tmpfile + tmpfile="${TMPDIR:-/tmp}/types_swagger_doc_generated.$(date +%s).go" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running gen-swaggertype-docs for ${group_version} at ${gv_dir}" + fi + + { + cat "${BOILERPLATE_FILENAME}" + echo + echo "package ${group_version##*/}" + # Indenting here prevents the boilerplate checker from thinking this file + # is generated - gofmt will fix the indents anyway. + cat < "${tmpfile}" + + for types in $(find ${gv_dir} -name "*types.go") + do + gen-swaggertype-docs \ + -s \ + "${types}" \ + -f - \ + >> "${tmpfile}" + done + + echo "// AUTO-GENERATED FUNCTIONS END HERE" >> "${tmpfile}" + + gofmt -w -s "${tmpfile}" + mv "${tmpfile}" "${gv_dir}/types_swagger_doc_generated.go" +} + +# swagger generation +# +# Some of the later codegens depend on the results of this, so it needs to come +# first in the case of regenerating everything. +function codegen::swagger() { + # Build the tool + if ! command -v gen-swaggertype-docs &> /dev/null ; then + GOPROXY=off go install ${ONEX_ROOT}/cmd/gen-swaggertype-docs + fi + + local group_versions=() + IFS=" " read -r -a group_versions <<< "${ONEX_AVAILABLE_GROUP_VERSIONS}" + + onex::log::status "Generating swagger for ${#group_versions[@]} targets" + + git_find -z ':(glob)**/types_swagger_doc_generated.go' | xargs -0 rm -f + + # Regenerate files. + for group_version in "${group_versions[@]}"; do + gen_types_swagger_doc "${group_version}" "$(onex::util::group-version-to-pkg-path "${group_version}")" + done +} + +# prerelease-lifecycle generation +# +# Any package that wants prerelease-lifecycle functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:prerelease-lifecycle-gen=true +function codegen::prerelease() { + # Build the tool. + GOPROXY=off go install \ + k8s.io/code-generator/cmd/prerelease-lifecycle-gen + + # The result file, in each pkg, of prerelease-lifecycle generation. + local output_file="${GENERATED_FILE_PREFIX}prerelease-lifecycle.go" + + # Find all the directories that request prerelease-lifecycle generation. + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s:prerelease-lifecycle-gen tags" + fi + local tag_dirs=() + onex::util::read-array tag_dirs < <( \ + grep -l --null '+k8s:prerelease-lifecycle-gen=true' "${ALL_K8S_TAG_FILES[@]}" \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ + | sort -u) + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#tag_dirs[@]} +k8s:prerelease-lifecycle-gen tagged dirs" + fi + + local tag_pkgs=() + for dir in "${tag_dirs[@]}"; do + tag_pkgs+=("./$dir") + done + + onex::log::status "Generating prerelease-lifecycle code for ${#tag_pkgs[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running prerelease-lifecycle-gen for:" + for dir in "${tag_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + git_find -z ':(glob)**'/"${output_file}" | xargs -0 rm -f + + prerelease-lifecycle-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --output-file "${output_file}" \ + "${tag_pkgs[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated prerelease-lifecycle code" + fi +} + +# Defaulter generation +# +# Any package that wants defaulter functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:defaulter-gen= +# +# The depends on context: +# on types: +# true: always generate a defaulter for this type +# false: never generate a defaulter for this type +# on functions: +# covers: if the function name matches SetDefault_NAME, instructs +# the generator not to recurse +# on packages: +# FIELDNAME: any object with a field of this name is a candidate +# for having a defaulter generated +function codegen::defaults() { + # Build the tool. + GOPROXY=off go install \ + k8s.io/code-generator/cmd/defaulter-gen + + # The result file, in each pkg, of defaulter generation. + local output_file="${GENERATED_FILE_PREFIX}defaults.go" + + # All directories that request any form of defaulter generation. + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s:defaulter-gen tags" + fi + local tag_dirs=() + onex::util::read-array tag_dirs < <( \ + grep -l --null '+k8s:defaulter-gen=' "${ALL_K8S_TAG_FILES[@]}" \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ + | sort -u) + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#tag_dirs[@]} +k8s:defaulter-gen tagged dirs" + fi + + local tag_pkgs=() + for dir in "${tag_dirs[@]}"; do + tag_pkgs+=("./$dir") + done + + onex::log::status "Generating defaulter code for ${#tag_pkgs[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running defaulter-gen for:" + for dir in "${tag_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + git_find -z ':(glob)**'/"${output_file}" | xargs -0 rm -f + + defaulter-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --output-file "${output_file}" \ + "${tag_pkgs[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated defaulter code" + fi +} + +# Conversion generation + +# Any package that wants conversion functions generated into it must +# include one or more comment-tags in its `doc.go` file, of the form: +# // +k8s:conversion-gen= +# +# The INTERNAL_TYPES_DIR is a project-local path to another directory +# which should be considered when evaluating peer types for +# conversions. An optional additional comment of the form +# // +k8s:conversion-gen-external-types= +# +# identifies where to find the external types; if there is no such +# comment then the external types are sought in the package where the +# `k8s:conversion` tag is found. +# +# Conversions, in both directions, are generated for every type name +# that is defined in both an internal types package and the external +# types package. +# +# TODO: it might be better in the long term to make peer-types explicit in the +# IDL. +function codegen::conversions() { + # Build the tool. + GOPROXY=off go install \ + k8s.io/code-generator/cmd/conversion-gen + + # The result file, in each pkg, of conversion generation. + local output_file="${GENERATED_FILE_PREFIX}conversion.go" + + # All directories that request any form of conversion generation. + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s:conversion-gen tags" + fi + local tag_dirs=() + onex::util::read-array tag_dirs < <(\ + grep -l --null '^// *+k8s:conversion-gen=' "${ALL_K8S_TAG_FILES[@]}" \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ + | sort -u) + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#tag_dirs[@]} +k8s:conversion-gen tagged dirs" + fi + + local tag_pkgs=() + for dir in "${tag_dirs[@]}"; do + tag_pkgs+=("./$dir") + done + + local extra_peer_pkgs=( + k8s.io/kubernetes/pkg/apis/core + k8s.io/kubernetes/pkg/apis/core/v1 + k8s.io/api/core/v1 + ) + + onex::log::status "Generating conversion code for ${#tag_pkgs[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running conversion-gen for:" + for dir in "${tag_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + git_find -z ':(glob)**'/"${output_file}" | xargs -0 rm -f + + conversion-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --output-file "${output_file}" \ + $(printf -- " --extra-peer-dirs %s" "${extra_peer_pkgs[@]}") \ + "${tag_pkgs[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated conversion code" + fi +} + +# $@: directories to exclude +# example: +# k8s_tag_files_except foo bat/qux +function k8s_tag_files_except() { + for f in "${ALL_K8S_TAG_FILES[@]}"; do + local excl="" + for x in "$@"; do + if [[ "$f" =~ "$x"/.* ]]; then + excl="true" + break + fi + done + if [[ "${excl}" != true ]]; then + echo "$f" + fi + done +} + +# OpenAPI generation +# +# Any package that wants open-api functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:openapi-gen=true +function todo::codegen::openapi() { + # Build the tool. + GOPROXY=off go install \ + k8s.io/kube-openapi/cmd/openapi-gen + + # The result file, in each pkg, of open-api generation. + local output_file="${GENERATED_FILE_PREFIX}openapi.go" + + local output_dir="pkg/generated/openapi" + local output_pkg="k8s.io/kubernetes/${output_dir}" + local known_violations_file="${API_KNOWN_VIOLATIONS_DIR}/violation_exceptions.list" + + local report_file="${OUT_DIR}/api_violations.report" + # When UPDATE_API_KNOWN_VIOLATIONS is set to be true, let the generator to write + # updated API violations to the known API violation exceptions list. + if [[ "${UPDATE_API_KNOWN_VIOLATIONS}" == true ]]; then + report_file="${known_violations_file}" + fi + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s:openapi-gen tags" + fi + + local tag_files=() + onex::util::read-array tag_files < <( + k8s_tag_files_except \ + staging/src/k8s.io/code-generator \ + staging/src/k8s.io/sample-apiserver + ) - git_find -z \ - ':(glob)**/generated.proto' \ - ':(glob)**/generated.pb.go' \ + local tag_dirs=() + onex::util::read-array tag_dirs < <( + grep -l --null '+k8s:openapi-gen=' "${tag_files[@]}" \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ + | sort -u) + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#tag_dirs[@]} +k8s:openapi-gen tagged dirs" + fi + + local tag_pkgs=() + for dir in "${tag_dirs[@]}"; do + tag_pkgs+=("./$dir") + done + + onex::log::status "Generating openapi code" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running openapi-gen for:" + for dir in "${tag_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + git_find -z ':(glob)pkg/generated/**'/"${output_file}" | xargs -0 rm -f + + openapi-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --output-file "${output_file}" \ + --output-dir "${output_dir}" \ + --output-pkg "${output_pkg}" \ + --report-filename "${report_file}" \ + "${tag_pkgs[@]}" \ + "$@" + + touch "${report_file}" + local known_filename="${known_violations_file}" + if ! diff -u "${known_filename}" "${report_file}"; then + echo -e "ERROR:" + echo -e "\tAPI rule check failed - reported violations differ from known violations" + echo -e "\tPlease read api/api-rules/README.md to resolve the failure in ${known_filename}" + fi + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated openapi code" + fi +} + +# OpenAPI generation +# +# Any package that wants open-api functions generated must include a +# comment-tag in column 0 of one file of the form: +# // +k8s:openapi-gen=true +function codegen::openapi() { + # Build the tool. + # Please make sure to use openapi-gen version v0.29.3 here. + if ! command -v openapi-gen &> /dev/null ; then + GOPROXY=off go install k8s.io/code-generator/cmd/openapi-gen@v0.29.3 + fi + + # The result file, in each pkg, of open-api generation. + local output_file="${GENERATED_FILE_PREFIX}openapi" + + local output_dir="pkg/generated/openapi" + local output_pkg="github.com/superproj/onex/${output_dir}" + local known_violations_file="${API_KNOWN_VIOLATIONS_DIR}/violation_exceptions.list" + + local report_file="${OUT_DIR}/api_violations.report" + # When UPDATE_API_KNOWN_VIOLATIONS is set to be true, let the generator to write + # updated API violations to the known API violation exceptions list. + if [[ "${UPDATE_API_KNOWN_VIOLATIONS}" == true ]]; then + report_file="${known_violations_file}" + fi + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: finding all +k8s:openapi-gen tags" + fi + + local tag_files=() + onex::util::read-array tag_files < <( + k8s_tag_files_except \ + staging/src/k8s.io/code-generator \ + staging/src/k8s.io/sample-apiserver + ) + + local tag_dirs=() + onex::util::read-array tag_dirs < <( + grep -l --null '+k8s:openapi-gen=' "${tag_files[@]}" \ + | while read -r -d $'\0' F; do dirname "${F}"; done \ + | sort -u) + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: found ${#tag_dirs[@]} +k8s:openapi-gen tagged dirs" + fi + + local tag_pkgs=() + for dir in "${tag_dirs[@]}"; do + tag_pkgs+=("./$dir") + done + + onex::log::status "Generating openapi code" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running openapi-gen for:" + for dir in "${tag_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + git_find -z ':(glob)pkg/generated/**'/"${output_file}" | xargs -0 rm -f + + # UPDATEME: When add new k8s resources/group. + openapi-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + -O "${output_file}" \ + -i 'k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/version,k8s.io/apimachinery/pkg/util/intstr,k8s.io/kubernetes/pkg/apis/core,k8s.io/api/core/v1,k8s.io/api/autoscaling/v1,k8s.io/api/coordination/v1,k8s.io/kubernetes/pkg/apis/flowcontrol,k8s.io/api/flowcontrol/v1,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions,k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1,k8s.io/kube-aggregator/pkg/apis/apiregistration,k8s.io/kube-aggregator/pkg/apis/apiregistration/v1,github.com/superproj/onex/pkg/apis/apps/v1beta1' \ + --output-base "${GOPATH}/src" \ + -p "${output_pkg}" \ + --report-filename "${report_file}" \ + "${tag_pkgs[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated openapi code" + fi +} + +function codegen::applyconfigs() { + GOPROXY=off go install \ + k8s.io/kubernetes/pkg/generated/openapi/cmd/models-schema \ + k8s.io/code-generator/cmd/applyconfiguration-gen + + local ext_apis=() + onex::util::read-array ext_apis < <( + cd "${ONEX_ROOT}" + git_find -z ':(glob)pkg/apis/**/*types.go' \ + | while read -r -d $'\0' F; do dirname "${ONEX_MODULE_NAME}/${F}"; done \ + | sort -u) + ext_apis+=("${EXTRA_GENERATE_PKG[@]}") + ext_apis+=("k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/api/autoscaling/v1") + + onex::log::status "Generating apply-config code for ${#ext_apis[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running applyconfiguration-gen for:" + for api in "${ext_apis[@]}"; do + onex::log::status "DBG: $api" + done + fi + + (git_grep -l --null \ + -e '^// Code generated by applyconfiguration-gen. DO NOT EDIT.$' \ + -- \ + ':(glob)pkg/generated/**/*.go' \ + || true) \ | xargs -0 rm -f - ${ONEX_ROOT}/scripts/update-generated-protobuf-dockerized.sh "${apis[@]}" + applyconfiguration-gen \ + -v "${KUBE_VERBOSE}" \ + --openapi-schema <(models-schema) \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --output-dir "${ONEX_ROOT}/pkg/generated/applyconfigurations" \ + --output-pkg "${APPLYCONFIG_PKG}" \ + "${ext_apis[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated apply-config code" + fi } -codegen::protobuf +function codegen::clients() { + GOPROXY=off go install \ + k8s.io/code-generator/cmd/client-gen + + IFS=" " read -r -a group_versions <<< "${ONEX_AVAILABLE_GROUP_VERSIONS}" + local gv_dirs=() + for gv in "${group_versions[@]}"; do + # add items, but strip off any leading apis/ you find to match command expectations + local api_dir + api_dir=$(onex::util::group-version-to-pkg-path "${gv}") + local nopkg_dir=${api_dir#pkg/} + nopkg_dir=${nopkg_dir#staging/src/k8s.io/api/} + local pkg_dir=${nopkg_dir#apis/} + + # skip groups that aren't being served, clients for these don't matter + if [[ " ${KUBE_NONSERVER_GROUP_VERSIONS} " == *" ${gv} "* ]]; then + continue + fi + + gv_dirs+=("${pkg_dir}") + done + gv_dirs+=("${EXTRA_GENERATE_PKG[@]}") + + onex::log::status "Generating client code for ${#gv_dirs[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running client-gen for:" + for dir in "${gv_dirs[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + (git_grep -l --null \ + -e '^// Code generated by client-gen. DO NOT EDIT.$' \ + -- \ + ':(glob)pkg/generated/**/*.go' \ + || true) \ + | xargs -0 rm -f + + # UPDATEME: When add new k8s resource. + client-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --included-types-overrides core/v1/Namespace,core/v1/ConfigMap,core/v1/Event,core/v1/Secret,apiextensions/v1/CustomResourceDefinition \ + --output-dir "${ONEX_ROOT}/pkg/generated/clientset" \ + --output-pkg="${OUTPUT_PKG}/clientset" \ + --clientset-name="versioned" \ + --input-base="" \ + --plural-exceptions "${PLURAL_EXCEPTIONS}" \ + --apply-configuration-package "${APPLYCONFIG_PKG}" \ + $(printf -- " --input %s" "${gv_dirs[@]}") \ + "$@" + + # Fix generated namespace clients + ${ONEX_ROOT}/scripts/fix-generated-client.sh + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated client code" + fi +} + +function codegen::listers() { + if ! command -v gen-swaggertype-docs &> /dev/null ; then + GOPROXY=off go install k8s.io/code-generator/cmd/lister-gen + fi + + local ext_apis=() + onex::util::read-array ext_apis < <( + cd "${ONEX_ROOT}" + git_find -z ':(glob)pkg/apis/**/*types.go' \ + | while read -r -d $'\0' F; do dirname "github.com/superproj/onex/${F}"; done \ + | sort -u) + ext_apis+=("${EXTRA_GENERATE_PKG[@]}") + + onex::log::status "Generating lister code for ${#ext_apis[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running lister-gen for:" + for api in "${ext_apis[@]}"; do + onex::log::status "DBG: $api" + done + fi + + (git_grep -l --null \ + -e '^// Code generated by lister-gen. DO NOT EDIT.$' \ + -- \ + ':(glob)pkg/generated/**/*.go' \ + || true) \ + | xargs -0 rm -f + + lister-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --included-types-overrides core/v1/Namespace,core/v1/ConfigMap,core/v1/Event,core/v1/Secret \ + --output-dir "${ONEX_ROOT}/pkg/generated/listers" \ + --output-pkg "${OUTPUT_PKG}/listers" \ + --plural-exceptions "${PLURAL_EXCEPTIONS}" \ + "${ext_apis[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated lister code" + fi +} + +function codegen::informers() { + if ! command -v gen-swaggertype-docs &> /dev/null ; then + GOPROXY=off go install k8s.io/code-generator/cmd/informer-gen + fi + + local ext_apis=() + onex::util::read-array ext_apis < <( + cd "${ONEX_ROOT}" + git_find -z ':(glob)pkg/apis/**/*types.go' \ + | while read -r -d $'\0' F; do dirname "github.com/superproj/onex/${F}"; done \ + | sort -u) + ext_apis+=("${EXTRA_GENERATE_PKG[@]}") + + onex::log::status "Generating informer code for ${#ext_apis[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: running informer-gen for:" + for api in "${ext_apis[@]}"; do + onex::log::status "DBG: $api" + done + fi + + (git_grep -l --null \ + -e '^// Code generated by informer-gen. DO NOT EDIT.$' \ + -- \ + ':(glob)pkg/generated/**/*.go' \ + || true) \ + | xargs -0 rm -f + + informer-gen \ + -v "${KUBE_VERBOSE}" \ + --go-header-file "${BOILERPLATE_FILENAME}" \ + --included-types-overrides core/v1/Namespace,core/v1/ConfigMap,core/v1/Event,core/v1/Secret \ + --output-dir "${ONEX_ROOT}/pkg/generated/informers" \ + --output-pkg "${OUTPUT_PKG}/informers" \ + --single-directory \ + --versioned-clientset-package "${OUTPUT_PKG}/clientset/versioned" \ + --listers-package "${OUTPUT_PKG}/listers" \ + --plural-exceptions "${PLURAL_EXCEPTIONS}" \ + "${ext_apis[@]}" \ + "$@" + + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "Generated informer code" + fi +} + +function indent() { + while read -r X; do + echo " ${X}" + done +} + +function unused::codegen::subprojects() { + # Call generation on sub-projects. + local subs=( + staging/src/k8s.io/code-generator/examples + staging/src/k8s.io/kube-aggregator + staging/src/k8s.io/sample-apiserver + staging/src/k8s.io/sample-controller + staging/src/k8s.io/metrics + staging/src/k8s.io/apiextensions-apiserver + staging/src/k8s.io/apiextensions-apiserver/examples/client-go + ) + + local codegen + codegen="${ONEX_ROOT}/staging/src/k8s.io/code-generator" + for sub in "${subs[@]}"; do + onex::log::status "Generating code for subproject ${sub}" + pushd "${sub}" >/dev/null + CODEGEN_PKG="${codegen}" \ + UPDATE_API_KNOWN_VIOLATIONS="${UPDATE_API_KNOWN_VIOLATIONS}" \ + API_KNOWN_VIOLATIONS_DIR="${API_KNOWN_VIOLATIONS_DIR}" \ + ./scripts/update-codegen.sh > >(indent) 2> >(indent >&2) + popd >/dev/null + done +} + +function unused::codegen::protobindings() { + # Each element of this array is a directory containing subdirectories which + # eventually contain a file named "api.proto". + local apis=( + "staging/src/k8s.io/cri-api/pkg/apis/runtime" + + "staging/src/k8s.io/kubelet/pkg/apis/podresources" + + "staging/src/k8s.io/kubelet/pkg/apis/deviceplugin" + + "staging/src/k8s.io/kms/apis" + "staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2" + + "staging/src/k8s.io/kubelet/pkg/apis/dra" + + "staging/src/k8s.io/kubelet/pkg/apis/pluginregistration" + "pkg/kubelet/pluginmanager/pluginwatcher/example_plugin_apis" + ) + + onex::log::status "Generating protobuf bindings for ${#apis[@]} targets" + if [[ "${DBG_CODEGEN}" == 1 ]]; then + onex::log::status "DBG: generating protobuf bindings for:" + for dir in "${apis[@]}"; do + onex::log::status "DBG: $dir" + done + fi + + for api in "${apis[@]}"; do + git_find -z ":(glob)${api}"/'**/api.pb.go' \ + | xargs -0 rm -f + done + + if onex::protoc::check_protoc >/dev/null; then + scripts/_update-generated-proto-bindings-dockerized.sh "${apis[@]}" + else + onex::log::status "protoc ${PROTOC_VERSION} not found (can install with scripts/install-protoc.sh); generating containerized..." + # NOTE: All output from this script needs to be copied back to the calling + # source tree. This is managed in onex::build::copy_output in build/common.sh. + # If the output set is changed update that function. + build/run.sh scripts/_update-generated-proto-bindings-dockerized.sh "${apis[@]}" + fi +} + +# +# main +# + +function list_codegens() { + ( + shopt -s extdebug + declare -F \ + | cut -f3 -d' ' \ + | grep "^codegen::" \ + | while read -r fn; do declare -F "$fn"; done \ + | sort -n -k2 \ + | cut -f1 -d' ' \ + | sed 's/^codegen:://' + ) +} + +# shellcheck disable=SC2207 # safe, no functions have spaces +all_codegens=($(list_codegens)) + +function print_codegens() { + echo "available codegens:" + for g in "${all_codegens[@]}"; do + echo " $g" + done +} + +# Validate and accumulate flags to pass thru and codegens to run if args are +# specified. +flags_to_pass=() +codegens_to_run=() +for arg; do + # Use -? to list known codegens. + if [[ "${arg}" == "-?" ]]; then + print_codegens + exit 0 + fi + if [[ "${arg}" =~ ^- ]]; then + flags_to_pass+=("${arg}") + continue + fi + # Make sure each non-flag arg matches at least one codegen. + nmatches=0 + for t in "${all_codegens[@]}"; do + if [[ "$t" =~ ${arg} ]]; then + nmatches=$((nmatches+1)) + # Don't run codegens twice, just keep the first match. + # shellcheck disable=SC2076 # we want literal matching + if [[ " ${codegens_to_run[*]} " =~ " $t " ]]; then + continue + fi + codegens_to_run+=("$t") + continue + fi + done + if [[ ${nmatches} == 0 ]]; then + echo "ERROR: no codegens match pattern '${arg}'" + echo + print_codegens + exit 1 + fi + # The array-syntax abomination is to accommodate older bash. + codegens_to_run+=("${matches[@]:+"${matches[@]}"}") +done + +# If no codegens were specified, run them all. +if [[ "${#codegens_to_run[@]}" == 0 ]]; then + codegens_to_run=("${all_codegens[@]}") +fi + +for g in "${codegens_to_run[@]}"; do + # The array-syntax abomination is to accommodate older bash. + "codegen::${g}" "${flags_to_pass[@]:+"${flags_to_pass[@]}"}" +done diff --git a/scripts/update-generated-docs.sh b/scripts/update-generated-docs.sh index fb18c060401..096eb2c831f 100755 --- a/scripts/update-generated-docs.sh +++ b/scripts/update-generated-docs.sh @@ -19,21 +19,84 @@ ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${ONEX_ROOT}/scripts/lib/init.sh" onex::golang::setup_env +onex::util::ensure-temp-dir BINS=( gen-docs - gen-man gen-onex-docs + gen-man gen-yaml ) make build -C "${ONEX_ROOT}" BINS="${BINS[*]}" -onex::util::ensure-temp-dir +# Run all known doc generators (today gendocs and genman for nodectl) +# $1 is the directory to put those generated documents +function generate_docs() { + local dest="$1" + + # Find binary + gendocs=$(onex::util::find-binary "gen-docs") + genonexdocs=$(onex::util::find-binary "gen-onex-docs") + genman=$(onex::util::find-binary "gen-man") + genyaml=$(onex::util::find-binary "gen-yaml") + + mkdir -p "${dest}/docs/guide/en-US/cmd/onexctl" + "${gendocs}" "${dest}/docs/guide/en-US/cmd/onexctl/" + + mkdir -p "${dest}/docs/guide/en-US/cmd" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-fakeserver" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-usercenter" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-apiserver" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-gateway" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-nightwatch" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-pump" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-toyblc" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-controller-manager" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-minerset-controller" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/" "onex-miner-controller" + "${genonexdocs}" "${dest}/docs/guide/en-US/cmd/onexctl" "onexctl" + + mkdir -p "${dest}/docs/man/man1/" + "${genman}" "${dest}/docs/man/man1/" "onex-fakeserver" + "${genman}" "${dest}/docs/man/man1/" "onex-usercenter" + "${genman}" "${dest}/docs/man/man1/" "onex-apiserver" + "${genman}" "${dest}/docs/man/man1/" "onex-gateway" + "${genman}" "${dest}/docs/man/man1/" "onex-nightwatch" + "${genman}" "${dest}/docs/man/man1/" "onex-pump" + "${genman}" "${dest}/docs/man/man1/" "onex-toyblc" + "${genman}" "${dest}/docs/man/man1/" "onex-controller-manager" + "${genman}" "${dest}/docs/man/man1/" "onex-minerset-controller" + "${genman}" "${dest}/docs/man/man1/" "onex-miner-controller" + "${genman}" "${dest}/docs/man/man1/" "onexctl" + + mkdir -p "${dest}/docs/guide/en-US/yaml/onexctl/" + "${genyaml}" "${dest}/docs/guide/en-US/yaml/onexctl/" + + # create the list of generated files + pushd "${dest}" > /dev/null || return 1 + touch docs/.generated_docs + find . -type f | cut -sd / -f 2- | LC_ALL=C sort > docs/.generated_docs + popd > /dev/null || return 1 +} + +# Removes previously generated docs-- we don't want to check them in. $ONEX_ROOT +# must be set. +function remove_generated_docs() { + if [ -e "${ONEX_ROOT}/docs/.generated_docs" ]; then + # remove all of the old docs; we don't want to check them in. + while read -r file; do + rm "${ONEX_ROOT}/${file}" 2>/dev/null || true + done <"${ONEX_ROOT}/docs/.generated_docs" + # The docs/.generated_docs file lists itself, so we don't need to explicitly + # delete it. + fi +} -onex::util::gen-docs "${ONEX_TEMP}" +# generate into ONEX_TMP +generate_docs "${ONEX_TEMP}" -# remove all of the old docs -onex::util::remove-gen-docs +# remove all of the existing docs in ONEX_ROOT +remove_generated_docs # Copy fresh docs into the repo. # the shopt is so that we get docs/.generated_docs from the glob. diff --git a/scripts/update-generated-swagger-docs.sh b/scripts/update-generated-swagger-docs.sh deleted file mode 100755 index a531effb768..00000000000 --- a/scripts/update-generated-swagger-docs.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. -# - - -# This script generates `types_swagger_doc_generated.go` files for API group -# versions. That file contains functions on API structs that return -# the comments that should be surfaced for the corresponding API type -# in our API docs. - -set -o errexit -set -o nounset -set -o pipefail - -ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -source "${ONEX_ROOT}/scripts/lib/init.sh" -source "${ONEX_ROOT}/scripts/lib/swagger.sh" - -onex::golang::setup_env - -IFS=" " read -r -a GROUP_VERSIONS <<< "${ONEX_AVAILABLE_GROUP_VERSIONS}" - -# To avoid compile errors, remove the currently existing files. -for group_version in "${GROUP_VERSIONS[@]}"; do - rm -f "$(onex::util::group-version-to-pkg-path "${group_version}")/types_swagger_doc_generated.go" -done -# ensure we have the latest genswaggertypedocs built -go install k8s.io/kubernetes/cmd/genswaggertypedocs -for group_version in "${GROUP_VERSIONS[@]}"; do - onex::swagger::gen_types_swagger_doc "${group_version}" "$(onex::util::group-version-to-pkg-path "${group_version}")" -done diff --git a/scripts/update-vendor.sh b/scripts/update-vendor.sh index c6dbcf53005..fd9f742321e 100755 --- a/scripts/update-vendor.sh +++ b/scripts/update-vendor.sh @@ -21,10 +21,15 @@ set -o pipefail # Go tools really don't like it if you have a symlink in `pwd`. cd "$(pwd -P)" -ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -source "${ONEX_ROOT}/scripts/lib/init.sh" +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" -# Explicitly opt into go modules, even though we're inside a GOPATH directory +# Get all the default Go environment. +kube::golang::setup_env + +# Turn off workspaces until we are ready for them later +export GOWORK=off +# Explicitly opt into go modules export GO111MODULE=on # Explicitly set GOFLAGS to ignore vendor, since GOFLAGS=-mod=vendor breaks dependency resolution while rebuilding vendor export GOFLAGS=-mod=mod @@ -33,16 +38,15 @@ export LANG=C export LC_ALL=C # Detect problematic GOPROXY settings that prevent lookup of dependencies if [[ "${GOPROXY:-}" == "off" ]]; then - onex::log::error "Cannot run scripts/update-vendor.sh with \$GOPROXY=off" + kube::log::error "Cannot run hack/update-vendor.sh with \$GOPROXY=off" exit 1 fi -onex::golang::verify_go_version -onex::util::require-jq +kube::util::require-jq TMP_DIR="${TMP_DIR:-$(mktemp -d /tmp/update-vendor.XXXX)}" LOG_FILE="${LOG_FILE:-${TMP_DIR}/update-vendor.log}" -onex::log::status "logfile at ${LOG_FILE}" +kube::log::status "logfile at ${LOG_FILE}" # Set up some FDs for this script to use, while capturing everything else to # the log. NOTHING ELSE should write to $LOG_FILE directly. @@ -51,6 +55,7 @@ exec 22>&2 # Real stderr, use this explicitly exec 1>"${LOG_FILE}" # Automatic stdout exec 2>&1 # Automatic stderr set -x # Trace this script to stderr +go env # For the log function finish { ret=$? @@ -85,13 +90,14 @@ function ensure_require_replace_directives_for_all_dependencies() { > "${replace_json}" # Propagate root replace/require directives into staging modules, in case we are downgrading, so they don't bump the root required version back up - for repo in $(onex::util::list_staging_repos); do - pushd "staging/src/k8s.io/${repo}" >/dev/null 2>&1 + for repo in $(kube::util::list_staging_repos); do + ( + cd "staging/src/k8s.io/${repo}" jq -r '"-require \(.Path)@\(.Version)"' < "${require_json}" \ | xargs -L 100 go mod edit -fmt jq -r '"-replace \(.Old.Path)=\(.New.Path)@\(.New.Version)"' < "${replace_json}" \ | xargs -L 100 go mod edit -fmt - popd >/dev/null 2>&1 + ) done # tidy to ensure require directives are added for indirect dependencies @@ -177,19 +183,21 @@ function add_generated_comments() { # Phase 1: ensure go.mod files for staging modules and main module -for repo in $(onex::util::list_staging_repos); do - pushd "staging/src/k8s.io/${repo}" >/dev/null 2>&1 +for repo in $(kube::util::list_staging_repos); do + ( + cd "staging/src/k8s.io/${repo}" + if [[ ! -f go.mod ]]; then - onex::log::status "go.mod: initialize ${repo}" >&11 + kube::log::status "go.mod: initialize ${repo}" >&11 rm -f Godeps/Godeps.json # remove before initializing, staging Godeps are not authoritative go mod init "k8s.io/${repo}" go mod edit -fmt fi - popd >/dev/null 2>&1 + ) done if [[ ! -f go.mod ]]; then - onex::log::status "go.mod: initialize k8s.io/kubernetes" >&11 + kube::log::status "go.mod: initialize k8s.io/kubernetes" >&11 go mod init "k8s.io/kubernetes" rm -f Godeps/Godeps.json # remove after initializing fi @@ -197,7 +205,7 @@ fi # Phase 2: ensure staging repo require/replace directives -onex::log::status "go.mod: update staging references" >&11 +kube::log::status "go.mod: update staging references" >&11 # Prune go mod edit -json \ | jq -r '.Require[]? | select(.Version == "v0.0.0") | "-droprequire \(.Path)"' \ @@ -205,11 +213,11 @@ go mod edit -json \ go mod edit -json \ | jq -r '.Replace[]? | select(.New.Path | startswith("./staging/")) | "-dropreplace \(.Old.Path)"' \ | xargs -L 100 go mod edit -fmt -# Readd -onex::util::list_staging_repos \ +# Re-add +kube::util::list_staging_repos \ | while read -r X; do echo "-require k8s.io/${X}@v0.0.0"; done \ | xargs -L 100 go mod edit -fmt -onex::util::list_staging_repos \ +kube::util::list_staging_repos \ | while read -r X; do echo "-replace k8s.io/${X}=./staging/src/k8s.io/${X}"; done \ | xargs -L 100 go mod edit -fmt @@ -227,33 +235,35 @@ group_directives # Phase 4: copy root go.mod to staging dirs and rewrite -onex::log::status "go.mod: propagate to staging modules" >&11 -for repo in $(onex::util::list_staging_repos); do - pushd "staging/src/k8s.io/${repo}" >/dev/null 2>&1 +kube::log::status "go.mod: propagate to staging modules" >&11 +for repo in $(kube::util::list_staging_repos); do + ( + cd "staging/src/k8s.io/${repo}" + echo "=== propagating to ${repo}" # copy root go.mod, changing module name sed "s#module k8s.io/kubernetes#module k8s.io/${repo}#" \ - < "${ONEX_ROOT}/go.mod" \ - > "${ONEX_ROOT}/staging/src/k8s.io/${repo}/go.mod" + < "${KUBE_ROOT}/go.mod" \ + > "${KUBE_ROOT}/staging/src/k8s.io/${repo}/go.mod" # remove `require` directives for staging components (will get re-added as needed by `go list`) - onex::util::list_staging_repos \ + kube::util::list_staging_repos \ | while read -r X; do echo "-droprequire k8s.io/${X}"; done \ | xargs -L 100 go mod edit # rewrite `replace` directives for staging components to point to peer directories - onex::util::list_staging_repos \ + kube::util::list_staging_repos \ | while read -r X; do echo "-replace k8s.io/${X}=../${X}"; done \ | xargs -L 100 go mod edit - popd >/dev/null 2>&1 + ) done # Phase 5: sort and tidy staging components -onex::log::status "go.mod: sorting staging modules" >&11 +kube::log::status "go.mod: sorting staging modules" >&11 # tidy staging repos in reverse dependency order. # the content of dependencies' go.mod files affects what `go mod tidy` chooses to record in a go.mod file. tidy_unordered="${TMP_DIR}/tidy_unordered.txt" -onex::util::list_staging_repos \ +kube::util::list_staging_repos \ | xargs -I {} echo "k8s.io/{}" > "${tidy_unordered}" rm -f "${TMP_DIR}/tidy_deps.txt" # SC2094 checks that you do not read and write to the same file in a pipeline. @@ -265,20 +275,31 @@ while IFS= read -r repo; do # record existence of the repo to ensure modules with no peer relationships still get included in the order echo "${repo} ${repo}" >> "${TMP_DIR}/tidy_deps.txt" - pushd "${ONEX_ROOT}/staging/src/${repo}" >/dev/null 2>&1 + ( + cd "${KUBE_ROOT}/staging/src/${repo}" + # save the original go.mod, since go list doesn't just add missing entries, it also removes specific required versions from it tmp_go_mod="${TMP_DIR}/tidy_${repo/\//_}_go.mod.original" tmp_go_deps="${TMP_DIR}/tidy_${repo/\//_}_deps.txt" cp go.mod "${tmp_go_mod}" - { - echo "=== sorting ${repo}" - # 'go list' calculates direct imports and updates go.mod so that go list -m lists our module dependencies - echo "=== computing imports for ${repo}" - go list all - echo "=== computing tools imports for ${repo}" - go list -e -tags=tools all - } + echo "=== sorting ${repo}" + # 'go list' calculates direct imports and updates go.mod so that go list -m lists our module dependencies + echo "=== computing imports for ${repo}" + go list all + # ignore errors related to importing `package main` packages, but catch + # other errors (https://github.com/golang/go/issues/59186) + errs=() + kube::util::read-array errs < <( + go list -e -tags=tools -json all | jq -r '.Error.Err | select( . != null )' \ + | grep -v "is a program, not an importable package" + ) + if (( "${#errs[@]}" != 0 )); then + for err in "${errs[@]}"; do + echo "${err}" >&2 + done + exit 1 + fi # capture module dependencies go list -m -f '{{if not .Main}}{{.Path}}{{end}}' all > "${tmp_go_deps}" @@ -293,12 +314,13 @@ while IFS= read -r repo; do # switch the required version to an explicit v0.0.0 (rather than an unknown v0.0.0-00010101000000-000000000000) go mod edit -require "${dep}@v0.0.0" done - popd >/dev/null 2>&1 + ) done < "${tidy_unordered}" -onex::log::status "go.mod: tidying" >&11 +kube::log::status "go.mod: tidying" >&11 for repo in $(tsort "${TMP_DIR}/tidy_deps.txt"); do - pushd "${ONEX_ROOT}/staging/src/${repo}" >/dev/null 2>&1 + ( + cd "${KUBE_ROOT}/staging/src/${repo}" echo "=== tidying ${repo}" # prune replace directives that pin to the naturally selected version. @@ -317,9 +339,9 @@ for repo in $(tsort "${TMP_DIR}/tidy_deps.txt"); do # disallow transitive dependencies on k8s.io/kubernetes loopback_deps=() - onex::util::read-array loopback_deps < <(go list all 2>/dev/null | grep k8s.io/kubernetes/ || true) - if [[ -n ${loopback_deps[*]:+"${loopback_deps[*]}"} ]]; then - onex::log::error "Disallowed ${repo} -> k8s.io/kubernetes dependencies exist via the following imports: $(go mod why "${loopback_deps[@]}")" >&22 2>&1 + kube::util::read-array loopback_deps < <(go list all 2>/dev/null | grep k8s.io/kubernetes/ || true) + if (( "${#loopback_deps[@]}" > 0 )); then + kube::log::error "${#loopback_deps[@]} disallowed ${repo} -> k8s.io/kubernetes dependencies exist via the following imports: $(go mod why "${loopback_deps[@]}")" >&22 2>&1 exit 1 fi @@ -340,8 +362,7 @@ for repo in $(tsort "${TMP_DIR}/tidy_deps.txt"); do # group require/replace directives group_directives - - popd >/dev/null 2>&1 + ) done echo "=== tidying root" go mod tidy @@ -355,49 +376,47 @@ xargs -L 100 go mod edit -fmt # disallow transitive dependencies on k8s.io/kubernetes loopback_deps=() -onex::util::read-array loopback_deps < <(go mod graph | grep ' k8s.io/kubernetes' || true) -if [[ -n ${loopback_deps[*]:+"${loopback_deps[*]}"} ]]; then - onex::log::error "Disallowed transitive k8s.io/kubernetes dependencies exist via the following imports:" >&22 2>&1 - onex::log::error "${loopback_deps[@]}" >&22 2>&1 +kube::util::read-array loopback_deps < <(go mod graph | grep ' k8s.io/kubernetes' || true) +if (( "${#loopback_deps[@]}" > 0 )); then + kube::log::error "${#loopback_deps[@]} disallowed transitive k8s.io/kubernetes dependencies exist via the following imports:" >&22 2>&1 + kube::log::error "${loopback_deps[@]}" >&22 2>&1 exit 1 fi # Phase 6: add generated comments to go.mod files -onex::log::status "go.mod: adding generated comments" >&11 +kube::log::status "go.mod: adding generated comments" >&11 add_generated_comments " // This is a generated file. Do not edit directly. // Ensure you've carefully read // https://git.k8s.io/community/contributors/devel/sig-architecture/vendor.md -// Run scripts/pin-dependency.sh to change pinned dependency versions. -// Run scripts/update-vendor.sh to update go.mod files and the vendor directory. +// Run hack/pin-dependency.sh to change pinned dependency versions. +// Run hack/update-vendor.sh to update go.mod files and the vendor directory. " -for repo in $(onex::util::list_staging_repos); do - pushd "staging/src/k8s.io/${repo}" >/dev/null 2>&1 +for repo in $(kube::util::list_staging_repos); do + ( + cd "staging/src/k8s.io/${repo}" add_generated_comments "// This is a generated file. Do not edit directly." - popd >/dev/null 2>&1 + ) done # Phase 7: update internal modules -onex::log::status "vendor: updating internal modules" >&11 -scripts/update-internal-modules.sh +kube::log::status "vendor: updating internal modules" >&11 +hack/update-internal-modules.sh # Phase 8: rebuild vendor directory -onex::log::status "vendor: running 'go mod vendor'" >&11 -go mod vendor - -# create a symlink in vendor directory pointing to the staging components. -# This lets other packages and tools use the local staging components as if they were vendored. -for repo in $(onex::util::list_staging_repos); do - rm -fr "${ONEX_ROOT}/vendor/k8s.io/${repo}" - ln -s "../../staging/src/k8s.io/${repo}" "${ONEX_ROOT}/vendor/k8s.io/${repo}" -done +( + kube::log::status "vendor: running 'go work vendor'" >&11 + unset GOWORK + unset GOFLAGS + go work vendor +) -onex::log::status "vendor: updating vendor/LICENSES" >&11 -scripts/update-vendor-licenses.sh +kube::log::status "vendor: updating vendor/LICENSES" >&11 +hack/update-vendor-licenses.sh -onex::log::status "vendor: creating OWNERS file" >&11 +kube::log::status "vendor: creating OWNERS file" >&11 rm -f "vendor/OWNERS" cat <<__EOF__ > "vendor/OWNERS" # See the OWNERS docs at https://go.k8s.io/owners @@ -411,4 +430,4 @@ reviewers: - dep-reviewers __EOF__ -onex::log::status "NOTE: don't forget to handle vendor/* and LICENSE/* files that were added or removed" >&11 +kube::log::status "NOTE: don't forget to handle vendor/* and LICENSE/* files that were added or removed" >&11 diff --git a/scripts/verify-codegen.sh b/scripts/verify-codegen.sh index ea4d725aa55..9f15256a928 100755 --- a/scripts/verify-codegen.sh +++ b/scripts/verify-codegen.sh @@ -1,41 +1,29 @@ #!/usr/bin/env bash -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. +# Copyright 2014 The Kubernetes Authors. # +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 script verifies whether a code update is needed. +# Usage: `scripts/verify-codegen.sh `. set -o errexit set -o nounset set -o pipefail ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +source "${ONEX_ROOT}/scripts/lib/verify-generated.sh" -DIFFROOT="${ONEX_ROOT}/pkg" -TMP_DIFFROOT="${ONEX_ROOT}/_tmp/pkg" -_tmp="${ONEX_ROOT}/_tmp" - -cleanup() { - rm -rf "${_tmp}" -} -trap "cleanup" EXIT SIGINT - -cleanup - -mkdir -p "${TMP_DIFFROOT}" -cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}" +export UPDATE_API_KNOWN_VIOLATIONS=true -"${ONEX_ROOT}/scripts/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 +onex::verify::generated "Generated files need to be updated" "Please run 'scripts/update-codegen.sh'" scripts/update-codegen.sh "$@" diff --git a/scripts/verify-generated-docs.sh b/scripts/verify-generated-docs.sh new file mode 100755 index 00000000000..924bc2a7974 --- /dev/null +++ b/scripts/verify-generated-docs.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +# Copyright 2014 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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 script checks that various type of documents(* .md, * .yaml and man +# files) are generated correctly(just verifies the generation process). +# Usage: `scripts/verify-generated-docs.sh`. + +set -o errexit +set -o nounset +set -o pipefail + +ONEX_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +source "${ONEX_ROOT}/scripts/lib/verify-generated.sh" + +onex::verify::generated "Generated docs need to be updated" "Please run 'scripts/update-generated-docs.sh'" scripts/update-generated-docs.sh "$@" diff --git a/scripts/verify-generated-swagger-docs.sh b/scripts/verify-generated-swagger-docs.sh deleted file mode 100755 index d84e71cdbef..00000000000 --- a/scripts/verify-generated-swagger-docs.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2022 Lingfei Kong . All rights reserved. -# Use of this source code is governed by a MIT style -# license that can be found in the LICENSE file. The original repo for -# this file is https://github.com/superproj/onex. -# - - -# This script checks whether updating of swagger type documentation is needed or -# not. We should run `scripts/update-generated-swagger-docs.sh` if swagger type -# documentation is out of date. -# Usage: `scripts/verify-generated-swagger-docs.sh`. - -set -o errexit -set -o nounset -set -o pipefail - -KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. -source "${KUBE_ROOT}/scripts/lib/init.sh" - -onex::golang::setup_env - -_tmpdir="$(onex::realpath "$(mktemp -d -t swagger-docs.XXXXXX)")" -function swagger_cleanup { - rm -rf "${_tmpdir}" -} -onex::util::trap_add swagger_cleanup EXIT - -# Copy the contents of the kube directory into the nice clean place -_kubetmp="${_tmpdir}/src/k8s.io" -mkdir -p "${_kubetmp}" -# should create ${_kubetmp}/kubernetes -git archive --format=tar --prefix=kubernetes/ "$(git write-tree)" | (cd "${_kubetmp}" && tar xf -) -_kubetmp="${_kubetmp}/kubernetes" -# Do all our work in the new GOPATH -export GOPATH="${_tmpdir}" - -find_files() { - find . -not \( \ - \( \ - -wholename './output' \ - -o -wholename './.git' \ - -o -wholename './_output' \ - -o -wholename './_gopath' \ - -o -wholename './release' \ - -o -wholename './target' \ - -o -wholename '*/third_party/*' \ - -o -wholename '*/vendor/*' \ - -o -wholename './staging/src/k8s.io/client-go/*vendor/*' \ - \) -prune \ - \) -name 'types_swagger_doc_generated.go' -} -while IFS=$'\n' read -r line; do TARGET_FILES+=("$line"); done < <(find_files) - -pushd "${_kubetmp}" > /dev/null 2>&1 - # Update the generated swagger docs - hack/update-generated-swagger-docs.sh -popd > /dev/null 2>&1 - -ret=0 - -pushd "${KUBE_ROOT}" > /dev/null 2>&1 - # Test for diffs - _output="" - for file in ${TARGET_FILES[*]}; do - _output="${_output}$(diff -Naupr -I 'Auto generated by' "${KUBE_ROOT}/${file}" "${_kubetmp}/${file}")" || ret=1 - done - - if [[ ${ret} -gt 0 ]]; then - echo "Generated swagger type documentation is out of date:" >&2 - echo "${_output}" >&2 - exit ${ret} - fi -popd > /dev/null 2>&1 - -echo "Generated swagger type documentation up to date." diff --git a/scripts/verify-vendor.sh b/scripts/verify-vendor.sh new file mode 100755 index 00000000000..0fea7224a7f --- /dev/null +++ b/scripts/verify-vendor.sh @@ -0,0 +1,106 @@ +#!/usr/bin/env bash + +# 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. + +# This script checks whether fixing of vendor directory or go.mod is needed or +# not. We should run `hack/update-vendor.sh` if actually fixes them. +# Usage: `hack/verify-vendor.sh`. + +set -o errexit +set -o nounset +set -o pipefail + +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. +source "${KUBE_ROOT}/hack/lib/init.sh" + +kube::golang::setup_env + +# create a nice clean place to put our new vendor tree +_tmpdir="$(kube::realpath "$(mktemp -d -t "$(basename "$0").XXXXXX")")" + +if [[ -z ${KEEP_TMP:-} ]]; then + KEEP_TMP=false +fi + +function cleanup { + # make go module dirs writeable + chmod -R +w "${_tmpdir}" + if [ "${KEEP_TMP}" == "true" ]; then + echo "Leaving ${_tmpdir} for you to examine or copy. Please delete it manually when finished. (rm -rf ${_tmpdir})" + else + echo "Removing ${_tmpdir}" + rm -rf "${_tmpdir}" + fi +} +kube::util::trap_add cleanup EXIT + +# Copy the contents of the kube directory into the nice clean place (which is NOT shaped like a GOPATH) +_kubetmp="${_tmpdir}/kubernetes" +mkdir -p "${_kubetmp}" +tar --exclude=.git --exclude="./_*" -c . | (cd "${_kubetmp}" && tar xf -) + +pushd "${_kubetmp}" > /dev/null 2>&1 + # Destroy deps in the copy of the kube tree + rm -rf ./vendor ./LICENSES + + # Recreate the vendor tree using the nice clean set we just downloaded + hack/update-vendor.sh +popd > /dev/null 2>&1 + +ret=0 + +pushd "${KUBE_ROOT}" > /dev/null 2>&1 + # Test for diffs + if ! _out="$(diff -Naupr --ignore-matching-lines='^\s*\"GoVersion\":' go.mod "${_kubetmp}/go.mod")"; then + echo "Your go.mod file is different:" >&2 + echo "${_out}" >&2 + echo "Vendor Verify failed." >&2 + echo "If you're seeing this locally, run the below command to fix your go.mod:" >&2 + echo "hack/update-vendor.sh" >&2 + ret=1 + fi + + if ! _out="$(diff -Naupr -x "AUTHORS*" -x "CONTRIBUTORS*" vendor "${_kubetmp}/vendor")"; then + echo "Your vendored results are different:" >&2 + echo "${_out}" >&2 + echo "Vendor Verify failed." >&2 + echo "${_out}" > vendordiff.patch + echo "If you're seeing this locally, run the below command to fix your directories:" >&2 + echo "hack/update-vendor.sh" >&2 + ret=1 + fi + + # Verify we are pinned to matching levels + hack/lint-dependencies.sh >&2 +popd > /dev/null 2>&1 + +if [[ ${ret} -gt 0 ]]; then + exit ${ret} +fi + +# Ensure we can tidy every repo using only its recorded versions +for repo in $(kube::util::list_staging_repos); do + pushd "${_kubetmp}/staging/src/k8s.io/${repo}" >/dev/null 2>&1 + echo "Tidying k8s.io/${repo}..." + GODEBUG=gocacheverify=1 go mod tidy + popd >/dev/null 2>&1 +done +pushd "${_kubetmp}" >/dev/null 2>&1 + echo "Tidying k8s.io/kubernetes..." + GODEBUG=gocacheverify=1 go mod tidy +popd >/dev/null 2>&1 + +echo "Vendor Verified." +# ex: ts=2 sw=2 et filetype=sh diff --git a/scripts/webhook-create-signed-cert.sh b/scripts/webhook-create-signed-cert.sh new file mode 100755 index 00000000000..e7df13d441b --- /dev/null +++ b/scripts/webhook-create-signed-cert.sh @@ -0,0 +1,2503 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + denyenv-validating-admission-webhook/webhook-create-signed-cert.sh at v0 · phosae/denyenv-validating-admission-webhook · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ Skip to content + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + +
+ +
+ +
+ +
+ + + + / + + denyenv-validating-admission-webhook + + + Public +
+ + +
+ +
+ + +
+
+ +
+
+ + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + +

Latest commit

 

History

History
executable file
·
131 lines (112 loc) · 3.47 KB

webhook-create-signed-cert.sh

File metadata and controls

executable file
·
131 lines (112 loc) · 3.47 KB
+
+ + + + +
+ +
+ +
+
+ +
+ +
+

Footer

+ + + + +
+
+ + + + + © 2024 GitHub, Inc. + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + diff --git a/third_party/k8s.io/apimachinery/pkg/runtime/schema/generated.proto b/third_party/k8s.io/apimachinery/pkg/runtime/schema/generated.proto deleted file mode 100644 index 452dde0328d..00000000000 --- a/third_party/k8s.io/apimachinery/pkg/runtime/schema/generated.proto +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/zero. - - -// This file was autogenerated by go-to-protobuf. Do not edit it manually! - -syntax = "proto2"; - -package k8s.io.apimachinery.pkg.runtime.schema; - -// Package-wide variables from generator "generated". -option go_package = "k8s.io/apimachinery/pkg/runtime/schema"; - diff --git a/third_party/errors/errors.proto b/third_party/protobuf/errors/errors.proto similarity index 100% rename from third_party/errors/errors.proto rename to third_party/protobuf/errors/errors.proto diff --git a/third_party/github.com/gogo/protobuf/gogoproto/gogo.proto b/third_party/protobuf/github.com/gogo/protobuf/gogoproto/gogo.proto similarity index 100% rename from third_party/github.com/gogo/protobuf/gogoproto/gogo.proto rename to third_party/protobuf/github.com/gogo/protobuf/gogoproto/gogo.proto diff --git a/third_party/google/api/annotations.proto b/third_party/protobuf/google/api/annotations.proto similarity index 100% rename from third_party/google/api/annotations.proto rename to third_party/protobuf/google/api/annotations.proto diff --git a/third_party/google/api/client.proto b/third_party/protobuf/google/api/client.proto similarity index 100% rename from third_party/google/api/client.proto rename to third_party/protobuf/google/api/client.proto diff --git a/third_party/google/api/field_behavior.proto b/third_party/protobuf/google/api/field_behavior.proto similarity index 100% rename from third_party/google/api/field_behavior.proto rename to third_party/protobuf/google/api/field_behavior.proto diff --git a/third_party/google/api/http.proto b/third_party/protobuf/google/api/http.proto similarity index 100% rename from third_party/google/api/http.proto rename to third_party/protobuf/google/api/http.proto diff --git a/third_party/google/api/httpbody.proto b/third_party/protobuf/google/api/httpbody.proto similarity index 100% rename from third_party/google/api/httpbody.proto rename to third_party/protobuf/google/api/httpbody.proto diff --git a/third_party/google/protobuf/any.proto b/third_party/protobuf/google/protobuf/any.proto similarity index 100% rename from third_party/google/protobuf/any.proto rename to third_party/protobuf/google/protobuf/any.proto diff --git a/third_party/google/protobuf/api.proto b/third_party/protobuf/google/protobuf/api.proto similarity index 100% rename from third_party/google/protobuf/api.proto rename to third_party/protobuf/google/protobuf/api.proto diff --git a/third_party/google/protobuf/compiler/plugin.proto b/third_party/protobuf/google/protobuf/compiler/plugin.proto similarity index 100% rename from third_party/google/protobuf/compiler/plugin.proto rename to third_party/protobuf/google/protobuf/compiler/plugin.proto diff --git a/third_party/google/protobuf/descriptor.proto b/third_party/protobuf/google/protobuf/descriptor.proto similarity index 100% rename from third_party/google/protobuf/descriptor.proto rename to third_party/protobuf/google/protobuf/descriptor.proto diff --git a/third_party/google/protobuf/duration.proto b/third_party/protobuf/google/protobuf/duration.proto similarity index 100% rename from third_party/google/protobuf/duration.proto rename to third_party/protobuf/google/protobuf/duration.proto diff --git a/third_party/google/protobuf/empty.proto b/third_party/protobuf/google/protobuf/empty.proto similarity index 100% rename from third_party/google/protobuf/empty.proto rename to third_party/protobuf/google/protobuf/empty.proto diff --git a/third_party/google/protobuf/field_mask.proto b/third_party/protobuf/google/protobuf/field_mask.proto similarity index 100% rename from third_party/google/protobuf/field_mask.proto rename to third_party/protobuf/google/protobuf/field_mask.proto diff --git a/third_party/google/protobuf/source_context.proto b/third_party/protobuf/google/protobuf/source_context.proto similarity index 100% rename from third_party/google/protobuf/source_context.proto rename to third_party/protobuf/google/protobuf/source_context.proto diff --git a/third_party/google/protobuf/struct.proto b/third_party/protobuf/google/protobuf/struct.proto similarity index 100% rename from third_party/google/protobuf/struct.proto rename to third_party/protobuf/google/protobuf/struct.proto diff --git a/third_party/google/protobuf/timestamp.proto b/third_party/protobuf/google/protobuf/timestamp.proto similarity index 100% rename from third_party/google/protobuf/timestamp.proto rename to third_party/protobuf/google/protobuf/timestamp.proto diff --git a/third_party/google/protobuf/type.proto b/third_party/protobuf/google/protobuf/type.proto similarity index 100% rename from third_party/google/protobuf/type.proto rename to third_party/protobuf/google/protobuf/type.proto diff --git a/third_party/google/protobuf/wrappers.proto b/third_party/protobuf/google/protobuf/wrappers.proto similarity index 100% rename from third_party/google/protobuf/wrappers.proto rename to third_party/protobuf/google/protobuf/wrappers.proto diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/equality/semantic.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/equality/semantic.go new file mode 100644 index 00000000000..f02fa8e4340 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/equality/semantic.go @@ -0,0 +1,49 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 equality + +import ( + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/conversion" + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/labels" +) + +// Semantic can do semantic deep equality checks for api objects. +// Example: apiequality.Semantic.DeepEqual(aPod, aPodWithNonNilButEmptyMaps) == true +var Semantic = conversion.EqualitiesOrDie( + func(a, b resource.Quantity) bool { + // Ignore formatting, only care that numeric value stayed the same. + // TODO: if we decide it's important, it should be safe to start comparing the format. + // + // Uninitialized quantities are equivalent to 0 quantities. + return a.Cmp(b) == 0 + }, + func(a, b metav1.MicroTime) bool { + return a.UTC() == b.UTC() + }, + func(a, b metav1.Time) bool { + return a.UTC() == b.UTC() + }, + func(a, b labels.Selector) bool { + return a.String() == b.String() + }, + func(a, b fields.Selector) bool { + return a.String() == b.String() + }, +) diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/OWNERS b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/OWNERS new file mode 100644 index 00000000000..1a9f5e7706b --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/OWNERS @@ -0,0 +1,16 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - smarterclayton + - wojtek-t + - deads2k + - derekwaynecarr + - caesarxuchao + - mikedanese + - liggitt + - saad-ali + - janetkuo + - tallclair + - dims + - cjcullen diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/doc.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/doc.go new file mode 100644 index 00000000000..167baf680d2 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 errors provides detailed error types for api field validation. +package errors // import "k8s.io/apimachinery/pkg/api/errors" diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/errors.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/errors.go new file mode 100644 index 00000000000..57e0e71f672 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/errors.go @@ -0,0 +1,857 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 errors + +import ( + "encoding/json" + "errors" + "fmt" + "net/http" + "reflect" + "strings" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// StatusError is an error intended for consumption by a REST API server; it can also be +// reconstructed by clients from a REST response. Public to allow easy type switches. +type StatusError struct { + ErrStatus metav1.Status +} + +// APIStatus is exposed by errors that can be converted to an api.Status object +// for finer grained details. +type APIStatus interface { + Status() metav1.Status +} + +var _ error = &StatusError{} + +var knownReasons = map[metav1.StatusReason]struct{}{ + // metav1.StatusReasonUnknown : {} + metav1.StatusReasonUnauthorized: {}, + metav1.StatusReasonForbidden: {}, + metav1.StatusReasonNotFound: {}, + metav1.StatusReasonAlreadyExists: {}, + metav1.StatusReasonConflict: {}, + metav1.StatusReasonGone: {}, + metav1.StatusReasonInvalid: {}, + metav1.StatusReasonServerTimeout: {}, + metav1.StatusReasonTimeout: {}, + metav1.StatusReasonTooManyRequests: {}, + metav1.StatusReasonBadRequest: {}, + metav1.StatusReasonMethodNotAllowed: {}, + metav1.StatusReasonNotAcceptable: {}, + metav1.StatusReasonRequestEntityTooLarge: {}, + metav1.StatusReasonUnsupportedMediaType: {}, + metav1.StatusReasonInternalError: {}, + metav1.StatusReasonExpired: {}, + metav1.StatusReasonServiceUnavailable: {}, +} + +// Error implements the Error interface. +func (e *StatusError) Error() string { + return e.ErrStatus.Message +} + +// Status allows access to e's status without having to know the detailed workings +// of StatusError. +func (e *StatusError) Status() metav1.Status { + return e.ErrStatus +} + +// DebugError reports extended info about the error to debug output. +func (e *StatusError) DebugError() (string, []interface{}) { + if out, err := json.MarshalIndent(e.ErrStatus, "", " "); err == nil { + return "server response object: %s", []interface{}{string(out)} + } + return "server response object: %#v", []interface{}{e.ErrStatus} +} + +// HasStatusCause returns true if the provided error has a details cause +// with the provided type name. +// It supports wrapped errors and returns false when the error is nil. +func HasStatusCause(err error, name metav1.CauseType) bool { + _, ok := StatusCause(err, name) + return ok +} + +// StatusCause returns the named cause from the provided error if it exists and +// the error unwraps to the type APIStatus. Otherwise it returns false. +func StatusCause(err error, name metav1.CauseType) (metav1.StatusCause, bool) { + status, ok := err.(APIStatus) + if (ok || errors.As(err, &status)) && status.Status().Details != nil { + for _, cause := range status.Status().Details.Causes { + if cause.Type == name { + return cause, true + } + } + } + return metav1.StatusCause{}, false +} + +// UnexpectedObjectError can be returned by FromObject if it's passed a non-status object. +type UnexpectedObjectError struct { + Object runtime.Object +} + +// Error returns an error message describing 'u'. +func (u *UnexpectedObjectError) Error() string { + return fmt.Sprintf("unexpected object: %v", u.Object) +} + +// FromObject generates an StatusError from an metav1.Status, if that is the type of obj; otherwise, +// returns an UnexpecteObjectError. +func FromObject(obj runtime.Object) error { + switch t := obj.(type) { + case *metav1.Status: + return &StatusError{ErrStatus: *t} + case runtime.Unstructured: + var status metav1.Status + obj := t.UnstructuredContent() + if !reflect.DeepEqual(obj["kind"], "Status") { + break + } + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(t.UnstructuredContent(), &status); err != nil { + return err + } + if status.APIVersion != "v1" && status.APIVersion != "meta.k8s.io/v1" { + break + } + return &StatusError{ErrStatus: status} + } + return &UnexpectedObjectError{obj} +} + +// NewNotFound returns a new error which indicates that the resource of the kind and the name was not found. +func NewNotFound(qualifiedResource schema.GroupResource, name string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusNotFound, + Reason: metav1.StatusReasonNotFound, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: name, + }, + Message: fmt.Sprintf("%s %q not found", qualifiedResource.String(), name), + }} +} + +// NewAlreadyExists returns an error indicating the item requested exists by that identifier. +func NewAlreadyExists(qualifiedResource schema.GroupResource, name string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusConflict, + Reason: metav1.StatusReasonAlreadyExists, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: name, + }, + Message: fmt.Sprintf("%s %q already exists", qualifiedResource.String(), name), + }} +} + +// NewGenerateNameConflict returns an error indicating the server +// was not able to generate a valid name for a resource. +func NewGenerateNameConflict(qualifiedResource schema.GroupResource, name string, retryAfterSeconds int) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusConflict, + Reason: metav1.StatusReasonAlreadyExists, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: name, + RetryAfterSeconds: int32(retryAfterSeconds), + }, + Message: fmt.Sprintf( + "%s %q already exists, the server was not able to generate a unique name for the object", + qualifiedResource.String(), name), + }} +} + +// NewUnauthorized returns an error indicating the client is not authorized to perform the requested +// action. +func NewUnauthorized(reason string) *StatusError { + message := reason + if len(message) == 0 { + message = "not authorized" + } + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusUnauthorized, + Reason: metav1.StatusReasonUnauthorized, + Message: message, + }} +} + +// NewForbidden returns an error indicating the requested action was forbidden +func NewForbidden(qualifiedResource schema.GroupResource, name string, err error) *StatusError { + var message string + if qualifiedResource.Empty() { + message = fmt.Sprintf("forbidden: %v", err) + } else if name == "" { + message = fmt.Sprintf("%s is forbidden: %v", qualifiedResource.String(), err) + } else { + message = fmt.Sprintf("%s %q is forbidden: %v", qualifiedResource.String(), name, err) + } + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusForbidden, + Reason: metav1.StatusReasonForbidden, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: name, + }, + Message: message, + }} +} + +// NewConflict returns an error indicating the item can't be updated as provided. +func NewConflict(qualifiedResource schema.GroupResource, name string, err error) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusConflict, + Reason: metav1.StatusReasonConflict, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: name, + }, + Message: fmt.Sprintf("Operation cannot be fulfilled on %s %q: %v", qualifiedResource.String(), name, err), + }} +} + +// NewApplyConflict returns an error including details on the requests apply conflicts +func NewApplyConflict(causes []metav1.StatusCause, message string) *StatusError { + return &StatusError{ErrStatus: metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusConflict, + Reason: metav1.StatusReasonConflict, + Details: &metav1.StatusDetails{ + // TODO: Get obj details here? + Causes: causes, + }, + Message: message, + }} +} + +// NewGone returns an error indicating the item no longer available at the server and no forwarding address is known. +// DEPRECATED: Please use NewResourceExpired instead. +func NewGone(message string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusGone, + Reason: metav1.StatusReasonGone, + Message: message, + }} +} + +// NewResourceExpired creates an error that indicates that the requested resource content has expired from +// the server (usually due to a resourceVersion that is too old). +func NewResourceExpired(message string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusGone, + Reason: metav1.StatusReasonExpired, + Message: message, + }} +} + +// NewInvalid returns an error indicating the item is invalid and cannot be processed. +func NewInvalid(qualifiedKind schema.GroupKind, name string, errs field.ErrorList) *StatusError { + causes := make([]metav1.StatusCause, 0, len(errs)) + for i := range errs { + err := errs[i] + causes = append(causes, metav1.StatusCause{ + Type: metav1.CauseType(err.Type), + Message: err.ErrorBody(), + Field: err.Field, + }) + } + err := &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusUnprocessableEntity, + Reason: metav1.StatusReasonInvalid, + Details: &metav1.StatusDetails{ + Group: qualifiedKind.Group, + Kind: qualifiedKind.Kind, + Name: name, + Causes: causes, + }, + }} + aggregatedErrs := errs.ToAggregate() + if aggregatedErrs == nil { + err.ErrStatus.Message = fmt.Sprintf("%s %q is invalid", qualifiedKind.String(), name) + } else { + err.ErrStatus.Message = fmt.Sprintf("%s %q is invalid: %v", qualifiedKind.String(), name, aggregatedErrs) + } + return err +} + +// NewBadRequest creates an error that indicates that the request is invalid and can not be processed. +func NewBadRequest(reason string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusBadRequest, + Reason: metav1.StatusReasonBadRequest, + Message: reason, + }} +} + +// NewTooManyRequests creates an error that indicates that the client must try again later because +// the specified endpoint is not accepting requests. More specific details should be provided +// if client should know why the failure was limited. +func NewTooManyRequests(message string, retryAfterSeconds int) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusTooManyRequests, + Reason: metav1.StatusReasonTooManyRequests, + Message: message, + Details: &metav1.StatusDetails{ + RetryAfterSeconds: int32(retryAfterSeconds), + }, + }} +} + +// NewServiceUnavailable creates an error that indicates that the requested service is unavailable. +func NewServiceUnavailable(reason string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusServiceUnavailable, + Reason: metav1.StatusReasonServiceUnavailable, + Message: reason, + }} +} + +// NewMethodNotSupported returns an error indicating the requested action is not supported on this kind. +func NewMethodNotSupported(qualifiedResource schema.GroupResource, action string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusMethodNotAllowed, + Reason: metav1.StatusReasonMethodNotAllowed, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + }, + Message: fmt.Sprintf("%s is not supported on resources of kind %q", action, qualifiedResource.String()), + }} +} + +// NewServerTimeout returns an error indicating the requested action could not be completed due to a +// transient error, and the client should try again. +func NewServerTimeout(qualifiedResource schema.GroupResource, operation string, retryAfterSeconds int) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusInternalServerError, + Reason: metav1.StatusReasonServerTimeout, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: operation, + RetryAfterSeconds: int32(retryAfterSeconds), + }, + Message: fmt.Sprintf("The %s operation against %s could not be completed at this time, please try again.", operation, qualifiedResource.String()), + }} +} + +// NewServerTimeoutForKind should not exist. Server timeouts happen when accessing resources, the Kind is just what we +// happened to be looking at when the request failed. This delegates to keep code sane, but we should work towards removing this. +func NewServerTimeoutForKind(qualifiedKind schema.GroupKind, operation string, retryAfterSeconds int) *StatusError { + return NewServerTimeout(schema.GroupResource{Group: qualifiedKind.Group, Resource: qualifiedKind.Kind}, operation, retryAfterSeconds) +} + +// NewInternalError returns an error indicating the item is invalid and cannot be processed. +func NewInternalError(err error) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusInternalServerError, + Reason: metav1.StatusReasonInternalError, + Details: &metav1.StatusDetails{ + Causes: []metav1.StatusCause{{Message: err.Error()}}, + }, + Message: fmt.Sprintf("Internal error occurred: %v", err), + }} +} + +// NewTimeoutError returns an error indicating that a timeout occurred before the request +// could be completed. Clients may retry, but the operation may still complete. +func NewTimeoutError(message string, retryAfterSeconds int) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusGatewayTimeout, + Reason: metav1.StatusReasonTimeout, + Message: fmt.Sprintf("Timeout: %s", message), + Details: &metav1.StatusDetails{ + RetryAfterSeconds: int32(retryAfterSeconds), + }, + }} +} + +// NewTooManyRequestsError returns an error indicating that the request was rejected because +// the server has received too many requests. Client should wait and retry. But if the request +// is perishable, then the client should not retry the request. +func NewTooManyRequestsError(message string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusTooManyRequests, + Reason: metav1.StatusReasonTooManyRequests, + Message: fmt.Sprintf("Too many requests: %s", message), + }} +} + +// NewRequestEntityTooLargeError returns an error indicating that the request +// entity was too large. +func NewRequestEntityTooLargeError(message string) *StatusError { + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: http.StatusRequestEntityTooLarge, + Reason: metav1.StatusReasonRequestEntityTooLarge, + Message: fmt.Sprintf("Request entity too large: %s", message), + }} +} + +// NewGenericServerResponse returns a new error for server responses that are not in a recognizable form. +func NewGenericServerResponse(code int, verb string, qualifiedResource schema.GroupResource, name, serverMessage string, retryAfterSeconds int, isUnexpectedResponse bool) *StatusError { + reason := metav1.StatusReasonUnknown + message := fmt.Sprintf("the server responded with the status code %d but did not return more information", code) + switch code { + case http.StatusConflict: + if verb == "POST" { + reason = metav1.StatusReasonAlreadyExists + } else { + reason = metav1.StatusReasonConflict + } + message = "the server reported a conflict" + case http.StatusNotFound: + reason = metav1.StatusReasonNotFound + message = "the server could not find the requested resource" + case http.StatusBadRequest: + reason = metav1.StatusReasonBadRequest + message = "the server rejected our request for an unknown reason" + case http.StatusUnauthorized: + reason = metav1.StatusReasonUnauthorized + message = "the server has asked for the client to provide credentials" + case http.StatusForbidden: + reason = metav1.StatusReasonForbidden + // the server message has details about who is trying to perform what action. Keep its message. + message = serverMessage + case http.StatusNotAcceptable: + reason = metav1.StatusReasonNotAcceptable + // the server message has details about what types are acceptable + if len(serverMessage) == 0 || serverMessage == "unknown" { + message = "the server was unable to respond with a content type that the client supports" + } else { + message = serverMessage + } + case http.StatusUnsupportedMediaType: + reason = metav1.StatusReasonUnsupportedMediaType + // the server message has details about what types are acceptable + message = serverMessage + case http.StatusMethodNotAllowed: + reason = metav1.StatusReasonMethodNotAllowed + message = "the server does not allow this method on the requested resource" + case http.StatusUnprocessableEntity: + reason = metav1.StatusReasonInvalid + message = "the server rejected our request due to an error in our request" + case http.StatusServiceUnavailable: + reason = metav1.StatusReasonServiceUnavailable + message = "the server is currently unable to handle the request" + case http.StatusGatewayTimeout: + reason = metav1.StatusReasonTimeout + message = "the server was unable to return a response in the time allotted, but may still be processing the request" + case http.StatusTooManyRequests: + reason = metav1.StatusReasonTooManyRequests + message = "the server has received too many requests and has asked us to try again later" + default: + if code >= 500 { + reason = metav1.StatusReasonInternalError + message = fmt.Sprintf("an error on the server (%q) has prevented the request from succeeding", serverMessage) + } + } + switch { + case !qualifiedResource.Empty() && len(name) > 0: + message = fmt.Sprintf("%s (%s %s %s)", message, strings.ToLower(verb), qualifiedResource.String(), name) + case !qualifiedResource.Empty(): + message = fmt.Sprintf("%s (%s %s)", message, strings.ToLower(verb), qualifiedResource.String()) + } + var causes []metav1.StatusCause + if isUnexpectedResponse { + causes = []metav1.StatusCause{ + { + Type: metav1.CauseTypeUnexpectedServerResponse, + Message: serverMessage, + }, + } + } else { + causes = nil + } + return &StatusError{metav1.Status{ + Status: metav1.StatusFailure, + Code: int32(code), + Reason: reason, + Details: &metav1.StatusDetails{ + Group: qualifiedResource.Group, + Kind: qualifiedResource.Resource, + Name: name, + + Causes: causes, + RetryAfterSeconds: int32(retryAfterSeconds), + }, + Message: message, + }} +} + +// IsNotFound returns true if the specified error was created by NewNotFound. +// It supports wrapped errors and returns false when the error is nil. +func IsNotFound(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonNotFound { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusNotFound { + return true + } + return false +} + +// IsAlreadyExists determines if the err is an error which indicates that a specified resource already exists. +// It supports wrapped errors and returns false when the error is nil. +func IsAlreadyExists(err error) bool { + return ReasonForError(err) == metav1.StatusReasonAlreadyExists +} + +// IsConflict determines if the err is an error which indicates the provided update conflicts. +// It supports wrapped errors and returns false when the error is nil. +func IsConflict(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonConflict { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusConflict { + return true + } + return false +} + +// IsInvalid determines if the err is an error which indicates the provided resource is not valid. +// It supports wrapped errors and returns false when the error is nil. +func IsInvalid(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonInvalid { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusUnprocessableEntity { + return true + } + return false +} + +// IsGone is true if the error indicates the requested resource is no longer available. +// It supports wrapped errors and returns false when the error is nil. +func IsGone(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonGone { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusGone { + return true + } + return false +} + +// IsResourceExpired is true if the error indicates the resource has expired and the current action is +// no longer possible. +// It supports wrapped errors and returns false when the error is nil. +func IsResourceExpired(err error) bool { + return ReasonForError(err) == metav1.StatusReasonExpired +} + +// IsNotAcceptable determines if err is an error which indicates that the request failed due to an invalid Accept header +// It supports wrapped errors and returns false when the error is nil. +func IsNotAcceptable(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonNotAcceptable { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusNotAcceptable { + return true + } + return false +} + +// IsUnsupportedMediaType determines if err is an error which indicates that the request failed due to an invalid Content-Type header +// It supports wrapped errors and returns false when the error is nil. +func IsUnsupportedMediaType(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonUnsupportedMediaType { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusUnsupportedMediaType { + return true + } + return false +} + +// IsMethodNotSupported determines if the err is an error which indicates the provided action could not +// be performed because it is not supported by the server. +// It supports wrapped errors and returns false when the error is nil. +func IsMethodNotSupported(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonMethodNotAllowed { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusMethodNotAllowed { + return true + } + return false +} + +// IsServiceUnavailable is true if the error indicates the underlying service is no longer available. +// It supports wrapped errors and returns false when the error is nil. +func IsServiceUnavailable(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonServiceUnavailable { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusServiceUnavailable { + return true + } + return false +} + +// IsBadRequest determines if err is an error which indicates that the request is invalid. +// It supports wrapped errors and returns false when the error is nil. +func IsBadRequest(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonBadRequest { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusBadRequest { + return true + } + return false +} + +// IsUnauthorized determines if err is an error which indicates that the request is unauthorized and +// requires authentication by the user. +// It supports wrapped errors and returns false when the error is nil. +func IsUnauthorized(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonUnauthorized { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusUnauthorized { + return true + } + return false +} + +// IsForbidden determines if err is an error which indicates that the request is forbidden and cannot +// be completed as requested. +// It supports wrapped errors and returns false when the error is nil. +func IsForbidden(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonForbidden { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusForbidden { + return true + } + return false +} + +// IsTimeout determines if err is an error which indicates that request times out due to long +// processing. +// It supports wrapped errors and returns false when the error is nil. +func IsTimeout(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonTimeout { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusGatewayTimeout { + return true + } + return false +} + +// IsServerTimeout determines if err is an error which indicates that the request needs to be retried +// by the client. +// It supports wrapped errors and returns false when the error is nil. +func IsServerTimeout(err error) bool { + // do not check the status code, because no https status code exists that can + // be scoped to retryable timeouts. + return ReasonForError(err) == metav1.StatusReasonServerTimeout +} + +// IsInternalError determines if err is an error which indicates an internal server error. +// It supports wrapped errors and returns false when the error is nil. +func IsInternalError(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonInternalError { + return true + } + if _, ok := knownReasons[reason]; !ok && code == http.StatusInternalServerError { + return true + } + return false +} + +// IsTooManyRequests determines if err is an error which indicates that there are too many requests +// that the server cannot handle. +// It supports wrapped errors and returns false when the error is nil. +func IsTooManyRequests(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonTooManyRequests { + return true + } + + // IsTooManyRequests' checking of code predates the checking of the code in + // the other Is* functions. In order to maintain backward compatibility, this + // does not check that the reason is unknown. + if code == http.StatusTooManyRequests { + return true + } + return false +} + +// IsRequestEntityTooLargeError determines if err is an error which indicates +// the request entity is too large. +// It supports wrapped errors and returns false when the error is nil. +func IsRequestEntityTooLargeError(err error) bool { + reason, code := reasonAndCodeForError(err) + if reason == metav1.StatusReasonRequestEntityTooLarge { + return true + } + + // IsRequestEntityTooLargeError's checking of code predates the checking of + // the code in the other Is* functions. In order to maintain backward + // compatibility, this does not check that the reason is unknown. + if code == http.StatusRequestEntityTooLarge { + return true + } + return false +} + +// IsUnexpectedServerError returns true if the server response was not in the expected API format, +// and may be the result of another HTTP actor. +// It supports wrapped errors and returns false when the error is nil. +func IsUnexpectedServerError(err error) bool { + status, ok := err.(APIStatus) + if (ok || errors.As(err, &status)) && status.Status().Details != nil { + for _, cause := range status.Status().Details.Causes { + if cause.Type == metav1.CauseTypeUnexpectedServerResponse { + return true + } + } + } + return false +} + +// IsUnexpectedObjectError determines if err is due to an unexpected object from the master. +// It supports wrapped errors and returns false when the error is nil. +func IsUnexpectedObjectError(err error) bool { + uoe, ok := err.(*UnexpectedObjectError) + return err != nil && (ok || errors.As(err, &uoe)) +} + +// SuggestsClientDelay returns true if this error suggests a client delay as well as the +// suggested seconds to wait, or false if the error does not imply a wait. It does not +// address whether the error *should* be retried, since some errors (like a 3xx) may +// request delay without retry. +// It supports wrapped errors and returns false when the error is nil. +func SuggestsClientDelay(err error) (int, bool) { + t, ok := err.(APIStatus) + if (ok || errors.As(err, &t)) && t.Status().Details != nil { + switch t.Status().Reason { + // this StatusReason explicitly requests the caller to delay the action + case metav1.StatusReasonServerTimeout: + return int(t.Status().Details.RetryAfterSeconds), true + } + // If the client requests that we retry after a certain number of seconds + if t.Status().Details.RetryAfterSeconds > 0 { + return int(t.Status().Details.RetryAfterSeconds), true + } + } + return 0, false +} + +// ReasonForError returns the HTTP status for a particular error. +// It supports wrapped errors and returns StatusReasonUnknown when +// the error is nil or doesn't have a status. +func ReasonForError(err error) metav1.StatusReason { + if status, ok := err.(APIStatus); ok || errors.As(err, &status) { + return status.Status().Reason + } + return metav1.StatusReasonUnknown +} + +func reasonAndCodeForError(err error) (metav1.StatusReason, int32) { + if status, ok := err.(APIStatus); ok || errors.As(err, &status) { + return status.Status().Reason, status.Status().Code + } + return metav1.StatusReasonUnknown, 0 +} + +// ErrorReporter converts generic errors into runtime.Object errors without +// requiring the caller to take a dependency on meta/v1 (where Status lives). +// This prevents circular dependencies in core watch code. +type ErrorReporter struct { + code int + verb string + reason string +} + +// NewClientErrorReporter will respond with valid v1.Status objects that report +// unexpected server responses. Primarily used by watch to report errors when +// we attempt to decode a response from the server and it is not in the form +// we expect. Because watch is a dependency of the core api, we can't return +// meta/v1.Status in that package and so much inject this interface to convert a +// generic error as appropriate. The reason is passed as a unique status cause +// on the returned status, otherwise the generic "ClientError" is returned. +func NewClientErrorReporter(code int, verb string, reason string) *ErrorReporter { + return &ErrorReporter{ + code: code, + verb: verb, + reason: reason, + } +} + +// AsObject returns a valid error runtime.Object (a v1.Status) for the given +// error, using the code and verb of the reporter type. The error is set to +// indicate that this was an unexpected server response. +func (r *ErrorReporter) AsObject(err error) runtime.Object { + status := NewGenericServerResponse(r.code, r.verb, schema.GroupResource{}, "", err.Error(), 0, true) + if status.ErrStatus.Details == nil { + status.ErrStatus.Details = &metav1.StatusDetails{} + } + reason := r.reason + if len(reason) == 0 { + reason = "ClientError" + } + status.ErrStatus.Details.Causes = append(status.ErrStatus.Details.Causes, metav1.StatusCause{ + Type: metav1.CauseType(reason), + Message: err.Error(), + }) + return &status.ErrStatus +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/errors_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/errors_test.go new file mode 100644 index 00000000000..2dea0883a09 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/errors/errors_test.go @@ -0,0 +1,705 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 errors + +import ( + "errors" + "fmt" + "net/http" + "reflect" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +func resource(resource string) schema.GroupResource { + return schema.GroupResource{Group: "", Resource: resource} +} +func kind(kind string) schema.GroupKind { + return schema.GroupKind{Group: "", Kind: kind} +} + +func TestErrorNew(t *testing.T) { + err := NewAlreadyExists(resource("tests"), "1") + if !IsAlreadyExists(err) { + t.Errorf("expected to be %s", metav1.StatusReasonAlreadyExists) + } + if IsConflict(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonConflict) + } + if IsNotFound(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonNotFound) + } + if IsInvalid(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonInvalid) + } + if IsBadRequest(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonBadRequest) + } + if IsForbidden(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonForbidden) + } + if IsServerTimeout(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonServerTimeout) + } + if IsMethodNotSupported(err) { + t.Errorf("expected to not be %s", metav1.StatusReasonMethodNotAllowed) + } + + if !IsConflict(NewConflict(resource("tests"), "2", errors.New("message"))) { + t.Errorf("expected to be %s", metav1.StatusReasonAlreadyExists) + } + if !IsNotFound(NewNotFound(resource("tests"), "3")) { + t.Errorf("expected to be %s", metav1.StatusReasonNotFound) + } + if !IsInvalid(NewInvalid(kind("Test"), "2", nil)) { + t.Errorf("expected to be %s", metav1.StatusReasonInvalid) + } + if !IsBadRequest(NewBadRequest("reason")) { + t.Errorf("expected to be %s", metav1.StatusReasonBadRequest) + } + if !IsForbidden(NewForbidden(resource("tests"), "2", errors.New("reason"))) { + t.Errorf("expected to be %s", metav1.StatusReasonForbidden) + } + if !IsUnauthorized(NewUnauthorized("reason")) { + t.Errorf("expected to be %s", metav1.StatusReasonUnauthorized) + } + if !IsServerTimeout(NewServerTimeout(resource("tests"), "reason", 0)) { + t.Errorf("expected to be %s", metav1.StatusReasonServerTimeout) + } + if !IsMethodNotSupported(NewMethodNotSupported(resource("foos"), "delete")) { + t.Errorf("expected to be %s", metav1.StatusReasonMethodNotAllowed) + } + + if !IsAlreadyExists(NewGenerateNameConflict(resource("tests"), "3", 1)) { + t.Errorf("expected to be %s", metav1.StatusReasonAlreadyExists) + } + if time, ok := SuggestsClientDelay(NewGenerateNameConflict(resource("tests"), "3", 1)); time != 1 || !ok { + t.Errorf("unexpected %d", time) + } + + if time, ok := SuggestsClientDelay(NewServerTimeout(resource("tests"), "doing something", 10)); time != 10 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewServerTimeout(resource("tests"), "doing something", 0)); time != 0 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewTimeoutError("test reason", 10)); time != 10 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewTooManyRequests("doing something", 10)); time != 10 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewTooManyRequests("doing something", 1)); time != 1 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewGenericServerResponse(429, "get", resource("tests"), "test", "doing something", 10, true)); time != 10 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewGenericServerResponse(500, "get", resource("tests"), "test", "doing something", 10, true)); time != 10 || !ok { + t.Errorf("unexpected %d", time) + } + if time, ok := SuggestsClientDelay(NewGenericServerResponse(429, "get", resource("tests"), "test", "doing something", 0, true)); time != 0 || ok { + t.Errorf("unexpected %d", time) + } +} + +func TestNewInvalid(t *testing.T) { + testCases := []struct { + Err *field.Error + Details *metav1.StatusDetails + Msg string + }{ + { + field.Duplicate(field.NewPath("field[0].name"), "bar"), + &metav1.StatusDetails{ + Kind: "Kind", + Name: "name", + Causes: []metav1.StatusCause{{ + Type: metav1.CauseTypeFieldValueDuplicate, + Field: "field[0].name", + }}, + }, + `Kind "name" is invalid: field[0].name: Duplicate value: "bar"`, + }, + { + field.Invalid(field.NewPath("field[0].name"), "bar", "detail"), + &metav1.StatusDetails{ + Kind: "Kind", + Name: "name", + Causes: []metav1.StatusCause{{ + Type: metav1.CauseTypeFieldValueInvalid, + Field: "field[0].name", + }}, + }, + `Kind "name" is invalid: field[0].name: Invalid value: "bar": detail`, + }, + { + field.NotFound(field.NewPath("field[0].name"), "bar"), + &metav1.StatusDetails{ + Kind: "Kind", + Name: "name", + Causes: []metav1.StatusCause{{ + Type: metav1.CauseTypeFieldValueNotFound, + Field: "field[0].name", + }}, + }, + `Kind "name" is invalid: field[0].name: Not found: "bar"`, + }, + { + field.NotSupported[string](field.NewPath("field[0].name"), "bar", nil), + &metav1.StatusDetails{ + Kind: "Kind", + Name: "name", + Causes: []metav1.StatusCause{{ + Type: metav1.CauseTypeFieldValueNotSupported, + Field: "field[0].name", + }}, + }, + `Kind "name" is invalid: field[0].name: Unsupported value: "bar"`, + }, + { + field.Required(field.NewPath("field[0].name"), ""), + &metav1.StatusDetails{ + Kind: "Kind", + Name: "name", + Causes: []metav1.StatusCause{{ + Type: metav1.CauseTypeFieldValueRequired, + Field: "field[0].name", + }}, + }, + `Kind "name" is invalid: field[0].name: Required value`, + }, + { + nil, + &metav1.StatusDetails{ + Kind: "Kind", + Name: "name", + Causes: []metav1.StatusCause{}, + }, + `Kind "name" is invalid`, + }, + } + for i, testCase := range testCases { + vErr, expected := testCase.Err, testCase.Details + if vErr != nil && expected != nil { + expected.Causes[0].Message = vErr.ErrorBody() + } + var errList field.ErrorList + if vErr != nil { + errList = append(errList, vErr) + } + err := NewInvalid(kind("Kind"), "name", errList) + status := err.ErrStatus + if status.Code != 422 || status.Reason != metav1.StatusReasonInvalid { + t.Errorf("%d: unexpected status: %#v", i, status) + } + if !reflect.DeepEqual(expected, status.Details) { + t.Errorf("%d: expected %#v, got %#v", i, expected, status.Details) + } + if testCase.Msg != status.Message { + t.Errorf("%d: expected\n%s\ngot\n%s", i, testCase.Msg, status.Message) + } + } +} + +func TestReasonForError(t *testing.T) { + if e, a := metav1.StatusReasonUnknown, ReasonForError(nil); e != a { + t.Errorf("unexpected reason type: %#v", a) + } +} + +type TestType struct{} + +func (obj *TestType) GetObjectKind() schema.ObjectKind { return schema.EmptyObjectKind } +func (obj *TestType) DeepCopyObject() runtime.Object { + if obj == nil { + return nil + } + clone := *obj + return &clone +} + +func TestFromObject(t *testing.T) { + table := []struct { + obj runtime.Object + message string + }{ + {&metav1.Status{Message: "foobar"}, "foobar"}, + {&TestType{}, "unexpected object: &{}"}, + } + + for _, item := range table { + if e, a := item.message, FromObject(item.obj).Error(); e != a { + t.Errorf("Expected %v, got %v", e, a) + } + } +} + +func TestReasonForErrorSupportsWrappedErrors(t *testing.T) { + testCases := []struct { + name string + err error + expectedReason metav1.StatusReason + }{ + { + name: "Direct match", + err: &StatusError{ErrStatus: metav1.Status{Reason: metav1.StatusReasonUnauthorized}}, + expectedReason: metav1.StatusReasonUnauthorized, + }, + { + name: "No match", + err: errors.New("some other error"), + expectedReason: metav1.StatusReasonUnknown, + }, + { + name: "Nested match", + err: fmt.Errorf("wrapping: %w", fmt.Errorf("some more: %w", &StatusError{ErrStatus: metav1.Status{Reason: metav1.StatusReasonAlreadyExists}})), + expectedReason: metav1.StatusReasonAlreadyExists, + }, + { + name: "Nested, no match", + err: fmt.Errorf("wrapping: %w", fmt.Errorf("some more: %w", errors.New("hello"))), + expectedReason: metav1.StatusReasonUnknown, + }, + { + name: "Nil", + expectedReason: metav1.StatusReasonUnknown, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if result := ReasonForError(tc.err); result != tc.expectedReason { + t.Errorf("expected reason: %q, but got known reason: %q", tc.expectedReason, result) + } + }) + } +} + +func TestIsTooManyRequestsSupportsWrappedErrors(t *testing.T) { + testCases := []struct { + name string + err error + expectMatch bool + }{ + { + name: "Direct match via status reason", + err: &StatusError{ErrStatus: metav1.Status{Reason: metav1.StatusReasonTooManyRequests}}, + expectMatch: true, + }, + { + name: "Direct match via status code", + err: &StatusError{ErrStatus: metav1.Status{Code: http.StatusTooManyRequests}}, + expectMatch: true, + }, + { + name: "No match", + err: &StatusError{}, + expectMatch: false, + }, + { + name: "Nested match via status reason", + err: fmt.Errorf("Wrapping: %w", &StatusError{ErrStatus: metav1.Status{Reason: metav1.StatusReasonTooManyRequests}}), + expectMatch: true, + }, + { + name: "Nested match via status code", + err: fmt.Errorf("Wrapping: %w", &StatusError{ErrStatus: metav1.Status{Code: http.StatusTooManyRequests}}), + expectMatch: true, + }, + { + name: "Nested,no match", + err: fmt.Errorf("Wrapping: %w", &StatusError{ErrStatus: metav1.Status{Code: http.StatusNotFound}}), + expectMatch: false, + }, + { + name: "Nil", + expectMatch: false, + }, + } + + for _, tc := range testCases { + if result := IsTooManyRequests(tc.err); result != tc.expectMatch { + t.Errorf("Expect match %t, got match %t", tc.expectMatch, result) + } + } +} +func TestIsRequestEntityTooLargeErrorSupportsWrappedErrors(t *testing.T) { + testCases := []struct { + name string + err error + expectMatch bool + }{ + { + name: "Direct match via status reason", + err: &StatusError{ErrStatus: metav1.Status{Reason: metav1.StatusReasonRequestEntityTooLarge}}, + expectMatch: true, + }, + { + name: "Direct match via status code", + err: &StatusError{ErrStatus: metav1.Status{Code: http.StatusRequestEntityTooLarge}}, + expectMatch: true, + }, + { + name: "No match", + err: &StatusError{}, + expectMatch: false, + }, + { + name: "Nested match via status reason", + err: fmt.Errorf("Wrapping: %w", &StatusError{ErrStatus: metav1.Status{Reason: metav1.StatusReasonRequestEntityTooLarge}}), + expectMatch: true, + }, + { + name: "Nested match via status code", + err: fmt.Errorf("Wrapping: %w", &StatusError{ErrStatus: metav1.Status{Code: http.StatusRequestEntityTooLarge}}), + expectMatch: true, + }, + { + name: "Nested,no match", + err: fmt.Errorf("Wrapping: %w", &StatusError{ErrStatus: metav1.Status{Code: http.StatusNotFound}}), + expectMatch: false, + }, + { + name: "Nil", + expectMatch: false, + }, + } + + for _, tc := range testCases { + if result := IsRequestEntityTooLargeError(tc.err); result != tc.expectMatch { + t.Errorf("Expect match %t, got match %t", tc.expectMatch, result) + } + } +} + +func TestIsUnexpectedServerError(t *testing.T) { + unexpectedServerErr := func() error { + return &StatusError{ + ErrStatus: metav1.Status{ + Details: &metav1.StatusDetails{ + Causes: []metav1.StatusCause{{Type: metav1.CauseTypeUnexpectedServerResponse}}, + }, + }, + } + } + testCases := []struct { + name string + err error + expectMatch bool + }{ + { + name: "Direct match", + err: unexpectedServerErr(), + expectMatch: true, + }, + { + name: "No match", + err: errors.New("some other error"), + expectMatch: false, + }, + { + name: "Nested match", + err: fmt.Errorf("wrapping: %w", unexpectedServerErr()), + expectMatch: true, + }, + { + name: "Nested, no match", + err: fmt.Errorf("wrapping: %w", fmt.Errorf("some more: %w", errors.New("hello"))), + expectMatch: false, + }, + { + name: "Nil", + expectMatch: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if result := IsUnexpectedServerError(tc.err); result != tc.expectMatch { + t.Errorf("expected match: %t, but got match: %t", tc.expectMatch, result) + } + }) + } +} + +func TestIsUnexpectedObjectError(t *testing.T) { + unexpectedObjectErr := func() error { + return &UnexpectedObjectError{} + } + testCases := []struct { + name string + err error + expectMatch bool + }{ + { + name: "Direct match", + err: unexpectedObjectErr(), + expectMatch: true, + }, + { + name: "No match", + err: errors.New("some other error"), + expectMatch: false, + }, + { + name: "Nested match", + err: fmt.Errorf("wrapping: %w", unexpectedObjectErr()), + expectMatch: true, + }, + { + name: "Nested, no match", + err: fmt.Errorf("wrapping: %w", fmt.Errorf("some more: %w", errors.New("hello"))), + expectMatch: false, + }, + { + name: "Nil", + expectMatch: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if result := IsUnexpectedObjectError(tc.err); result != tc.expectMatch { + t.Errorf("expected match: %t, but got match: %t", tc.expectMatch, result) + } + }) + } +} + +func TestSuggestsClientDelaySupportsWrapping(t *testing.T) { + suggestsClientDelayErr := func() error { + return &StatusError{ + ErrStatus: metav1.Status{ + Reason: metav1.StatusReasonServerTimeout, + Details: &metav1.StatusDetails{}, + }, + } + } + testCases := []struct { + name string + err error + expectMatch bool + }{ + { + name: "Direct match", + err: suggestsClientDelayErr(), + expectMatch: true, + }, + { + name: "No match", + err: errors.New("some other error"), + expectMatch: false, + }, + { + name: "Nested match", + err: fmt.Errorf("wrapping: %w", suggestsClientDelayErr()), + expectMatch: true, + }, + { + name: "Nested, no match", + err: fmt.Errorf("wrapping: %w", fmt.Errorf("some more: %w", errors.New("hello"))), + expectMatch: false, + }, + { + name: "Nil", + expectMatch: false, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if _, result := SuggestsClientDelay(tc.err); result != tc.expectMatch { + t.Errorf("expected match: %t, but got match: %t", tc.expectMatch, result) + } + }) + } +} + +func TestIsErrorTypesByReasonAndCode(t *testing.T) { + testCases := []struct { + name string + knownReason metav1.StatusReason + otherReason metav1.StatusReason + otherReasonConsidered bool + code int32 + fn func(error) bool + }{ + { + name: "IsRequestEntityTooLarge", + knownReason: metav1.StatusReasonRequestEntityTooLarge, + otherReason: metav1.StatusReasonForbidden, + otherReasonConsidered: false, + code: http.StatusRequestEntityTooLarge, + fn: IsRequestEntityTooLargeError, + }, { + name: "TooManyRequests", + knownReason: metav1.StatusReasonTooManyRequests, + otherReason: metav1.StatusReasonForbidden, + otherReasonConsidered: false, + code: http.StatusTooManyRequests, + fn: IsTooManyRequests, + }, { + name: "Forbidden", + knownReason: metav1.StatusReasonForbidden, + otherReason: metav1.StatusReasonNotFound, + otherReasonConsidered: true, + code: http.StatusForbidden, + fn: IsForbidden, + }, { + name: "NotFound", + knownReason: metav1.StatusReasonNotFound, + otherReason: metav1.StatusReasonForbidden, + otherReasonConsidered: true, + code: http.StatusNotFound, + fn: IsNotFound, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + t.Run("by known reason", func(t *testing.T) { + err := &StatusError{ + metav1.Status{ + Reason: tc.knownReason, + }, + } + + got := tc.fn(err) + if !got { + t.Errorf("expected reason %s to match", tc.knownReason) + } + }) + + t.Run("by code and unknown reason", func(t *testing.T) { + err := &StatusError{ + metav1.Status{ + Reason: metav1.StatusReasonUnknown, // this could be _any_ reason that isn't in knownReasons. + Code: tc.code, + }, + } + + got := tc.fn(err) + if !got { + t.Errorf("expected code %d with reason %s to match", tc.code, tc.otherReason) + } + }) + + if !tc.otherReasonConsidered { + return + } + + t.Run("by code and other known reason", func(t *testing.T) { + err := &StatusError{ + metav1.Status{ + Reason: tc.otherReason, + Code: tc.code, + }, + } + + got := tc.fn(err) + if got { + t.Errorf("expected code %d with reason %s to not match", tc.code, tc.otherReason) + } + }) + + }) + + } +} + +func TestStatusCauseSupportsWrappedErrors(t *testing.T) { + err := &StatusError{ErrStatus: metav1.Status{ + Details: &metav1.StatusDetails{ + Causes: []metav1.StatusCause{{Type: "SomeCause"}}, + }, + }} + + if cause, ok := StatusCause(nil, "SomeCause"); ok { + t.Errorf("expected no cause for nil, got %v: %#v", ok, cause) + } + if cause, ok := StatusCause(errors.New("boom"), "SomeCause"); ok { + t.Errorf("expected no cause for wrong type, got %v: %#v", ok, cause) + } + + if cause, ok := StatusCause(err, "Other"); ok { + t.Errorf("expected no cause for wrong name, got %v: %#v", ok, cause) + } + if cause, ok := StatusCause(err, "SomeCause"); !ok || cause != err.ErrStatus.Details.Causes[0] { + t.Errorf("expected cause, got %v: %#v", ok, cause) + } + + wrapped := fmt.Errorf("once: %w", err) + if cause, ok := StatusCause(wrapped, "SomeCause"); !ok || cause != err.ErrStatus.Details.Causes[0] { + t.Errorf("expected cause when wrapped, got %v: %#v", ok, cause) + } + + nested := fmt.Errorf("twice: %w", wrapped) + if cause, ok := StatusCause(nested, "SomeCause"); !ok || cause != err.ErrStatus.Details.Causes[0] { + t.Errorf("expected cause when nested, got %v: %#v", ok, cause) + } +} + +func BenchmarkIsAlreadyExistsWrappedErrors(b *testing.B) { + err := NewAlreadyExists(schema.GroupResource{}, "") + wrapped := fmt.Errorf("once: %w", err) + + b.Run("Nil", func(b *testing.B) { + for i := 0; i < b.N; i++ { + IsAlreadyExists(nil) + } + }) + + b.Run("Bare", func(b *testing.B) { + for i := 0; i < b.N; i++ { + IsAlreadyExists(err) + } + }) + + b.Run("Wrapped", func(b *testing.B) { + for i := 0; i < b.N; i++ { + IsAlreadyExists(wrapped) + } + }) +} + +func BenchmarkIsNotFoundWrappedErrors(b *testing.B) { + err := NewNotFound(schema.GroupResource{}, "") + wrapped := fmt.Errorf("once: %w", err) + + b.Run("Nil", func(b *testing.B) { + for i := 0; i < b.N; i++ { + IsNotFound(nil) + } + }) + + b.Run("Bare", func(b *testing.B) { + for i := 0; i < b.N; i++ { + IsNotFound(err) + } + }) + + b.Run("Wrapped", func(b *testing.B) { + for i := 0; i < b.N; i++ { + IsNotFound(wrapped) + } + }) +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/OWNERS b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/OWNERS new file mode 100644 index 00000000000..1e1330fff27 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/OWNERS @@ -0,0 +1,14 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - smarterclayton + - wojtek-t + - deads2k + - derekwaynecarr + - caesarxuchao + - mikedanese + - liggitt + - janetkuo + - ncdc + - dims diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/conditions.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/conditions.go new file mode 100644 index 00000000000..cbdf2eeb831 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/conditions.go @@ -0,0 +1,119 @@ +/* +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 meta + +import ( + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// SetStatusCondition sets the corresponding condition in conditions to newCondition and returns true +// if the conditions are changed by this call. +// conditions must be non-nil. +// 1. if the condition of the specified type already exists (all fields of the existing condition are updated to +// newCondition, LastTransitionTime is set to now if the new status differs from the old status) +// 2. if a condition of the specified type does not exist (LastTransitionTime is set to now() if unset, and newCondition is appended) +func SetStatusCondition(conditions *[]metav1.Condition, newCondition metav1.Condition) (changed bool) { + if conditions == nil { + return false + } + existingCondition := FindStatusCondition(*conditions, newCondition.Type) + if existingCondition == nil { + if newCondition.LastTransitionTime.IsZero() { + newCondition.LastTransitionTime = metav1.NewTime(time.Now()) + } + *conditions = append(*conditions, newCondition) + return true + } + + if existingCondition.Status != newCondition.Status { + existingCondition.Status = newCondition.Status + if !newCondition.LastTransitionTime.IsZero() { + existingCondition.LastTransitionTime = newCondition.LastTransitionTime + } else { + existingCondition.LastTransitionTime = metav1.NewTime(time.Now()) + } + changed = true + } + + if existingCondition.Reason != newCondition.Reason { + existingCondition.Reason = newCondition.Reason + changed = true + } + if existingCondition.Message != newCondition.Message { + existingCondition.Message = newCondition.Message + changed = true + } + if existingCondition.ObservedGeneration != newCondition.ObservedGeneration { + existingCondition.ObservedGeneration = newCondition.ObservedGeneration + changed = true + } + + return changed +} + +// RemoveStatusCondition removes the corresponding conditionType from conditions if present. Returns +// true if it was present and got removed. +// conditions must be non-nil. +func RemoveStatusCondition(conditions *[]metav1.Condition, conditionType string) (removed bool) { + if conditions == nil || len(*conditions) == 0 { + return false + } + newConditions := make([]metav1.Condition, 0, len(*conditions)-1) + for _, condition := range *conditions { + if condition.Type != conditionType { + newConditions = append(newConditions, condition) + } + } + + removed = len(*conditions) != len(newConditions) + *conditions = newConditions + + return removed +} + +// FindStatusCondition finds the conditionType in conditions. +func FindStatusCondition(conditions []metav1.Condition, conditionType string) *metav1.Condition { + for i := range conditions { + if conditions[i].Type == conditionType { + return &conditions[i] + } + } + + return nil +} + +// IsStatusConditionTrue returns true when the conditionType is present and set to `metav1.ConditionTrue` +func IsStatusConditionTrue(conditions []metav1.Condition, conditionType string) bool { + return IsStatusConditionPresentAndEqual(conditions, conditionType, metav1.ConditionTrue) +} + +// IsStatusConditionFalse returns true when the conditionType is present and set to `metav1.ConditionFalse` +func IsStatusConditionFalse(conditions []metav1.Condition, conditionType string) bool { + return IsStatusConditionPresentAndEqual(conditions, conditionType, metav1.ConditionFalse) +} + +// IsStatusConditionPresentAndEqual returns true when conditionType is present and equal to status. +func IsStatusConditionPresentAndEqual(conditions []metav1.Condition, conditionType string, status metav1.ConditionStatus) bool { + for _, condition := range conditions { + if condition.Type == conditionType { + return condition.Status == status + } + } + return false +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/conditions_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/conditions_test.go new file mode 100644 index 00000000000..248c885800b --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/conditions_test.go @@ -0,0 +1,250 @@ +/* +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 meta + +import ( + "reflect" + "testing" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestSetStatusCondition(t *testing.T) { + oneHourBefore := time.Now().Add(-1 * time.Hour) + oneHourAfter := time.Now().Add(1 * time.Hour) + + tests := []struct { + name string + conditions []metav1.Condition + toAdd metav1.Condition + expectChanged bool + expected []metav1.Condition + }{ + { + name: "should-add", + conditions: []metav1.Condition{ + {Type: "first"}, + {Type: "third"}, + }, + toAdd: metav1.Condition{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message"}, + expectChanged: true, + expected: []metav1.Condition{ + {Type: "first"}, + {Type: "third"}, + {Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message"}, + }, + }, + { + name: "use-supplied-time", + conditions: []metav1.Condition{ + {Type: "first"}, + {Type: "second", Status: metav1.ConditionFalse}, + {Type: "third"}, + }, + toAdd: metav1.Condition{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message"}, + expectChanged: true, + expected: []metav1.Condition{ + {Type: "first"}, + {Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message"}, + {Type: "third"}, + }, + }, + { + name: "update-fields", + conditions: []metav1.Condition{ + {Type: "first"}, + {Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}}, + {Type: "third"}, + }, + toAdd: metav1.Condition{Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourAfter}, Reason: "reason", Message: "message", ObservedGeneration: 3}, + expectChanged: true, + expected: []metav1.Condition{ + {Type: "first"}, + {Type: "second", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}, Reason: "reason", Message: "message", ObservedGeneration: 3}, + {Type: "third"}, + }, + }, + { + name: "nothing changes", + conditions: []metav1.Condition{{ + Type: "type", + Status: metav1.ConditionTrue, + LastTransitionTime: metav1.Time{Time: oneHourBefore}, + }}, + toAdd: metav1.Condition{Type: "type", Status: metav1.ConditionTrue, LastTransitionTime: metav1.Time{Time: oneHourBefore}}, + expected: []metav1.Condition{{ + Type: "type", + Status: metav1.ConditionTrue, + LastTransitionTime: metav1.Time{Time: oneHourBefore}, + }}, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + changed := SetStatusCondition(&test.conditions, test.toAdd) + if test.expectChanged != changed { + t.Errorf("expectChanged=%t != changed=%t", test.expectChanged, changed) + } + if !reflect.DeepEqual(test.conditions, test.expected) { + t.Error(test.conditions) + } + }) + } +} + +func TestRemoveStatusCondition(t *testing.T) { + tests := []struct { + name string + conditions []metav1.Condition + conditionType string + expectRemoval bool + expected []metav1.Condition + }{ + { + name: "present", + conditions: []metav1.Condition{ + {Type: "first"}, + {Type: "second"}, + {Type: "third"}, + }, + conditionType: "second", + expectRemoval: true, + expected: []metav1.Condition{ + {Type: "first"}, + {Type: "third"}, + }, + }, + { + name: "not-present", + conditions: []metav1.Condition{ + {Type: "first"}, + {Type: "second"}, + {Type: "third"}, + }, + conditionType: "fourth", + expected: []metav1.Condition{ + {Type: "first"}, + {Type: "second"}, + {Type: "third"}, + }, + }, + { + name: "empty_conditions", + conditions: []metav1.Condition{}, + conditionType: "Foo", + expected: []metav1.Condition{}, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + removed := RemoveStatusCondition(&test.conditions, test.conditionType) + if test.expectRemoval != removed { + t.Errorf("expectRemoval=%t != removal=%t", test.expectRemoval, removed) + } + if !reflect.DeepEqual(test.conditions, test.expected) { + t.Error(test.conditions) + } + }) + } +} + +func TestFindStatusCondition(t *testing.T) { + tests := []struct { + name string + conditions []metav1.Condition + conditionType string + expected *metav1.Condition + }{ + { + name: "not-present", + conditions: []metav1.Condition{ + {Type: "first"}, + }, + conditionType: "second", + expected: nil, + }, + { + name: "present", + conditions: []metav1.Condition{ + {Type: "first"}, + {Type: "second"}, + }, + conditionType: "second", + expected: &metav1.Condition{Type: "second"}, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + actual := FindStatusCondition(test.conditions, test.conditionType) + if !reflect.DeepEqual(actual, test.expected) { + t.Error(actual) + } + }) + } +} + +func TestIsStatusConditionPresentAndEqual(t *testing.T) { + tests := []struct { + name string + conditions []metav1.Condition + conditionType string + conditionStatus metav1.ConditionStatus + expected bool + }{ + { + name: "doesnt-match-true", + conditions: []metav1.Condition{ + {Type: "first", Status: metav1.ConditionUnknown}, + }, + conditionType: "first", + conditionStatus: metav1.ConditionTrue, + expected: false, + }, + { + name: "does-match-true", + conditions: []metav1.Condition{ + {Type: "first", Status: metav1.ConditionTrue}, + }, + conditionType: "first", + conditionStatus: metav1.ConditionTrue, + expected: true, + }, + { + name: "does-match-false", + conditions: []metav1.Condition{ + {Type: "first", Status: metav1.ConditionFalse}, + }, + conditionType: "first", + conditionStatus: metav1.ConditionFalse, + expected: true, + }, + } + + for _, test := range tests { + t.Run(test.name, func(t *testing.T) { + actual := IsStatusConditionPresentAndEqual(test.conditions, test.conditionType, test.conditionStatus) + if actual != test.expected { + t.Error(actual) + } + + }) + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/doc.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/doc.go new file mode 100644 index 00000000000..b6d42acf8fb --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta provides functions for retrieving API metadata from objects +// belonging to the Kubernetes API +package meta // import "k8s.io/apimachinery/pkg/api/meta" diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/errors.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/errors.go new file mode 100644 index 00000000000..f36aa4ec22a --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/errors.go @@ -0,0 +1,132 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "errors" + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/sets" +) + +// AmbiguousResourceError is returned if the RESTMapper finds multiple matches for a resource +type AmbiguousResourceError struct { + PartialResource schema.GroupVersionResource + + MatchingResources []schema.GroupVersionResource + MatchingKinds []schema.GroupVersionKind +} + +func (e *AmbiguousResourceError) Error() string { + switch { + case len(e.MatchingKinds) > 0 && len(e.MatchingResources) > 0: + return fmt.Sprintf("%v matches multiple resources %v and kinds %v", e.PartialResource, e.MatchingResources, e.MatchingKinds) + case len(e.MatchingKinds) > 0: + return fmt.Sprintf("%v matches multiple kinds %v", e.PartialResource, e.MatchingKinds) + case len(e.MatchingResources) > 0: + return fmt.Sprintf("%v matches multiple resources %v", e.PartialResource, e.MatchingResources) + } + return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialResource) +} + +func (*AmbiguousResourceError) Is(target error) bool { + _, ok := target.(*AmbiguousResourceError) + return ok +} + +// AmbiguousKindError is returned if the RESTMapper finds multiple matches for a kind +type AmbiguousKindError struct { + PartialKind schema.GroupVersionKind + + MatchingResources []schema.GroupVersionResource + MatchingKinds []schema.GroupVersionKind +} + +func (e *AmbiguousKindError) Error() string { + switch { + case len(e.MatchingKinds) > 0 && len(e.MatchingResources) > 0: + return fmt.Sprintf("%v matches multiple resources %v and kinds %v", e.PartialKind, e.MatchingResources, e.MatchingKinds) + case len(e.MatchingKinds) > 0: + return fmt.Sprintf("%v matches multiple kinds %v", e.PartialKind, e.MatchingKinds) + case len(e.MatchingResources) > 0: + return fmt.Sprintf("%v matches multiple resources %v", e.PartialKind, e.MatchingResources) + } + return fmt.Sprintf("%v matches multiple resources or kinds", e.PartialKind) +} + +func (*AmbiguousKindError) Is(target error) bool { + _, ok := target.(*AmbiguousKindError) + return ok +} + +func IsAmbiguousError(err error) bool { + if err == nil { + return false + } + return errors.Is(err, &AmbiguousResourceError{}) || errors.Is(err, &AmbiguousKindError{}) +} + +// NoResourceMatchError is returned if the RESTMapper can't find any match for a resource +type NoResourceMatchError struct { + PartialResource schema.GroupVersionResource +} + +func (e *NoResourceMatchError) Error() string { + return fmt.Sprintf("no matches for %v", e.PartialResource) +} + +func (*NoResourceMatchError) Is(target error) bool { + _, ok := target.(*NoResourceMatchError) + return ok +} + +// NoKindMatchError is returned if the RESTMapper can't find any match for a kind +type NoKindMatchError struct { + // GroupKind is the API group and kind that was searched + GroupKind schema.GroupKind + // SearchedVersions is the optional list of versions the search was restricted to + SearchedVersions []string +} + +func (e *NoKindMatchError) Error() string { + searchedVersions := sets.NewString() + for _, v := range e.SearchedVersions { + searchedVersions.Insert(schema.GroupVersion{Group: e.GroupKind.Group, Version: v}.String()) + } + + switch len(searchedVersions) { + case 0: + return fmt.Sprintf("no matches for kind %q in group %q", e.GroupKind.Kind, e.GroupKind.Group) + case 1: + return fmt.Sprintf("no matches for kind %q in version %q", e.GroupKind.Kind, searchedVersions.List()[0]) + default: + return fmt.Sprintf("no matches for kind %q in versions %q", e.GroupKind.Kind, searchedVersions.List()) + } +} + +func (*NoKindMatchError) Is(target error) bool { + _, ok := target.(*NoKindMatchError) + return ok +} + +func IsNoMatchError(err error) bool { + if err == nil { + return false + } + return errors.Is(err, &NoResourceMatchError{}) || errors.Is(err, &NoKindMatchError{}) +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/errors_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/errors_test.go new file mode 100644 index 00000000000..56e5d030b44 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/errors_test.go @@ -0,0 +1,79 @@ +/* +Copyright 2022 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "errors" + "fmt" + "testing" + + "k8s.io/apimachinery/pkg/runtime/schema" +) + +func TestErrorMatching(t *testing.T) { + testCases := []struct { + name string + // input should contain an error that is _not_ empty, otherwise the naive reflectlite.DeepEqual matching of + // the errors lib will always succeed, but for all of these we want to verify that the matching is based on + // type. + input error + new func() error + matcherFunc func(error) bool + }{ + { + name: "AmbiguousResourceError", + input: &AmbiguousResourceError{MatchingResources: []schema.GroupVersionResource{{}}}, + new: func() error { return &AmbiguousResourceError{} }, + matcherFunc: IsAmbiguousError, + }, + { + name: "AmbiguousKindError", + input: &AmbiguousKindError{MatchingResources: []schema.GroupVersionResource{{}}}, + new: func() error { return &AmbiguousKindError{} }, + matcherFunc: IsAmbiguousError, + }, + { + name: "NoResourceMatchError", + input: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Group: "foo"}}, + new: func() error { return &NoResourceMatchError{} }, + matcherFunc: IsNoMatchError, + }, + { + name: "NoKindMatchError", + input: &NoKindMatchError{SearchedVersions: []string{"foo"}}, + new: func() error { return &NoKindMatchError{} }, + matcherFunc: IsNoMatchError, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if !errors.Is(tc.input, tc.new()) { + t.Error("error doesn't match itself directly") + } + if !errors.Is(fmt.Errorf("wrapepd: %w", tc.input), tc.new()) { + t.Error("error doesn't match itself when wrapped") + } + if !tc.matcherFunc(tc.input) { + t.Errorf("error doesn't get matched by matcherfunc") + } + if errors.Is(tc.input, errors.New("foo")) { + t.Error("error incorrectly matches other error") + } + }) + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/firsthit_restmapper.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/firsthit_restmapper.go new file mode 100644 index 00000000000..1bc816fe3f3 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/firsthit_restmapper.go @@ -0,0 +1,105 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" + utilerrors "k8s.io/apimachinery/pkg/util/errors" +) + +var ( + _ ResettableRESTMapper = &FirstHitRESTMapper{} +) + +// FirstHitRESTMapper is a wrapper for multiple RESTMappers which returns the +// first successful result for the singular requests +type FirstHitRESTMapper struct { + MultiRESTMapper +} + +func (m FirstHitRESTMapper) String() string { + return fmt.Sprintf("FirstHitRESTMapper{\n\t%v\n}", m.MultiRESTMapper) +} + +func (m FirstHitRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + errors := []error{} + for _, t := range m.MultiRESTMapper { + ret, err := t.ResourceFor(resource) + if err == nil { + return ret, nil + } + errors = append(errors, err) + } + + return schema.GroupVersionResource{}, collapseAggregateErrors(errors) +} + +func (m FirstHitRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + errors := []error{} + for _, t := range m.MultiRESTMapper { + ret, err := t.KindFor(resource) + if err == nil { + return ret, nil + } + errors = append(errors, err) + } + + return schema.GroupVersionKind{}, collapseAggregateErrors(errors) +} + +// RESTMapping provides the REST mapping for the resource based on the +// kind and version. This implementation supports multiple REST schemas and +// return the first match. +func (m FirstHitRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + errors := []error{} + for _, t := range m.MultiRESTMapper { + ret, err := t.RESTMapping(gk, versions...) + if err == nil { + return ret, nil + } + errors = append(errors, err) + } + + return nil, collapseAggregateErrors(errors) +} + +func (m FirstHitRESTMapper) Reset() { + m.MultiRESTMapper.Reset() +} + +// collapseAggregateErrors returns the minimal errors. it handles empty as nil, handles one item in a list +// by returning the item, and collapses all NoMatchErrors to a single one (since they should all be the same) +func collapseAggregateErrors(errors []error) error { + if len(errors) == 0 { + return nil + } + if len(errors) == 1 { + return errors[0] + } + + allNoMatchErrors := true + for _, err := range errors { + allNoMatchErrors = allNoMatchErrors && IsNoMatchError(err) + } + if allNoMatchErrors { + return errors[0] + } + + return utilerrors.NewAggregate(errors) +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/help.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/help.go new file mode 100644 index 00000000000..1fdd32c4ba3 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/help.go @@ -0,0 +1,331 @@ +/* +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 meta + +import ( + "errors" + "fmt" + "reflect" + "sync" + + "k8s.io/apimachinery/pkg/conversion" + "k8s.io/apimachinery/pkg/runtime" +) + +var ( + // isListCache maintains a cache of types that are checked for lists + // which is used by IsListType. + // TODO: remove and replace with an interface check + isListCache = struct { + lock sync.RWMutex + byType map[reflect.Type]bool + }{ + byType: make(map[reflect.Type]bool, 1024), + } +) + +// IsListType returns true if the provided Object has a slice called Items. +// TODO: Replace the code in this check with an interface comparison by +// creating and enforcing that lists implement a list accessor. +func IsListType(obj runtime.Object) bool { + switch t := obj.(type) { + case runtime.Unstructured: + return t.IsList() + } + t := reflect.TypeOf(obj) + + isListCache.lock.RLock() + ok, exists := isListCache.byType[t] + isListCache.lock.RUnlock() + + if !exists { + _, err := getItemsPtr(obj) + ok = err == nil + + // cache only the first 1024 types + isListCache.lock.Lock() + if len(isListCache.byType) < 1024 { + isListCache.byType[t] = ok + } + isListCache.lock.Unlock() + } + + return ok +} + +var ( + errExpectFieldItems = errors.New("no Items field in this object") + errExpectSliceItems = errors.New("Items field must be a slice of objects") +) + +// GetItemsPtr returns a pointer to the list object's Items member. +// If 'list' doesn't have an Items member, it's not really a list type +// and an error will be returned. +// This function will either return a pointer to a slice, or an error, but not both. +// TODO: this will be replaced with an interface in the future +func GetItemsPtr(list runtime.Object) (interface{}, error) { + obj, err := getItemsPtr(list) + if err != nil { + return nil, fmt.Errorf("%T is not a list: %v", list, err) + } + return obj, nil +} + +// getItemsPtr returns a pointer to the list object's Items member or an error. +func getItemsPtr(list runtime.Object) (interface{}, error) { + v, err := conversion.EnforcePtr(list) + if err != nil { + return nil, err + } + + items := v.FieldByName("Items") + if !items.IsValid() { + return nil, errExpectFieldItems + } + switch items.Kind() { + case reflect.Interface, reflect.Pointer: + target := reflect.TypeOf(items.Interface()).Elem() + if target.Kind() != reflect.Slice { + return nil, errExpectSliceItems + } + return items.Interface(), nil + case reflect.Slice: + return items.Addr().Interface(), nil + default: + return nil, errExpectSliceItems + } +} + +// EachListItem invokes fn on each runtime.Object in the list. Any error immediately terminates +// the loop. +// +// If items passed to fn are retained for different durations, and you want to avoid +// retaining all items in obj as long as any item is referenced, use EachListItemWithAlloc instead. +func EachListItem(obj runtime.Object, fn func(runtime.Object) error) error { + return eachListItem(obj, fn, false) +} + +// EachListItemWithAlloc works like EachListItem, but avoids retaining references to the items slice in obj. +// It does this by making a shallow copy of non-pointer items in obj. +// +// If the items passed to fn are not retained, or are retained for the same duration, use EachListItem instead for memory efficiency. +func EachListItemWithAlloc(obj runtime.Object, fn func(runtime.Object) error) error { + return eachListItem(obj, fn, true) +} + +// allocNew: Whether shallow copy is required when the elements in Object.Items are struct +func eachListItem(obj runtime.Object, fn func(runtime.Object) error, allocNew bool) error { + if unstructured, ok := obj.(runtime.Unstructured); ok { + if allocNew { + return unstructured.EachListItemWithAlloc(fn) + } + return unstructured.EachListItem(fn) + } + // TODO: Change to an interface call? + itemsPtr, err := GetItemsPtr(obj) + if err != nil { + return err + } + items, err := conversion.EnforcePtr(itemsPtr) + if err != nil { + return err + } + len := items.Len() + if len == 0 { + return nil + } + takeAddr := false + if elemType := items.Type().Elem(); elemType.Kind() != reflect.Pointer && elemType.Kind() != reflect.Interface { + if !items.Index(0).CanAddr() { + return fmt.Errorf("unable to take address of items in %T for EachListItem", obj) + } + takeAddr = true + } + + for i := 0; i < len; i++ { + raw := items.Index(i) + if takeAddr { + if allocNew { + // shallow copy to avoid retaining a reference to the original list item + itemCopy := reflect.New(raw.Type()) + // assign to itemCopy and type-assert + itemCopy.Elem().Set(raw) + // reflect.New will guarantee that itemCopy must be a pointer. + raw = itemCopy + } else { + raw = raw.Addr() + } + } + // raw must be a pointer or an interface + // allocate a pointer is cheap + switch item := raw.Interface().(type) { + case *runtime.RawExtension: + if err := fn(item.Object); err != nil { + return err + } + case runtime.Object: + if err := fn(item); err != nil { + return err + } + default: + obj, ok := item.(runtime.Object) + if !ok { + return fmt.Errorf("%v: item[%v]: Expected object, got %#v(%s)", obj, i, raw.Interface(), raw.Kind()) + } + if err := fn(obj); err != nil { + return err + } + } + } + return nil +} + +// ExtractList returns obj's Items element as an array of runtime.Objects. +// Returns an error if obj is not a List type (does not have an Items member). +// +// If items in the returned list are retained for different durations, and you want to avoid +// retaining all items in obj as long as any item is referenced, use ExtractListWithAlloc instead. +func ExtractList(obj runtime.Object) ([]runtime.Object, error) { + return extractList(obj, false) +} + +// ExtractListWithAlloc works like ExtractList, but avoids retaining references to the items slice in obj. +// It does this by making a shallow copy of non-pointer items in obj. +// +// If the items in the returned list are not retained, or are retained for the same duration, use ExtractList instead for memory efficiency. +func ExtractListWithAlloc(obj runtime.Object) ([]runtime.Object, error) { + return extractList(obj, true) +} + +// allocNew: Whether shallow copy is required when the elements in Object.Items are struct +func extractList(obj runtime.Object, allocNew bool) ([]runtime.Object, error) { + itemsPtr, err := GetItemsPtr(obj) + if err != nil { + return nil, err + } + items, err := conversion.EnforcePtr(itemsPtr) + if err != nil { + return nil, err + } + list := make([]runtime.Object, items.Len()) + if len(list) == 0 { + return list, nil + } + elemType := items.Type().Elem() + isRawExtension := elemType == rawExtensionObjectType + implementsObject := elemType.Implements(objectType) + for i := range list { + raw := items.Index(i) + switch { + case isRawExtension: + item := raw.Interface().(runtime.RawExtension) + switch { + case item.Object != nil: + list[i] = item.Object + case item.Raw != nil: + // TODO: Set ContentEncoding and ContentType correctly. + list[i] = &runtime.Unknown{Raw: item.Raw} + default: + list[i] = nil + } + case implementsObject: + list[i] = raw.Interface().(runtime.Object) + case allocNew: + // shallow copy to avoid retaining a reference to the original list item + itemCopy := reflect.New(raw.Type()) + // assign to itemCopy and type-assert + itemCopy.Elem().Set(raw) + var ok bool + // reflect.New will guarantee that itemCopy must be a pointer. + if list[i], ok = itemCopy.Interface().(runtime.Object); !ok { + return nil, fmt.Errorf("%v: item[%v]: Expected object, got %#v(%s)", obj, i, raw.Interface(), raw.Kind()) + } + default: + var found bool + if list[i], found = raw.Addr().Interface().(runtime.Object); !found { + return nil, fmt.Errorf("%v: item[%v]: Expected object, got %#v(%s)", obj, i, raw.Interface(), raw.Kind()) + } + } + } + return list, nil +} + +var ( + // objectSliceType is the type of a slice of Objects + objectSliceType = reflect.TypeOf([]runtime.Object{}) + objectType = reflect.TypeOf((*runtime.Object)(nil)).Elem() + rawExtensionObjectType = reflect.TypeOf(runtime.RawExtension{}) +) + +// LenList returns the length of this list or 0 if it is not a list. +func LenList(list runtime.Object) int { + itemsPtr, err := GetItemsPtr(list) + if err != nil { + return 0 + } + items, err := conversion.EnforcePtr(itemsPtr) + if err != nil { + return 0 + } + return items.Len() +} + +// SetList sets the given list object's Items member have the elements given in +// objects. +// Returns an error if list is not a List type (does not have an Items member), +// or if any of the objects are not of the right type. +func SetList(list runtime.Object, objects []runtime.Object) error { + itemsPtr, err := GetItemsPtr(list) + if err != nil { + return err + } + items, err := conversion.EnforcePtr(itemsPtr) + if err != nil { + return err + } + if items.Type() == objectSliceType { + items.Set(reflect.ValueOf(objects)) + return nil + } + slice := reflect.MakeSlice(items.Type(), len(objects), len(objects)) + for i := range objects { + dest := slice.Index(i) + if dest.Type() == rawExtensionObjectType { + dest = dest.FieldByName("Object") + } + + // check to see if you're directly assignable + if reflect.TypeOf(objects[i]).AssignableTo(dest.Type()) { + dest.Set(reflect.ValueOf(objects[i])) + continue + } + + src, err := conversion.EnforcePtr(objects[i]) + if err != nil { + return err + } + if src.Type().AssignableTo(dest.Type()) { + dest.Set(src) + } else if src.Type().ConvertibleTo(dest.Type()) { + dest.Set(src.Convert(dest.Type())) + } else { + return fmt.Errorf("item[%d]: can't assign or convert %v into %v", i, src.Type(), dest.Type()) + } + } + items.Set(slice) + return nil +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/help_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/help_test.go new file mode 100644 index 00000000000..34e12d34c4d --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/help_test.go @@ -0,0 +1,539 @@ +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "reflect" + "strconv" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + fakeObjectItemsNum = 1000 + exemptObjectIndex = fakeObjectItemsNum / 4 +) + +type SampleSpec struct { + Flied int +} + +type FooSpec struct { + Flied int +} + +type FooList struct { + metav1.TypeMeta + metav1.ListMeta + Items []Foo +} + +func (s *FooList) DeepCopyObject() runtime.Object { panic("unimplemented") } + +type SampleList struct { + metav1.TypeMeta + metav1.ListMeta + Items []Sample +} + +func (s *SampleList) DeepCopyObject() runtime.Object { panic("unimplemented") } + +type RawExtensionList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []runtime.RawExtension +} + +func (l RawExtensionList) DeepCopyObject() runtime.Object { panic("unimplemented") } + +// NOTE: Foo struct itself is the implementer of runtime.Object. +type Foo struct { + metav1.TypeMeta + metav1.ObjectMeta + Spec FooSpec +} + +func (f Foo) GetObjectKind() schema.ObjectKind { + tm := f.TypeMeta + return &tm +} + +func (f Foo) DeepCopyObject() runtime.Object { panic("unimplemented") } + +// NOTE: the pointer of Sample that is the implementer of runtime.Object. +// the behavior is similar to our corev1.Pod. corev1.Node +type Sample struct { + metav1.TypeMeta + metav1.ObjectMeta + Spec SampleSpec +} + +func (s *Sample) GetObjectKind() schema.ObjectKind { + tm := s.TypeMeta + return &tm +} + +func (s *Sample) DeepCopyObject() runtime.Object { panic("unimplemented") } + +func fakeSampleList(numItems int) *SampleList { + out := &SampleList{ + Items: make([]Sample, numItems), + } + + for i := range out.Items { + out.Items[i] = Sample{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "sample.org/v1", + Kind: "Sample", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: strconv.Itoa(i), + Namespace: "default", + Labels: map[string]string{ + "label-key-1": "label-value-1", + }, + Annotations: map[string]string{ + "annotations-key-1": "annotations-value-1", + }, + }, + Spec: SampleSpec{ + Flied: i, + }, + } + } + return out +} + +func fakeExtensionList(numItems int) *RawExtensionList { + out := &RawExtensionList{ + Items: make([]runtime.RawExtension, numItems), + } + + for i := range out.Items { + out.Items[i] = runtime.RawExtension{ + Object: &Foo{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "sample.org/v2", + Kind: "Sample", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: strconv.Itoa(i), + Namespace: "default", + Labels: map[string]string{ + "label-key-1": "label-value-1", + }, + Annotations: map[string]string{ + "annotations-key-1": "annotations-value-1", + }, + }, + Spec: FooSpec{ + Flied: i, + }, + }, + } + } + return out +} + +func fakeUnstructuredList(numItems int) runtime.Unstructured { + out := &unstructured.UnstructuredList{ + Items: make([]unstructured.Unstructured, numItems), + } + + for i := range out.Items { + out.Items[i] = unstructured.Unstructured{ + Object: map[string]interface{}{ + "apiVersion": "v1", + "kind": "Pod", + "metadata": map[string]interface{}{ + "creationTimestamp": nil, + "name": strconv.Itoa(i), + }, + "spec": map[string]interface{}{ + "hostname": "example.com", + }, + "status": map[string]interface{}{}, + }, + } + } + return out +} + +func fakeFooList(numItems int) *FooList { + out := &FooList{ + Items: make([]Foo, numItems), + } + + for i := range out.Items { + out.Items[i] = Foo{ + TypeMeta: metav1.TypeMeta{ + APIVersion: "foo.org/v1", + Kind: "Foo", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: strconv.Itoa(i), + Namespace: "default", + Labels: map[string]string{ + "label-key-1": "label-value-1", + }, + Annotations: map[string]string{ + "annotations-key-1": "annotations-value-1", + }, + }, + Spec: FooSpec{ + Flied: i, + }, + } + } + return out +} + +func TestEachList(t *testing.T) { + tests := []struct { + name string + generateFunc func(num int) (list runtime.Object) + expectObjectNum int + }{ + { + name: "StructReceiverList", + generateFunc: func(num int) (list runtime.Object) { + return fakeFooList(num) + }, + expectObjectNum: fakeObjectItemsNum, + }, + { + name: "PointerReceiverList", + generateFunc: func(num int) (list runtime.Object) { + return fakeSampleList(num) + }, + expectObjectNum: fakeObjectItemsNum, + }, + { + name: "RawExtensionList", + generateFunc: func(num int) (list runtime.Object) { + return fakeExtensionList(num) + }, + expectObjectNum: fakeObjectItemsNum, + }, + { + name: "UnstructuredList", + generateFunc: func(num int) (list runtime.Object) { + return fakeUnstructuredList(fakeObjectItemsNum) + }, + expectObjectNum: fakeObjectItemsNum, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + t.Run("EachListItem", func(t *testing.T) { + expectObjectNames := map[string]struct{}{} + for i := 0; i < tc.expectObjectNum; i++ { + expectObjectNames[strconv.Itoa(i)] = struct{}{} + } + list := tc.generateFunc(tc.expectObjectNum) + err := EachListItem(list, func(object runtime.Object) error { + o, err := Accessor(object) + if err != nil { + return err + } + delete(expectObjectNames, o.GetName()) + return nil + }) + if err != nil { + t.Errorf("each list item %#v: %v", list, err) + } + if len(expectObjectNames) != 0 { + t.Fatal("expectObjectNames should be empty") + } + }) + t.Run("EachListItemWithAlloc", func(t *testing.T) { + expectObjectNames := map[string]struct{}{} + for i := 0; i < tc.expectObjectNum; i++ { + expectObjectNames[strconv.Itoa(i)] = struct{}{} + } + list := tc.generateFunc(tc.expectObjectNum) + err := EachListItemWithAlloc(list, func(object runtime.Object) error { + o, err := Accessor(object) + if err != nil { + return err + } + delete(expectObjectNames, o.GetName()) + return nil + }) + if err != nil { + t.Errorf("each list %#v with alloc: %v", list, err) + } + if len(expectObjectNames) != 0 { + t.Fatal("expectObjectNames should be empty") + } + }) + }) + } +} + +func TestExtractList(t *testing.T) { + tests := []struct { + name string + generateFunc func(num int) (list runtime.Object) + expectObjectNum int + }{ + { + name: "StructReceiverList", + generateFunc: func(num int) (list runtime.Object) { + return fakeFooList(num) + }, + expectObjectNum: fakeObjectItemsNum, + }, + { + name: "PointerReceiverList", + generateFunc: func(num int) (list runtime.Object) { + return fakeSampleList(num) + }, + expectObjectNum: fakeObjectItemsNum, + }, + { + name: "RawExtensionList", + generateFunc: func(num int) (list runtime.Object) { + return fakeExtensionList(num) + }, + expectObjectNum: fakeObjectItemsNum, + }, + { + name: "UnstructuredList", + generateFunc: func(num int) (list runtime.Object) { + return fakeUnstructuredList(fakeObjectItemsNum) + }, + expectObjectNum: fakeObjectItemsNum, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + t.Run("ExtractList", func(t *testing.T) { + expectObjectNames := map[string]struct{}{} + for i := 0; i < tc.expectObjectNum; i++ { + expectObjectNames[strconv.Itoa(i)] = struct{}{} + } + list := tc.generateFunc(tc.expectObjectNum) + objs, err := ExtractList(list) + if err != nil { + t.Fatalf("extract list %#v: %v", list, err) + } + for i := range objs { + var ( + o metav1.Object + err error + obj = objs[i] + ) + + if reflect.TypeOf(obj).Kind() == reflect.Struct { + copy := reflect.New(reflect.TypeOf(obj)) + copy.Elem().Set(reflect.ValueOf(obj)) + o, err = Accessor(copy.Interface()) + } else { + o, err = Accessor(obj) + } + if err != nil { + t.Fatalf("Accessor object %#v: %v", obj, err) + } + delete(expectObjectNames, o.GetName()) + } + if len(expectObjectNames) != 0 { + t.Fatal("expectObjectNames should be empty") + } + }) + t.Run("ExtractListWithAlloc", func(t *testing.T) { + expectObjectNames := map[string]struct{}{} + for i := 0; i < tc.expectObjectNum; i++ { + expectObjectNames[strconv.Itoa(i)] = struct{}{} + } + list := tc.generateFunc(tc.expectObjectNum) + objs, err := ExtractListWithAlloc(list) + if err != nil { + t.Fatalf("extract list with alloc: %v", err) + } + for i := range objs { + var ( + o metav1.Object + err error + obj = objs[i] + ) + if reflect.TypeOf(obj).Kind() == reflect.Struct { + copy := reflect.New(reflect.TypeOf(obj)) + copy.Elem().Set(reflect.ValueOf(obj)) + o, err = Accessor(copy.Interface()) + } else { + o, err = Accessor(obj) + } + if err != nil { + t.Fatalf("Accessor object %#v: %v", obj, err) + } + delete(expectObjectNames, o.GetName()) + } + if len(expectObjectNames) != 0 { + t.Fatal("expectObjectNames should be empty") + } + }) + }) + } +} + +func BenchmarkExtractListItem(b *testing.B) { + tests := []struct { + name string + list runtime.Object + }{ + { + name: "StructReceiverList", + list: fakeFooList(fakeObjectItemsNum), + }, + { + name: "PointerReceiverList", + list: fakeSampleList(fakeObjectItemsNum), + }, + { + name: "RawExtensionList", + list: fakeExtensionList(fakeObjectItemsNum), + }, + } + for _, tc := range tests { + b.Run(tc.name, func(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := ExtractList(tc.list) + if err != nil { + b.Fatalf("ExtractList: %v", err) + } + } + b.StopTimer() + }) + } +} + +func BenchmarkEachListItem(b *testing.B) { + tests := []struct { + name string + list runtime.Object + }{ + { + name: "StructReceiverList", + list: fakeFooList(fakeObjectItemsNum), + }, + { + name: "PointerReceiverList", + list: fakeSampleList(fakeObjectItemsNum), + }, + { + name: "RawExtensionList", + list: fakeExtensionList(fakeObjectItemsNum), + }, + { + name: "UnstructuredList", + list: fakeUnstructuredList(fakeObjectItemsNum), + }, + } + for _, tc := range tests { + b.Run(tc.name, func(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := EachListItem(tc.list, func(object runtime.Object) error { + return nil + }) + if err != nil { + b.Fatalf("EachListItem: %v", err) + } + } + b.StopTimer() + }) + } +} + +func BenchmarkExtractListItemWithAlloc(b *testing.B) { + tests := []struct { + name string + list runtime.Object + }{ + { + name: "StructReceiverList", + list: fakeFooList(fakeObjectItemsNum), + }, + { + name: "PointerReceiverList", + list: fakeSampleList(fakeObjectItemsNum), + }, + { + name: "RawExtensionList", + list: fakeExtensionList(fakeObjectItemsNum), + }, + } + for _, tc := range tests { + b.Run(tc.name, func(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + _, err := ExtractListWithAlloc(tc.list) + if err != nil { + b.Fatalf("ExtractListWithAlloc: %v", err) + } + } + b.StopTimer() + }) + } +} + +func BenchmarkEachListItemWithAlloc(b *testing.B) { + tests := []struct { + name string + list runtime.Object + }{ + { + name: "StructReceiverList", + list: fakeFooList(fakeObjectItemsNum), + }, + { + name: "PointerReceiverList", + list: fakeSampleList(fakeObjectItemsNum), + }, + { + name: "RawExtensionList", + list: fakeExtensionList(fakeObjectItemsNum), + }, + { + name: "UnstructuredList", + list: fakeUnstructuredList(fakeObjectItemsNum), + }, + } + for _, tc := range tests { + b.Run(tc.name, func(b *testing.B) { + b.ResetTimer() + for i := 0; i < b.N; i++ { + err := EachListItemWithAlloc(tc.list, func(object runtime.Object) error { + return nil + }) + if err != nil { + b.Fatalf("EachListItemWithAlloc: %v", err) + } + } + b.StopTimer() + }) + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/interfaces.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/interfaces.go new file mode 100644 index 00000000000..a35ce3bd0aa --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/interfaces.go @@ -0,0 +1,143 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" +) + +type ListMetaAccessor interface { + GetListMeta() List +} + +// List lets you work with list metadata from any of the versioned or +// internal API objects. Attempting to set or retrieve a field on an object that does +// not support that field will be a no-op and return a default value. +type List metav1.ListInterface + +// Type exposes the type and APIVersion of versioned or internal API objects. +type Type metav1.Type + +// MetadataAccessor lets you work with object and list metadata from any of the versioned or +// internal API objects. Attempting to set or retrieve a field on an object that does +// not support that field (Name, UID, Namespace on lists) will be a no-op and return +// a default value. +// +// MetadataAccessor exposes Interface in a way that can be used with multiple objects. +type MetadataAccessor interface { + APIVersion(obj runtime.Object) (string, error) + SetAPIVersion(obj runtime.Object, version string) error + + Kind(obj runtime.Object) (string, error) + SetKind(obj runtime.Object, kind string) error + + Namespace(obj runtime.Object) (string, error) + SetNamespace(obj runtime.Object, namespace string) error + + Name(obj runtime.Object) (string, error) + SetName(obj runtime.Object, name string) error + + GenerateName(obj runtime.Object) (string, error) + SetGenerateName(obj runtime.Object, name string) error + + UID(obj runtime.Object) (types.UID, error) + SetUID(obj runtime.Object, uid types.UID) error + + SelfLink(obj runtime.Object) (string, error) + SetSelfLink(obj runtime.Object, selfLink string) error + + Labels(obj runtime.Object) (map[string]string, error) + SetLabels(obj runtime.Object, labels map[string]string) error + + Annotations(obj runtime.Object) (map[string]string, error) + SetAnnotations(obj runtime.Object, annotations map[string]string) error + + Continue(obj runtime.Object) (string, error) + SetContinue(obj runtime.Object, c string) error + + runtime.ResourceVersioner +} + +type RESTScopeName string + +const ( + RESTScopeNameNamespace RESTScopeName = "namespace" + RESTScopeNameRoot RESTScopeName = "root" +) + +// RESTScope contains the information needed to deal with REST resources that are in a resource hierarchy +type RESTScope interface { + // Name of the scope + Name() RESTScopeName +} + +// RESTMapping contains the information needed to deal with objects of a specific +// resource and kind in a RESTful manner. +type RESTMapping struct { + // Resource is the GroupVersionResource (location) for this endpoint + Resource schema.GroupVersionResource + + // GroupVersionKind is the GroupVersionKind (data format) to submit to this endpoint + GroupVersionKind schema.GroupVersionKind + + // Scope contains the information needed to deal with REST Resources that are in a resource hierarchy + Scope RESTScope +} + +// RESTMapper allows clients to map resources to kind, and map kind and version +// to interfaces for manipulating those objects. It is primarily intended for +// consumers of Kubernetes compatible REST APIs as defined in docs/devel/api-conventions.md. +// +// The Kubernetes API provides versioned resources and object kinds which are scoped +// to API groups. In other words, kinds and resources should not be assumed to be +// unique across groups. +// +// TODO: split into sub-interfaces +type RESTMapper interface { + // KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches + KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) + + // KindsFor takes a partial resource and returns the list of potential kinds in priority order + KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) + + // ResourceFor takes a partial resource and returns the single match. Returns an error if there are multiple matches + ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error) + + // ResourcesFor takes a partial resource and returns the list of potential resource in priority order + ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) + + // RESTMapping identifies a preferred resource mapping for the provided group kind. + RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) + // RESTMappings returns all resource mappings for the provided group kind if no + // version search is provided. Otherwise identifies a preferred resource mapping for + // the provided version(s). + RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) + + ResourceSingularizer(resource string) (singular string, err error) +} + +// ResettableRESTMapper is a RESTMapper which is capable of resetting itself +// from discovery. +// All rest mappers that delegate to other rest mappers must implement this interface and dynamically +// check if the delegate mapper supports the Reset() operation. +type ResettableRESTMapper interface { + RESTMapper + Reset() +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/lazy.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/lazy.go new file mode 100644 index 00000000000..a4298114b6d --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/lazy.go @@ -0,0 +1,112 @@ +/* +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 meta + +import ( + "sync" + + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// lazyObject defers loading the mapper and typer until necessary. +type lazyObject struct { + loader func() (RESTMapper, error) + + lock sync.Mutex + loaded bool + err error + mapper RESTMapper +} + +// NewLazyRESTMapperLoader handles unrecoverable errors when creating a RESTMapper / ObjectTyper by +// returning those initialization errors when the interface methods are invoked. This defers the +// initialization and any server calls until a client actually needs to perform the action. +func NewLazyRESTMapperLoader(fn func() (RESTMapper, error)) RESTMapper { + obj := &lazyObject{loader: fn} + return obj +} + +// init lazily loads the mapper and typer, returning an error if initialization has failed. +func (o *lazyObject) init() error { + o.lock.Lock() + defer o.lock.Unlock() + if o.loaded { + return o.err + } + o.mapper, o.err = o.loader() + o.loaded = true + return o.err +} + +var _ ResettableRESTMapper = &lazyObject{} + +func (o *lazyObject) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + if err := o.init(); err != nil { + return schema.GroupVersionKind{}, err + } + return o.mapper.KindFor(resource) +} + +func (o *lazyObject) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { + if err := o.init(); err != nil { + return []schema.GroupVersionKind{}, err + } + return o.mapper.KindsFor(resource) +} + +func (o *lazyObject) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error) { + if err := o.init(); err != nil { + return schema.GroupVersionResource{}, err + } + return o.mapper.ResourceFor(input) +} + +func (o *lazyObject) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + if err := o.init(); err != nil { + return []schema.GroupVersionResource{}, err + } + return o.mapper.ResourcesFor(input) +} + +func (o *lazyObject) RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + if err := o.init(); err != nil { + return nil, err + } + return o.mapper.RESTMapping(gk, versions...) +} + +func (o *lazyObject) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + if err := o.init(); err != nil { + return nil, err + } + return o.mapper.RESTMappings(gk, versions...) +} + +func (o *lazyObject) ResourceSingularizer(resource string) (singular string, err error) { + if err := o.init(); err != nil { + return "", err + } + return o.mapper.ResourceSingularizer(resource) +} + +func (o *lazyObject) Reset() { + o.lock.Lock() + defer o.lock.Unlock() + if o.loaded && o.err == nil { + MaybeResetRESTMapper(o.mapper) + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/meta.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/meta.go new file mode 100644 index 00000000000..2551f07f5cf --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/meta.go @@ -0,0 +1,643 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "fmt" + "reflect" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/conversion" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" + "k8s.io/klog/v2" +) + +// errNotList is returned when an object implements the Object style interfaces but not the List style +// interfaces. +var errNotList = fmt.Errorf("object does not implement the List interfaces") + +var errNotCommon = fmt.Errorf("object does not implement the common interface for accessing the SelfLink") + +// CommonAccessor returns a Common interface for the provided object or an error if the object does +// not provide List. +func CommonAccessor(obj interface{}) (metav1.Common, error) { + switch t := obj.(type) { + case List: + return t, nil + case ListMetaAccessor: + if m := t.GetListMeta(); m != nil { + return m, nil + } + return nil, errNotCommon + case metav1.ListMetaAccessor: + if m := t.GetListMeta(); m != nil { + return m, nil + } + return nil, errNotCommon + case metav1.Object: + return t, nil + case metav1.ObjectMetaAccessor: + if m := t.GetObjectMeta(); m != nil { + return m, nil + } + return nil, errNotCommon + default: + return nil, errNotCommon + } +} + +// ListAccessor returns a List interface for the provided object or an error if the object does +// not provide List. +// IMPORTANT: Objects are NOT a superset of lists. Do not use this check to determine whether an +// object *is* a List. +func ListAccessor(obj interface{}) (List, error) { + switch t := obj.(type) { + case List: + return t, nil + case ListMetaAccessor: + if m := t.GetListMeta(); m != nil { + return m, nil + } + return nil, errNotList + case metav1.ListMetaAccessor: + if m := t.GetListMeta(); m != nil { + return m, nil + } + return nil, errNotList + default: + return nil, errNotList + } +} + +// errNotObject is returned when an object implements the List style interfaces but not the Object style +// interfaces. +var errNotObject = fmt.Errorf("object does not implement the Object interfaces") + +// Accessor takes an arbitrary object pointer and returns meta.Interface. +// obj must be a pointer to an API type. An error is returned if the minimum +// required fields are missing. Fields that are not required return the default +// value and are a no-op if set. +func Accessor(obj interface{}) (metav1.Object, error) { + switch t := obj.(type) { + case metav1.Object: + return t, nil + case metav1.ObjectMetaAccessor: + if m := t.GetObjectMeta(); m != nil { + return m, nil + } + return nil, errNotObject + default: + return nil, errNotObject + } +} + +// AsPartialObjectMetadata takes the metav1 interface and returns a partial object. +// TODO: consider making this solely a conversion action. +func AsPartialObjectMetadata(m metav1.Object) *metav1.PartialObjectMetadata { + switch t := m.(type) { + case *metav1.ObjectMeta: + return &metav1.PartialObjectMetadata{ObjectMeta: *t} + default: + return &metav1.PartialObjectMetadata{ + ObjectMeta: metav1.ObjectMeta{ + Name: m.GetName(), + GenerateName: m.GetGenerateName(), + Namespace: m.GetNamespace(), + SelfLink: m.GetSelfLink(), + UID: m.GetUID(), + ResourceVersion: m.GetResourceVersion(), + Generation: m.GetGeneration(), + CreationTimestamp: m.GetCreationTimestamp(), + DeletionTimestamp: m.GetDeletionTimestamp(), + DeletionGracePeriodSeconds: m.GetDeletionGracePeriodSeconds(), + Labels: m.GetLabels(), + Annotations: m.GetAnnotations(), + OwnerReferences: m.GetOwnerReferences(), + Finalizers: m.GetFinalizers(), + ManagedFields: m.GetManagedFields(), + }, + } + } +} + +// TypeAccessor returns an interface that allows retrieving and modifying the APIVersion +// and Kind of an in-memory internal object. +// TODO: this interface is used to test code that does not have ObjectMeta or ListMeta +// in round tripping (objects which can use apiVersion/kind, but do not fit the Kube +// api conventions). +func TypeAccessor(obj interface{}) (Type, error) { + if typed, ok := obj.(runtime.Object); ok { + return objectAccessor{typed}, nil + } + v, err := conversion.EnforcePtr(obj) + if err != nil { + return nil, err + } + t := v.Type() + if v.Kind() != reflect.Struct { + return nil, fmt.Errorf("expected struct, but got %v: %v (%#v)", v.Kind(), t, v.Interface()) + } + + typeMeta := v.FieldByName("TypeMeta") + if !typeMeta.IsValid() { + return nil, fmt.Errorf("struct %v lacks embedded TypeMeta type", t) + } + a := &genericAccessor{} + if err := extractFromTypeMeta(typeMeta, a); err != nil { + return nil, fmt.Errorf("unable to find type fields on %#v: %v", typeMeta, err) + } + return a, nil +} + +type objectAccessor struct { + runtime.Object +} + +func (obj objectAccessor) GetKind() string { + return obj.GetObjectKind().GroupVersionKind().Kind +} + +func (obj objectAccessor) SetKind(kind string) { + gvk := obj.GetObjectKind().GroupVersionKind() + gvk.Kind = kind + obj.GetObjectKind().SetGroupVersionKind(gvk) +} + +func (obj objectAccessor) GetAPIVersion() string { + return obj.GetObjectKind().GroupVersionKind().GroupVersion().String() +} + +func (obj objectAccessor) SetAPIVersion(version string) { + gvk := obj.GetObjectKind().GroupVersionKind() + gv, err := schema.ParseGroupVersion(version) + if err != nil { + gv = schema.GroupVersion{Version: version} + } + gvk.Group, gvk.Version = gv.Group, gv.Version + obj.GetObjectKind().SetGroupVersionKind(gvk) +} + +// NewAccessor returns a MetadataAccessor that can retrieve +// or manipulate resource version on objects derived from core API +// metadata concepts. +func NewAccessor() MetadataAccessor { + return resourceAccessor{} +} + +// resourceAccessor implements ResourceVersioner and SelfLinker. +type resourceAccessor struct{} + +func (resourceAccessor) Kind(obj runtime.Object) (string, error) { + return objectAccessor{obj}.GetKind(), nil +} + +func (resourceAccessor) SetKind(obj runtime.Object, kind string) error { + objectAccessor{obj}.SetKind(kind) + return nil +} + +func (resourceAccessor) APIVersion(obj runtime.Object) (string, error) { + return objectAccessor{obj}.GetAPIVersion(), nil +} + +func (resourceAccessor) SetAPIVersion(obj runtime.Object, version string) error { + objectAccessor{obj}.SetAPIVersion(version) + return nil +} + +func (resourceAccessor) Namespace(obj runtime.Object) (string, error) { + accessor, err := Accessor(obj) + if err != nil { + return "", err + } + return accessor.GetNamespace(), nil +} + +func (resourceAccessor) SetNamespace(obj runtime.Object, namespace string) error { + accessor, err := Accessor(obj) + if err != nil { + return err + } + accessor.SetNamespace(namespace) + return nil +} + +func (resourceAccessor) Name(obj runtime.Object) (string, error) { + accessor, err := Accessor(obj) + if err != nil { + return "", err + } + return accessor.GetName(), nil +} + +func (resourceAccessor) SetName(obj runtime.Object, name string) error { + accessor, err := Accessor(obj) + if err != nil { + return err + } + accessor.SetName(name) + return nil +} + +func (resourceAccessor) GenerateName(obj runtime.Object) (string, error) { + accessor, err := Accessor(obj) + if err != nil { + return "", err + } + return accessor.GetGenerateName(), nil +} + +func (resourceAccessor) SetGenerateName(obj runtime.Object, name string) error { + accessor, err := Accessor(obj) + if err != nil { + return err + } + accessor.SetGenerateName(name) + return nil +} + +func (resourceAccessor) UID(obj runtime.Object) (types.UID, error) { + accessor, err := Accessor(obj) + if err != nil { + return "", err + } + return accessor.GetUID(), nil +} + +func (resourceAccessor) SetUID(obj runtime.Object, uid types.UID) error { + accessor, err := Accessor(obj) + if err != nil { + return err + } + accessor.SetUID(uid) + return nil +} + +func (resourceAccessor) SelfLink(obj runtime.Object) (string, error) { + accessor, err := CommonAccessor(obj) + if err != nil { + return "", err + } + return accessor.GetSelfLink(), nil +} + +func (resourceAccessor) SetSelfLink(obj runtime.Object, selfLink string) error { + accessor, err := CommonAccessor(obj) + if err != nil { + return err + } + accessor.SetSelfLink(selfLink) + return nil +} + +func (resourceAccessor) Labels(obj runtime.Object) (map[string]string, error) { + accessor, err := Accessor(obj) + if err != nil { + return nil, err + } + return accessor.GetLabels(), nil +} + +func (resourceAccessor) SetLabels(obj runtime.Object, labels map[string]string) error { + accessor, err := Accessor(obj) + if err != nil { + return err + } + accessor.SetLabels(labels) + return nil +} + +func (resourceAccessor) Annotations(obj runtime.Object) (map[string]string, error) { + accessor, err := Accessor(obj) + if err != nil { + return nil, err + } + return accessor.GetAnnotations(), nil +} + +func (resourceAccessor) SetAnnotations(obj runtime.Object, annotations map[string]string) error { + accessor, err := Accessor(obj) + if err != nil { + return err + } + accessor.SetAnnotations(annotations) + return nil +} + +func (resourceAccessor) ResourceVersion(obj runtime.Object) (string, error) { + accessor, err := CommonAccessor(obj) + if err != nil { + return "", err + } + return accessor.GetResourceVersion(), nil +} + +func (resourceAccessor) SetResourceVersion(obj runtime.Object, version string) error { + accessor, err := CommonAccessor(obj) + if err != nil { + return err + } + accessor.SetResourceVersion(version) + return nil +} + +func (resourceAccessor) Continue(obj runtime.Object) (string, error) { + accessor, err := ListAccessor(obj) + if err != nil { + return "", err + } + return accessor.GetContinue(), nil +} + +func (resourceAccessor) SetContinue(obj runtime.Object, version string) error { + accessor, err := ListAccessor(obj) + if err != nil { + return err + } + accessor.SetContinue(version) + return nil +} + +// extractFromOwnerReference extracts v to o. v is the OwnerReferences field of an object. +func extractFromOwnerReference(v reflect.Value, o *metav1.OwnerReference) error { + if err := runtime.Field(v, "APIVersion", &o.APIVersion); err != nil { + return err + } + if err := runtime.Field(v, "Kind", &o.Kind); err != nil { + return err + } + if err := runtime.Field(v, "Name", &o.Name); err != nil { + return err + } + if err := runtime.Field(v, "UID", &o.UID); err != nil { + return err + } + var controllerPtr *bool + if err := runtime.Field(v, "Controller", &controllerPtr); err != nil { + return err + } + if controllerPtr != nil { + controller := *controllerPtr + o.Controller = &controller + } + var blockOwnerDeletionPtr *bool + if err := runtime.Field(v, "BlockOwnerDeletion", &blockOwnerDeletionPtr); err != nil { + return err + } + if blockOwnerDeletionPtr != nil { + block := *blockOwnerDeletionPtr + o.BlockOwnerDeletion = &block + } + return nil +} + +// setOwnerReference sets v to o. v is the OwnerReferences field of an object. +func setOwnerReference(v reflect.Value, o *metav1.OwnerReference) error { + if err := runtime.SetField(o.APIVersion, v, "APIVersion"); err != nil { + return err + } + if err := runtime.SetField(o.Kind, v, "Kind"); err != nil { + return err + } + if err := runtime.SetField(o.Name, v, "Name"); err != nil { + return err + } + if err := runtime.SetField(o.UID, v, "UID"); err != nil { + return err + } + if o.Controller != nil { + controller := *(o.Controller) + if err := runtime.SetField(&controller, v, "Controller"); err != nil { + return err + } + } + if o.BlockOwnerDeletion != nil { + block := *(o.BlockOwnerDeletion) + if err := runtime.SetField(&block, v, "BlockOwnerDeletion"); err != nil { + return err + } + } + return nil +} + +// genericAccessor contains pointers to strings that can modify an arbitrary +// struct and implements the Accessor interface. +type genericAccessor struct { + namespace *string + name *string + generateName *string + uid *types.UID + apiVersion *string + kind *string + resourceVersion *string + selfLink *string + creationTimestamp *metav1.Time + deletionTimestamp **metav1.Time + labels *map[string]string + annotations *map[string]string + ownerReferences reflect.Value + finalizers *[]string +} + +func (a genericAccessor) GetNamespace() string { + if a.namespace == nil { + return "" + } + return *a.namespace +} + +func (a genericAccessor) SetNamespace(namespace string) { + if a.namespace == nil { + return + } + *a.namespace = namespace +} + +func (a genericAccessor) GetName() string { + if a.name == nil { + return "" + } + return *a.name +} + +func (a genericAccessor) SetName(name string) { + if a.name == nil { + return + } + *a.name = name +} + +func (a genericAccessor) GetGenerateName() string { + if a.generateName == nil { + return "" + } + return *a.generateName +} + +func (a genericAccessor) SetGenerateName(generateName string) { + if a.generateName == nil { + return + } + *a.generateName = generateName +} + +func (a genericAccessor) GetUID() types.UID { + if a.uid == nil { + return "" + } + return *a.uid +} + +func (a genericAccessor) SetUID(uid types.UID) { + if a.uid == nil { + return + } + *a.uid = uid +} + +func (a genericAccessor) GetAPIVersion() string { + return *a.apiVersion +} + +func (a genericAccessor) SetAPIVersion(version string) { + *a.apiVersion = version +} + +func (a genericAccessor) GetKind() string { + return *a.kind +} + +func (a genericAccessor) SetKind(kind string) { + *a.kind = kind +} + +func (a genericAccessor) GetResourceVersion() string { + return *a.resourceVersion +} + +func (a genericAccessor) SetResourceVersion(version string) { + *a.resourceVersion = version +} + +func (a genericAccessor) GetSelfLink() string { + return *a.selfLink +} + +func (a genericAccessor) SetSelfLink(selfLink string) { + *a.selfLink = selfLink +} + +func (a genericAccessor) GetCreationTimestamp() metav1.Time { + return *a.creationTimestamp +} + +func (a genericAccessor) SetCreationTimestamp(timestamp metav1.Time) { + *a.creationTimestamp = timestamp +} + +func (a genericAccessor) GetDeletionTimestamp() *metav1.Time { + return *a.deletionTimestamp +} + +func (a genericAccessor) SetDeletionTimestamp(timestamp *metav1.Time) { + *a.deletionTimestamp = timestamp +} + +func (a genericAccessor) GetLabels() map[string]string { + if a.labels == nil { + return nil + } + return *a.labels +} + +func (a genericAccessor) SetLabels(labels map[string]string) { + *a.labels = labels +} + +func (a genericAccessor) GetAnnotations() map[string]string { + if a.annotations == nil { + return nil + } + return *a.annotations +} + +func (a genericAccessor) SetAnnotations(annotations map[string]string) { + if a.annotations == nil { + emptyAnnotations := make(map[string]string) + a.annotations = &emptyAnnotations + } + *a.annotations = annotations +} + +func (a genericAccessor) GetFinalizers() []string { + if a.finalizers == nil { + return nil + } + return *a.finalizers +} + +func (a genericAccessor) SetFinalizers(finalizers []string) { + *a.finalizers = finalizers +} + +func (a genericAccessor) GetOwnerReferences() []metav1.OwnerReference { + var ret []metav1.OwnerReference + s := a.ownerReferences + if s.Kind() != reflect.Pointer || s.Elem().Kind() != reflect.Slice { + klog.Errorf("expect %v to be a pointer to slice", s) + return ret + } + s = s.Elem() + // Set the capacity to one element greater to avoid copy if the caller later append an element. + ret = make([]metav1.OwnerReference, s.Len(), s.Len()+1) + for i := 0; i < s.Len(); i++ { + if err := extractFromOwnerReference(s.Index(i), &ret[i]); err != nil { + klog.Errorf("extractFromOwnerReference failed: %v", err) + return ret + } + } + return ret +} + +func (a genericAccessor) SetOwnerReferences(references []metav1.OwnerReference) { + s := a.ownerReferences + if s.Kind() != reflect.Pointer || s.Elem().Kind() != reflect.Slice { + klog.Errorf("expect %v to be a pointer to slice", s) + } + s = s.Elem() + newReferences := reflect.MakeSlice(s.Type(), len(references), len(references)) + for i := 0; i < len(references); i++ { + if err := setOwnerReference(newReferences.Index(i), &references[i]); err != nil { + klog.Errorf("setOwnerReference failed: %v", err) + return + } + } + s.Set(newReferences) +} + +// extractFromTypeMeta extracts pointers to version and kind fields from an object +func extractFromTypeMeta(v reflect.Value, a *genericAccessor) error { + if err := runtime.FieldPtr(v, "APIVersion", &a.apiVersion); err != nil { + return err + } + if err := runtime.FieldPtr(v, "Kind", &a.kind); err != nil { + return err + } + return nil +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/meta_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/meta_test.go new file mode 100644 index 00000000000..f3cf634f4df --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/meta_test.go @@ -0,0 +1,51 @@ +/* +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 meta + +import ( + "math/rand" + "reflect" + "testing" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" + + "github.com/google/go-cmp/cmp" + fuzz "github.com/google/gofuzz" +) + +func TestAsPartialObjectMetadata(t *testing.T) { + f := fuzz.New().NilChance(.5).NumElements(0, 1).RandSource(rand.NewSource(1)) + + for i := 0; i < 100; i++ { + m := &metav1.ObjectMeta{} + f.Fuzz(m) + partial := AsPartialObjectMetadata(m) + if !reflect.DeepEqual(&partial.ObjectMeta, m) { + t.Fatalf("incomplete partial object metadata: %s", cmp.Diff(&partial.ObjectMeta, m)) + } + } + + for i := 0; i < 100; i++ { + m := &metav1beta1.PartialObjectMetadata{} + f.Fuzz(&m.ObjectMeta) + partial := AsPartialObjectMetadata(m) + if !reflect.DeepEqual(&partial.ObjectMeta, &m.ObjectMeta) { + t.Fatalf("incomplete partial object metadata: %s", cmp.Diff(&partial.ObjectMeta, &m.ObjectMeta)) + } + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go new file mode 100644 index 00000000000..b7e97125052 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/multirestmapper.go @@ -0,0 +1,220 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "fmt" + "strings" + + "k8s.io/apimachinery/pkg/runtime/schema" + utilerrors "k8s.io/apimachinery/pkg/util/errors" +) + +var ( + _ ResettableRESTMapper = MultiRESTMapper{} +) + +// MultiRESTMapper is a wrapper for multiple RESTMappers. +type MultiRESTMapper []RESTMapper + +func (m MultiRESTMapper) String() string { + nested := make([]string, 0, len(m)) + for _, t := range m { + currString := fmt.Sprintf("%v", t) + splitStrings := strings.Split(currString, "\n") + nested = append(nested, strings.Join(splitStrings, "\n\t")) + } + + return fmt.Sprintf("MultiRESTMapper{\n\t%s\n}", strings.Join(nested, "\n\t")) +} + +// ResourceSingularizer converts a REST resource name from plural to singular (e.g., from pods to pod) +// This implementation supports multiple REST schemas and return the first match. +func (m MultiRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { + for _, t := range m { + singular, err = t.ResourceSingularizer(resource) + if err == nil { + return + } + } + return +} + +func (m MultiRESTMapper) ResourcesFor(resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + allGVRs := []schema.GroupVersionResource{} + for _, t := range m { + gvrs, err := t.ResourcesFor(resource) + // ignore "no match" errors, but any other error percolates back up + if IsNoMatchError(err) { + continue + } + if err != nil { + return nil, err + } + + // walk the existing values to de-dup + for _, curr := range gvrs { + found := false + for _, existing := range allGVRs { + if curr == existing { + found = true + break + } + } + + if !found { + allGVRs = append(allGVRs, curr) + } + } + } + + if len(allGVRs) == 0 { + return nil, &NoResourceMatchError{PartialResource: resource} + } + + return allGVRs, nil +} + +func (m MultiRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { + allGVKs := []schema.GroupVersionKind{} + for _, t := range m { + gvks, err := t.KindsFor(resource) + // ignore "no match" errors, but any other error percolates back up + if IsNoMatchError(err) { + continue + } + if err != nil { + return nil, err + } + + // walk the existing values to de-dup + for _, curr := range gvks { + found := false + for _, existing := range allGVKs { + if curr == existing { + found = true + break + } + } + + if !found { + allGVKs = append(allGVKs, curr) + } + } + } + + if len(allGVKs) == 0 { + return nil, &NoResourceMatchError{PartialResource: resource} + } + + return allGVKs, nil +} + +func (m MultiRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + resources, err := m.ResourcesFor(resource) + if err != nil { + return schema.GroupVersionResource{}, err + } + if len(resources) == 1 { + return resources[0], nil + } + + return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: resource, MatchingResources: resources} +} + +func (m MultiRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + kinds, err := m.KindsFor(resource) + if err != nil { + return schema.GroupVersionKind{}, err + } + if len(kinds) == 1 { + return kinds[0], nil + } + + return schema.GroupVersionKind{}, &AmbiguousResourceError{PartialResource: resource, MatchingKinds: kinds} +} + +// RESTMapping provides the REST mapping for the resource based on the +// kind and version. This implementation supports multiple REST schemas and +// return the first match. +func (m MultiRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + allMappings := []*RESTMapping{} + errors := []error{} + + for _, t := range m { + currMapping, err := t.RESTMapping(gk, versions...) + // ignore "no match" errors, but any other error percolates back up + if IsNoMatchError(err) { + continue + } + if err != nil { + errors = append(errors, err) + continue + } + + allMappings = append(allMappings, currMapping) + } + + // if we got exactly one mapping, then use it even if other requested failed + if len(allMappings) == 1 { + return allMappings[0], nil + } + if len(allMappings) > 1 { + var kinds []schema.GroupVersionKind + for _, m := range allMappings { + kinds = append(kinds, m.GroupVersionKind) + } + return nil, &AmbiguousKindError{PartialKind: gk.WithVersion(""), MatchingKinds: kinds} + } + if len(errors) > 0 { + return nil, utilerrors.NewAggregate(errors) + } + return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions} +} + +// RESTMappings returns all possible RESTMappings for the provided group kind, or an error +// if the type is not recognized. +func (m MultiRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + var allMappings []*RESTMapping + var errors []error + + for _, t := range m { + currMappings, err := t.RESTMappings(gk, versions...) + // ignore "no match" errors, but any other error percolates back up + if IsNoMatchError(err) { + continue + } + if err != nil { + errors = append(errors, err) + continue + } + allMappings = append(allMappings, currMappings...) + } + if len(errors) > 0 { + return nil, utilerrors.NewAggregate(errors) + } + if len(allMappings) == 0 { + return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions} + } + return allMappings, nil +} + +func (m MultiRESTMapper) Reset() { + for _, t := range m { + MaybeResetRESTMapper(t) + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/multirestmapper_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/multirestmapper_test.go new file mode 100644 index 00000000000..b71ca468d32 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/multirestmapper_test.go @@ -0,0 +1,391 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "errors" + "reflect" + "testing" + + "k8s.io/apimachinery/pkg/runtime/schema" +) + +func TestMultiRESTMapperResourceFor(t *testing.T) { + tcs := []struct { + name string + + mapper MultiRESTMapper + input schema.GroupVersionResource + result schema.GroupVersionResource + err error + }{ + { + name: "empty", + mapper: MultiRESTMapper{}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: schema.GroupVersionResource{}, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "ignore not found", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "IGNORE_THIS"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: schema.GroupVersionResource{}, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "accept first failure", + mapper: MultiRESTMapper{fixedRESTMapper{err: errors.New("fail on this")}, fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "unused"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: schema.GroupVersionResource{}, + err: errors.New("fail on this"), + }, + } + + for _, tc := range tcs { + actualResult, actualErr := tc.mapper.ResourceFor(tc.input) + if e, a := tc.result, actualResult; e != a { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + switch { + case tc.err == nil && actualErr == nil: + case tc.err == nil: + t.Errorf("%s: unexpected error: %v", tc.name, actualErr) + case actualErr == nil: + t.Errorf("%s: expected error: %v got nil", tc.name, tc.err) + case tc.err.Error() != actualErr.Error(): + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestMultiRESTMapperResourcesFor(t *testing.T) { + tcs := []struct { + name string + + mapper MultiRESTMapper + input schema.GroupVersionResource + result []schema.GroupVersionResource + err error + }{ + { + name: "empty", + mapper: MultiRESTMapper{}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: nil, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "ignore not found", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "IGNORE_THIS"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: nil, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "accept first failure", + mapper: MultiRESTMapper{fixedRESTMapper{err: errors.New("fail on this")}, fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "unused"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: nil, + err: errors.New("fail on this"), + }, + { + name: "union and dedup", + mapper: MultiRESTMapper{ + fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "dupe"}, {Resource: "first"}}}, + fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "dupe"}, {Resource: "second"}}}, + }, + input: schema.GroupVersionResource{Resource: "foo"}, + result: []schema.GroupVersionResource{{Resource: "dupe"}, {Resource: "first"}, {Resource: "second"}}, + }, + { + name: "skip not and continue", + mapper: MultiRESTMapper{ + fixedRESTMapper{err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "IGNORE_THIS"}}}, + fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "first"}, {Resource: "second"}}}, + }, + input: schema.GroupVersionResource{Resource: "foo"}, + result: []schema.GroupVersionResource{{Resource: "first"}, {Resource: "second"}}, + }, + } + + for _, tc := range tcs { + actualResult, actualErr := tc.mapper.ResourcesFor(tc.input) + if e, a := tc.result, actualResult; !reflect.DeepEqual(e, a) { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + switch { + case tc.err == nil && actualErr == nil: + case tc.err == nil: + t.Errorf("%s: unexpected error: %v", tc.name, actualErr) + case actualErr == nil: + t.Errorf("%s: expected error: %v got nil", tc.name, tc.err) + case tc.err.Error() != actualErr.Error(): + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestMultiRESTMapperKindsFor(t *testing.T) { + tcs := []struct { + name string + + mapper MultiRESTMapper + input schema.GroupVersionResource + result []schema.GroupVersionKind + err error + }{ + { + name: "empty", + mapper: MultiRESTMapper{}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: nil, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "ignore not found", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "IGNORE_THIS"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: nil, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "accept first failure", + mapper: MultiRESTMapper{fixedRESTMapper{err: errors.New("fail on this")}, fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "unused"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: nil, + err: errors.New("fail on this"), + }, + { + name: "union and dedup", + mapper: MultiRESTMapper{ + fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "dupe"}, {Kind: "first"}}}, + fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "dupe"}, {Kind: "second"}}}, + }, + input: schema.GroupVersionResource{Resource: "foo"}, + result: []schema.GroupVersionKind{{Kind: "dupe"}, {Kind: "first"}, {Kind: "second"}}, + }, + { + name: "skip not and continue", + mapper: MultiRESTMapper{ + fixedRESTMapper{err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "IGNORE_THIS"}}}, + fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "first"}, {Kind: "second"}}}, + }, + input: schema.GroupVersionResource{Resource: "foo"}, + result: []schema.GroupVersionKind{{Kind: "first"}, {Kind: "second"}}, + }, + } + + for _, tc := range tcs { + actualResult, actualErr := tc.mapper.KindsFor(tc.input) + if e, a := tc.result, actualResult; !reflect.DeepEqual(e, a) { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + switch { + case tc.err == nil && actualErr == nil: + case tc.err == nil: + t.Errorf("%s: unexpected error: %v", tc.name, actualErr) + case actualErr == nil: + t.Errorf("%s: expected error: %v got nil", tc.name, tc.err) + case tc.err.Error() != actualErr.Error(): + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestMultiRESTMapperKindFor(t *testing.T) { + tcs := []struct { + name string + + mapper MultiRESTMapper + input schema.GroupVersionResource + result schema.GroupVersionKind + err error + }{ + { + name: "empty", + mapper: MultiRESTMapper{}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: schema.GroupVersionKind{}, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "ignore not found", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "IGNORE_THIS"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: schema.GroupVersionKind{}, + err: &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Resource: "foo"}}, + }, + { + name: "accept first failure", + mapper: MultiRESTMapper{fixedRESTMapper{err: errors.New("fail on this")}, fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "unused"}}}}, + input: schema.GroupVersionResource{Resource: "foo"}, + result: schema.GroupVersionKind{}, + err: errors.New("fail on this"), + }, + } + + for _, tc := range tcs { + actualResult, actualErr := tc.mapper.KindFor(tc.input) + if e, a := tc.result, actualResult; e != a { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + switch { + case tc.err == nil && actualErr == nil: + case tc.err == nil: + t.Errorf("%s: unexpected error: %v", tc.name, actualErr) + case actualErr == nil: + t.Errorf("%s: expected error: %v got nil", tc.name, tc.err) + case tc.err.Error() != actualErr.Error(): + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestMultiRESTMapperRESTMappings(t *testing.T) { + mapping1, mapping2 := &RESTMapping{}, &RESTMapping{} + tcs := []struct { + name string + + mapper MultiRESTMapper + groupKind schema.GroupKind + versions []string + result []*RESTMapping + err error + }{ + { + name: "empty with no versions", + mapper: MultiRESTMapper{}, + groupKind: schema.GroupKind{Kind: "Foo"}, + result: nil, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}}, + }, + { + name: "empty with one version", + mapper: MultiRESTMapper{}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: []string{"v1beta"}, + result: nil, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1beta"}}, + }, + { + name: "empty with multi(two) vesions", + mapper: MultiRESTMapper{}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: []string{"v1beta", "v2"}, + result: nil, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1beta", "v2"}}, + }, + { + name: "ignore not found with kind not exist", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "IGNORE_THIS"}}}}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: nil, + result: nil, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}}, + }, + { + name: "ignore not found with version not exist", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1"}}}}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: []string{"v1beta"}, + result: nil, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1beta"}}, + }, + { + name: "ignore not found with multi versions not exist", + mapper: MultiRESTMapper{fixedRESTMapper{err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1"}}}}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: []string{"v1beta", "v2"}, + result: nil, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}, SearchedVersions: []string{"v1beta", "v2"}}, + }, + { + name: "accept first failure", + mapper: MultiRESTMapper{fixedRESTMapper{err: errors.New("fail on this")}, fixedRESTMapper{mappings: []*RESTMapping{mapping1}}}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: []string{"v1beta"}, + result: nil, + err: errors.New("fail on this"), + }, + { + name: "return both", + mapper: MultiRESTMapper{fixedRESTMapper{mappings: []*RESTMapping{mapping1}}, fixedRESTMapper{mappings: []*RESTMapping{mapping2}}}, + groupKind: schema.GroupKind{Kind: "Foo"}, + versions: []string{"v1beta"}, + result: []*RESTMapping{mapping1, mapping2}, + }, + } + + for _, tc := range tcs { + actualResult, actualErr := tc.mapper.RESTMappings(tc.groupKind, tc.versions...) + if e, a := tc.result, actualResult; !reflect.DeepEqual(e, a) { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + switch { + case tc.err == nil && actualErr == nil: + case tc.err == nil: + t.Errorf("%s: unexpected error: %v", tc.name, actualErr) + case actualErr == nil: + t.Errorf("%s: expected error: %v got nil", tc.name, tc.err) + case tc.err.Error() != actualErr.Error(): + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +type fixedRESTMapper struct { + resourcesFor []schema.GroupVersionResource + kindsFor []schema.GroupVersionKind + resourceFor schema.GroupVersionResource + kindFor schema.GroupVersionKind + mappings []*RESTMapping + + err error +} + +func (m fixedRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { + return "", m.err +} + +func (m fixedRESTMapper) ResourcesFor(resource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return m.resourcesFor, m.err +} + +func (m fixedRESTMapper) KindsFor(resource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { + return m.kindsFor, m.err +} + +func (m fixedRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + return m.resourceFor, m.err +} + +func (m fixedRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + return m.kindFor, m.err +} + +func (m fixedRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (mapping *RESTMapping, err error) { + return nil, m.err +} + +func (m fixedRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) (mappings []*RESTMapping, err error) { + return m.mappings, m.err +} + +func (m fixedRESTMapper) ResourceIsValid(resource schema.GroupVersionResource) bool { + return false +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/priority.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/priority.go new file mode 100644 index 00000000000..4f097c9c90d --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/priority.go @@ -0,0 +1,230 @@ +/* +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 meta + +import ( + "fmt" + + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + AnyGroup = "*" + AnyVersion = "*" + AnyResource = "*" + AnyKind = "*" +) + +var ( + _ ResettableRESTMapper = PriorityRESTMapper{} +) + +// PriorityRESTMapper is a wrapper for automatically choosing a particular Resource or Kind +// when multiple matches are possible +type PriorityRESTMapper struct { + // Delegate is the RESTMapper to use to locate all the Kind and Resource matches + Delegate RESTMapper + + // ResourcePriority is a list of priority patterns to apply to matching resources. + // The list of all matching resources is narrowed based on the patterns until only one remains. + // A pattern with no matches is skipped. A pattern with more than one match uses its + // matches as the list to continue matching against. + ResourcePriority []schema.GroupVersionResource + + // KindPriority is a list of priority patterns to apply to matching kinds. + // The list of all matching kinds is narrowed based on the patterns until only one remains. + // A pattern with no matches is skipped. A pattern with more than one match uses its + // matches as the list to continue matching against. + KindPriority []schema.GroupVersionKind +} + +func (m PriorityRESTMapper) String() string { + return fmt.Sprintf("PriorityRESTMapper{\n\t%v\n\t%v\n\t%v\n}", m.ResourcePriority, m.KindPriority, m.Delegate) +} + +// ResourceFor finds all resources, then passes them through the ResourcePriority patterns to find a single matching hit. +func (m PriorityRESTMapper) ResourceFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + originalGVRs, originalErr := m.Delegate.ResourcesFor(partiallySpecifiedResource) + if originalErr != nil && len(originalGVRs) == 0 { + return schema.GroupVersionResource{}, originalErr + } + if len(originalGVRs) == 1 { + return originalGVRs[0], originalErr + } + + remainingGVRs := append([]schema.GroupVersionResource{}, originalGVRs...) + for _, pattern := range m.ResourcePriority { + matchedGVRs := []schema.GroupVersionResource{} + for _, gvr := range remainingGVRs { + if resourceMatches(pattern, gvr) { + matchedGVRs = append(matchedGVRs, gvr) + } + } + + switch len(matchedGVRs) { + case 0: + // if you have no matches, then nothing matched this pattern just move to the next + continue + case 1: + // one match, return + return matchedGVRs[0], originalErr + default: + // more than one match, use the matched hits as the list moving to the next pattern. + // this way you can have a series of selection criteria + remainingGVRs = matchedGVRs + } + } + + return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: partiallySpecifiedResource, MatchingResources: originalGVRs} +} + +// KindFor finds all kinds, then passes them through the KindPriority patterns to find a single matching hit. +func (m PriorityRESTMapper) KindFor(partiallySpecifiedResource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + originalGVKs, originalErr := m.Delegate.KindsFor(partiallySpecifiedResource) + if originalErr != nil && len(originalGVKs) == 0 { + return schema.GroupVersionKind{}, originalErr + } + if len(originalGVKs) == 1 { + return originalGVKs[0], originalErr + } + + remainingGVKs := append([]schema.GroupVersionKind{}, originalGVKs...) + for _, pattern := range m.KindPriority { + matchedGVKs := []schema.GroupVersionKind{} + for _, gvr := range remainingGVKs { + if kindMatches(pattern, gvr) { + matchedGVKs = append(matchedGVKs, gvr) + } + } + + switch len(matchedGVKs) { + case 0: + // if you have no matches, then nothing matched this pattern just move to the next + continue + case 1: + // one match, return + return matchedGVKs[0], originalErr + default: + // more than one match, use the matched hits as the list moving to the next pattern. + // this way you can have a series of selection criteria + remainingGVKs = matchedGVKs + } + } + + return schema.GroupVersionKind{}, &AmbiguousResourceError{PartialResource: partiallySpecifiedResource, MatchingKinds: originalGVKs} +} + +func resourceMatches(pattern schema.GroupVersionResource, resource schema.GroupVersionResource) bool { + if pattern.Group != AnyGroup && pattern.Group != resource.Group { + return false + } + if pattern.Version != AnyVersion && pattern.Version != resource.Version { + return false + } + if pattern.Resource != AnyResource && pattern.Resource != resource.Resource { + return false + } + + return true +} + +func kindMatches(pattern schema.GroupVersionKind, kind schema.GroupVersionKind) bool { + if pattern.Group != AnyGroup && pattern.Group != kind.Group { + return false + } + if pattern.Version != AnyVersion && pattern.Version != kind.Version { + return false + } + if pattern.Kind != AnyKind && pattern.Kind != kind.Kind { + return false + } + + return true +} + +func (m PriorityRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (mapping *RESTMapping, err error) { + mappings, originalErr := m.Delegate.RESTMappings(gk, versions...) + if originalErr != nil && len(mappings) == 0 { + return nil, originalErr + } + + // any versions the user provides take priority + priorities := m.KindPriority + if len(versions) > 0 { + priorities = make([]schema.GroupVersionKind, 0, len(m.KindPriority)+len(versions)) + for _, version := range versions { + gv := schema.GroupVersion{ + Version: version, + Group: gk.Group, + } + priorities = append(priorities, gv.WithKind(AnyKind)) + } + priorities = append(priorities, m.KindPriority...) + } + + remaining := append([]*RESTMapping{}, mappings...) + for _, pattern := range priorities { + var matching []*RESTMapping + for _, m := range remaining { + if kindMatches(pattern, m.GroupVersionKind) { + matching = append(matching, m) + } + } + + switch len(matching) { + case 0: + // if you have no matches, then nothing matched this pattern just move to the next + continue + case 1: + // one match, return + return matching[0], originalErr + default: + // more than one match, use the matched hits as the list moving to the next pattern. + // this way you can have a series of selection criteria + remaining = matching + } + } + if len(remaining) == 1 { + return remaining[0], originalErr + } + + var kinds []schema.GroupVersionKind + for _, m := range mappings { + kinds = append(kinds, m.GroupVersionKind) + } + return nil, &AmbiguousKindError{PartialKind: gk.WithVersion(""), MatchingKinds: kinds} +} + +func (m PriorityRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + return m.Delegate.RESTMappings(gk, versions...) +} + +func (m PriorityRESTMapper) ResourceSingularizer(resource string) (singular string, err error) { + return m.Delegate.ResourceSingularizer(resource) +} + +func (m PriorityRESTMapper) ResourcesFor(partiallySpecifiedResource schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + return m.Delegate.ResourcesFor(partiallySpecifiedResource) +} + +func (m PriorityRESTMapper) KindsFor(partiallySpecifiedResource schema.GroupVersionResource) (gvk []schema.GroupVersionKind, err error) { + return m.Delegate.KindsFor(partiallySpecifiedResource) +} + +func (m PriorityRESTMapper) Reset() { + MaybeResetRESTMapper(m.Delegate) +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/priority_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/priority_test.go new file mode 100644 index 00000000000..fff1afd172e --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/priority_test.go @@ -0,0 +1,409 @@ +/* +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 meta + +import ( + "errors" + "reflect" + "strings" + "testing" + + "k8s.io/apimachinery/pkg/runtime/schema" +) + +func TestPriorityRESTMapperResourceForErrorHandling(t *testing.T) { + tcs := []struct { + name string + + delegate RESTMapper + resourcePatterns []schema.GroupVersionResource + result schema.GroupVersionResource + err string + }{ + { + name: "error", + delegate: fixedRESTMapper{err: errors.New("delegateError")}, + err: "delegateError", + }, + { + name: "single hit + error", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "single-hit"}}, err: errors.New("delegateError")}, + result: schema.GroupVersionResource{Resource: "single-hit"}, + err: "delegateError", + }, + { + name: "group selection + error", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{ + {Group: "one", Version: "a", Resource: "first"}, + {Group: "two", Version: "b", Resource: "second"}, + }, err: errors.New("delegateError")}, + resourcePatterns: []schema.GroupVersionResource{ + {Group: "one", Version: AnyVersion, Resource: AnyResource}, + }, + result: schema.GroupVersionResource{Group: "one", Version: "a", Resource: "first"}, + err: "delegateError", + }, + + { + name: "single hit", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{{Resource: "single-hit"}}}, + result: schema.GroupVersionResource{Resource: "single-hit"}, + }, + { + name: "ambiguous match", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{ + {Group: "one", Version: "a", Resource: "first"}, + {Group: "two", Version: "b", Resource: "second"}, + }}, + err: "matches multiple resources", + }, + { + name: "group selection", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{ + {Group: "one", Version: "a", Resource: "first"}, + {Group: "two", Version: "b", Resource: "second"}, + }}, + resourcePatterns: []schema.GroupVersionResource{ + {Group: "one", Version: AnyVersion, Resource: AnyResource}, + }, + result: schema.GroupVersionResource{Group: "one", Version: "a", Resource: "first"}, + }, + { + name: "empty match continues", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{ + {Group: "one", Version: "a", Resource: "first"}, + {Group: "two", Version: "b", Resource: "second"}, + }}, + resourcePatterns: []schema.GroupVersionResource{ + {Group: "fail", Version: AnyVersion, Resource: AnyResource}, + {Group: "one", Version: AnyVersion, Resource: AnyResource}, + }, + result: schema.GroupVersionResource{Group: "one", Version: "a", Resource: "first"}, + }, + { + name: "group followed by version selection", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{ + {Group: "one", Version: "a", Resource: "first"}, + {Group: "two", Version: "b", Resource: "second"}, + {Group: "one", Version: "c", Resource: "third"}, + }}, + resourcePatterns: []schema.GroupVersionResource{ + {Group: "one", Version: AnyVersion, Resource: AnyResource}, + {Group: AnyGroup, Version: "a", Resource: AnyResource}, + }, + result: schema.GroupVersionResource{Group: "one", Version: "a", Resource: "first"}, + }, + { + name: "resource selection", + delegate: fixedRESTMapper{resourcesFor: []schema.GroupVersionResource{ + {Group: "one", Version: "a", Resource: "first"}, + {Group: "one", Version: "a", Resource: "second"}, + }}, + resourcePatterns: []schema.GroupVersionResource{ + {Group: AnyGroup, Version: AnyVersion, Resource: "second"}, + }, + result: schema.GroupVersionResource{Group: "one", Version: "a", Resource: "second"}, + }, + } + + for _, tc := range tcs { + mapper := PriorityRESTMapper{Delegate: tc.delegate, ResourcePriority: tc.resourcePatterns} + + actualResult, actualErr := mapper.ResourceFor(schema.GroupVersionResource{}) + if e, a := tc.result, actualResult; e != a { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + if len(tc.err) == 0 && actualErr == nil { + continue + } + if len(tc.err) == 0 && actualErr != nil { + t.Errorf("%s: unexpected err: %v", tc.name, actualErr) + continue + } + if len(tc.err) > 0 && actualErr == nil { + t.Errorf("%s: missing expected err: %v", tc.name, tc.err) + continue + } + if !strings.Contains(actualErr.Error(), tc.err) { + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestPriorityRESTMapperKindForErrorHandling(t *testing.T) { + tcs := []struct { + name string + + delegate RESTMapper + kindPatterns []schema.GroupVersionKind + result schema.GroupVersionKind + err string + }{ + { + name: "error", + delegate: fixedRESTMapper{err: errors.New("delegateErr")}, + err: "delegateErr", + }, + { + name: "single hit + error", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "single-hit"}}, err: errors.New("delegateErr")}, + result: schema.GroupVersionKind{Kind: "single-hit"}, + err: "delegateErr", + }, + { + name: "group selection + error", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{ + {Group: "one", Version: "a", Kind: "first"}, + {Group: "two", Version: "b", Kind: "second"}, + }, err: errors.New("delegateErr")}, + kindPatterns: []schema.GroupVersionKind{ + {Group: "one", Version: AnyVersion, Kind: AnyKind}, + }, + result: schema.GroupVersionKind{Group: "one", Version: "a", Kind: "first"}, + err: "delegateErr", + }, + + { + name: "single hit", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{{Kind: "single-hit"}}}, + result: schema.GroupVersionKind{Kind: "single-hit"}, + }, + { + name: "ambiguous match", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{ + {Group: "one", Version: "a", Kind: "first"}, + {Group: "two", Version: "b", Kind: "second"}, + }}, + err: "matches multiple kinds", + }, + { + name: "group selection", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{ + {Group: "one", Version: "a", Kind: "first"}, + {Group: "two", Version: "b", Kind: "second"}, + }}, + kindPatterns: []schema.GroupVersionKind{ + {Group: "one", Version: AnyVersion, Kind: AnyKind}, + }, + result: schema.GroupVersionKind{Group: "one", Version: "a", Kind: "first"}, + }, + { + name: "empty match continues", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{ + {Group: "one", Version: "a", Kind: "first"}, + {Group: "two", Version: "b", Kind: "second"}, + }}, + kindPatterns: []schema.GroupVersionKind{ + {Group: "fail", Version: AnyVersion, Kind: AnyKind}, + {Group: "one", Version: AnyVersion, Kind: AnyKind}, + }, + result: schema.GroupVersionKind{Group: "one", Version: "a", Kind: "first"}, + }, + { + name: "group followed by version selection", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{ + {Group: "one", Version: "a", Kind: "first"}, + {Group: "two", Version: "b", Kind: "second"}, + {Group: "one", Version: "c", Kind: "third"}, + }}, + kindPatterns: []schema.GroupVersionKind{ + {Group: "one", Version: AnyVersion, Kind: AnyKind}, + {Group: AnyGroup, Version: "a", Kind: AnyKind}, + }, + result: schema.GroupVersionKind{Group: "one", Version: "a", Kind: "first"}, + }, + { + name: "kind selection", + delegate: fixedRESTMapper{kindsFor: []schema.GroupVersionKind{ + {Group: "one", Version: "a", Kind: "first"}, + {Group: "one", Version: "a", Kind: "second"}, + }}, + kindPatterns: []schema.GroupVersionKind{ + {Group: AnyGroup, Version: AnyVersion, Kind: "second"}, + }, + result: schema.GroupVersionKind{Group: "one", Version: "a", Kind: "second"}, + }, + } + + for _, tc := range tcs { + mapper := PriorityRESTMapper{Delegate: tc.delegate, KindPriority: tc.kindPatterns} + + actualResult, actualErr := mapper.KindFor(schema.GroupVersionResource{}) + if e, a := tc.result, actualResult; e != a { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + if len(tc.err) == 0 && actualErr == nil { + continue + } + if len(tc.err) == 0 && actualErr != nil { + t.Errorf("%s: unexpected err: %v", tc.name, actualErr) + continue + } + if len(tc.err) > 0 && actualErr == nil { + t.Errorf("%s: missing expected err: %v", tc.name, tc.err) + continue + } + if !strings.Contains(actualErr.Error(), tc.err) { + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestPriorityRESTMapperRESTMapping(t *testing.T) { + mapping1 := &RESTMapping{ + GroupVersionKind: schema.GroupVersionKind{Kind: "Foo", Version: "v1alpha1"}, + } + mapping2 := &RESTMapping{ + GroupVersionKind: schema.GroupVersionKind{Kind: "Foo", Version: "v1"}, + } + mapping3 := &RESTMapping{ + GroupVersionKind: schema.GroupVersionKind{Group: "other", Kind: "Foo", Version: "v1"}, + } + allMappers := MultiRESTMapper{ + fixedRESTMapper{mappings: []*RESTMapping{mapping1}}, + fixedRESTMapper{mappings: []*RESTMapping{mapping2}}, + fixedRESTMapper{mappings: []*RESTMapping{mapping3}}, + } + tcs := []struct { + name string + + mapper PriorityRESTMapper + input schema.GroupKind + result *RESTMapping + err error + }{ + { + name: "empty", + mapper: PriorityRESTMapper{Delegate: MultiRESTMapper{}}, + input: schema.GroupKind{Kind: "Foo"}, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}}, + }, + { + name: "ignore not found", + mapper: PriorityRESTMapper{Delegate: MultiRESTMapper{fixedRESTMapper{err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "IGNORE_THIS"}}}}}, + input: schema.GroupKind{Kind: "Foo"}, + err: &NoKindMatchError{GroupKind: schema.GroupKind{Kind: "Foo"}}, + }, + { + name: "accept first failure", + mapper: PriorityRESTMapper{Delegate: MultiRESTMapper{fixedRESTMapper{err: errors.New("fail on this")}, fixedRESTMapper{mappings: []*RESTMapping{mapping1}}}}, + input: schema.GroupKind{Kind: "Foo"}, + err: errors.New("fail on this"), + }, + { + name: "result + error", + mapper: PriorityRESTMapper{Delegate: fixedRESTMapper{mappings: []*RESTMapping{mapping1}, err: errors.New("fail on this")}}, + input: schema.GroupKind{Kind: "Foo"}, + result: mapping1, + err: errors.New("fail on this"), + }, + { + name: "return error for ambiguous", + mapper: PriorityRESTMapper{ + Delegate: allMappers, + }, + input: schema.GroupKind{Kind: "Foo"}, + err: &AmbiguousKindError{ + PartialKind: schema.GroupVersionKind{Kind: "Foo"}, + MatchingKinds: []schema.GroupVersionKind{ + {Kind: "Foo", Version: "v1alpha1"}, + {Kind: "Foo", Version: "v1"}, + {Group: "other", Kind: "Foo", Version: "v1"}, + }, + }, + }, + { + name: "accept only item", + mapper: PriorityRESTMapper{ + Delegate: fixedRESTMapper{mappings: []*RESTMapping{mapping1}}, + }, + input: schema.GroupKind{Kind: "Foo"}, + result: mapping1, + }, + { + name: "return single priority", + mapper: PriorityRESTMapper{ + Delegate: allMappers, + KindPriority: []schema.GroupVersionKind{{Version: "v1", Kind: AnyKind}, {Version: "v1alpha1", Kind: AnyKind}}, + }, + input: schema.GroupKind{Kind: "Foo"}, + result: mapping2, + }, + { + name: "return out of group match", + mapper: PriorityRESTMapper{ + Delegate: allMappers, + KindPriority: []schema.GroupVersionKind{{Group: AnyGroup, Version: "v1", Kind: AnyKind}, {Group: "other", Version: AnyVersion, Kind: AnyKind}}, + }, + input: schema.GroupKind{Kind: "Foo"}, + result: mapping3, + }, + } + + for _, tc := range tcs { + actualResult, actualErr := tc.mapper.RESTMapping(tc.input) + if e, a := tc.result, actualResult; !reflect.DeepEqual(e, a) { + t.Errorf("%s: expected %v, got %v", tc.name, e, a) + } + switch { + case tc.err == nil && actualErr == nil: + case tc.err == nil: + t.Errorf("%s: unexpected error: %v", tc.name, actualErr) + case actualErr == nil: + t.Errorf("%s: expected error: %v got nil", tc.name, tc.err) + case tc.err.Error() != actualErr.Error(): + t.Errorf("%s: expected %v, got %v", tc.name, tc.err, actualErr) + } + } +} + +func TestPriorityRESTMapperRESTMappingHonorsUserVersion(t *testing.T) { + mappingV2alpha1 := &RESTMapping{ + GroupVersionKind: schema.GroupVersionKind{Group: "Bar", Kind: "Foo", Version: "v2alpha1"}, + } + mappingV1 := &RESTMapping{ + GroupVersionKind: schema.GroupVersionKind{Group: "Bar", Kind: "Foo", Version: "v1"}, + } + + allMappers := MultiRESTMapper{ + fixedRESTMapper{mappings: []*RESTMapping{mappingV2alpha1}}, + fixedRESTMapper{mappings: []*RESTMapping{mappingV1}}, + } + + mapper := PriorityRESTMapper{ + Delegate: allMappers, + KindPriority: []schema.GroupVersionKind{{Group: "Bar", Version: "v2alpha1", Kind: AnyKind}, {Group: "Bar", Version: AnyVersion, Kind: AnyKind}}, + } + + outMapping1, err := mapper.RESTMapping(schema.GroupKind{Group: "Bar", Kind: "Foo"}, "v1") + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + if outMapping1 != mappingV1 { + t.Errorf("asked for version %v, expected mapping for %v, got mapping for %v", "v1", mappingV1.GroupVersionKind, outMapping1.GroupVersionKind) + } + + outMapping2, err := mapper.RESTMapping(schema.GroupKind{Group: "Bar", Kind: "Foo"}, "v2alpha1") + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + if outMapping2 != mappingV2alpha1 { + t.Errorf("asked for version %v, expected mapping for %v, got mapping for %v", "v2alpha1", mappingV2alpha1.GroupVersionKind, outMapping2.GroupVersionKind) + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/restmapper.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/restmapper.go new file mode 100644 index 00000000000..91cb98cae4c --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/restmapper.go @@ -0,0 +1,529 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// TODO: move everything in this file to pkg/api/rest +package meta + +import ( + "fmt" + "sort" + "strings" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +// Implements RESTScope interface +type restScope struct { + name RESTScopeName +} + +func (r *restScope) Name() RESTScopeName { + return r.name +} + +var RESTScopeNamespace = &restScope{ + name: RESTScopeNameNamespace, +} + +var RESTScopeRoot = &restScope{ + name: RESTScopeNameRoot, +} + +// DefaultRESTMapper exposes mappings between the types defined in a +// runtime.Scheme. It assumes that all types defined the provided scheme +// can be mapped with the provided MetadataAccessor and Codec interfaces. +// +// The resource name of a Kind is defined as the lowercase, +// English-plural version of the Kind string. +// When converting from resource to Kind, the singular version of the +// resource name is also accepted for convenience. +// +// TODO: Only accept plural for some operations for increased control? +// (`get pod bar` vs `get pods bar`) +type DefaultRESTMapper struct { + defaultGroupVersions []schema.GroupVersion + + resourceToKind map[schema.GroupVersionResource]schema.GroupVersionKind + kindToPluralResource map[schema.GroupVersionKind]schema.GroupVersionResource + kindToScope map[schema.GroupVersionKind]RESTScope + singularToPlural map[schema.GroupVersionResource]schema.GroupVersionResource + pluralToSingular map[schema.GroupVersionResource]schema.GroupVersionResource +} + +func (m *DefaultRESTMapper) String() string { + if m == nil { + return "" + } + return fmt.Sprintf("DefaultRESTMapper{kindToPluralResource=%v}", m.kindToPluralResource) +} + +var _ RESTMapper = &DefaultRESTMapper{} + +// NewDefaultRESTMapper initializes a mapping between Kind and APIVersion +// to a resource name and back based on the objects in a runtime.Scheme +// and the Kubernetes API conventions. Takes a group name, a priority list of the versions +// to search when an object has no default version (set empty to return an error), +// and a function that retrieves the correct metadata for a given version. +func NewDefaultRESTMapper(defaultGroupVersions []schema.GroupVersion) *DefaultRESTMapper { + resourceToKind := make(map[schema.GroupVersionResource]schema.GroupVersionKind) + kindToPluralResource := make(map[schema.GroupVersionKind]schema.GroupVersionResource) + kindToScope := make(map[schema.GroupVersionKind]RESTScope) + singularToPlural := make(map[schema.GroupVersionResource]schema.GroupVersionResource) + pluralToSingular := make(map[schema.GroupVersionResource]schema.GroupVersionResource) + // TODO: verify name mappings work correctly when versions differ + + return &DefaultRESTMapper{ + resourceToKind: resourceToKind, + kindToPluralResource: kindToPluralResource, + kindToScope: kindToScope, + defaultGroupVersions: defaultGroupVersions, + singularToPlural: singularToPlural, + pluralToSingular: pluralToSingular, + } +} + +func (m *DefaultRESTMapper) Add(kind schema.GroupVersionKind, scope RESTScope) { + plural, singular := UnsafeGuessKindToResource(kind) + m.AddSpecific(kind, plural, singular, scope) +} + +func (m *DefaultRESTMapper) AddSpecific(kind schema.GroupVersionKind, plural, singular schema.GroupVersionResource, scope RESTScope) { + m.singularToPlural[singular] = plural + m.pluralToSingular[plural] = singular + + m.resourceToKind[singular] = kind + m.resourceToKind[plural] = kind + + m.kindToPluralResource[kind] = plural + m.kindToScope[kind] = scope +} + +// unpluralizedSuffixes is a list of resource suffixes that are the same plural and singular +// This is only is only necessary because some bits of code are lazy and don't actually use the RESTMapper like they should. +// TODO eliminate this so that different callers can correctly map to resources. This probably means updating all +// callers to use the RESTMapper they mean. +var unpluralizedSuffixes = []string{ + "endpoints", +} + +// UnsafeGuessKindToResource converts Kind to a resource name. +// Broken. This method only "sort of" works when used outside of this package. It assumes that Kinds and Resources match +// and they aren't guaranteed to do so. +func UnsafeGuessKindToResource(kind schema.GroupVersionKind) ( /*plural*/ schema.GroupVersionResource /*singular*/, schema.GroupVersionResource) { + kindName := kind.Kind + if len(kindName) == 0 { + return schema.GroupVersionResource{}, schema.GroupVersionResource{} + } + singularName := strings.ToLower(kindName) + singular := kind.GroupVersion().WithResource(singularName) + + for _, skip := range unpluralizedSuffixes { + if strings.HasSuffix(singularName, skip) { + return singular, singular + } + } + + switch string(singularName[len(singularName)-1]) { + case "s": + return kind.GroupVersion().WithResource(singularName + "es"), singular + case "y": + return kind.GroupVersion().WithResource(strings.TrimSuffix(singularName, "y") + "ies"), singular + } + + return kind.GroupVersion().WithResource(singularName + "s"), singular +} + +// ResourceSingularizer implements RESTMapper +// It converts a resource name from plural to singular (e.g., from pods to pod) +func (m *DefaultRESTMapper) ResourceSingularizer(resourceType string) (string, error) { + partialResource := schema.GroupVersionResource{Resource: resourceType} + resources, err := m.ResourcesFor(partialResource) + if err != nil { + return resourceType, err + } + + singular := schema.GroupVersionResource{} + for _, curr := range resources { + currSingular, ok := m.pluralToSingular[curr] + if !ok { + continue + } + if singular.Empty() { + singular = currSingular + continue + } + + if currSingular.Resource != singular.Resource { + return resourceType, fmt.Errorf("multiple possible singular resources (%v) found for %v", resources, resourceType) + } + } + + if singular.Empty() { + return resourceType, fmt.Errorf("no singular of resource %v has been defined", resourceType) + } + + return singular.Resource, nil +} + +// coerceResourceForMatching makes the resource lower case and converts internal versions to unspecified (legacy behavior) +func coerceResourceForMatching(resource schema.GroupVersionResource) schema.GroupVersionResource { + resource.Resource = strings.ToLower(resource.Resource) + if resource.Version == runtime.APIVersionInternal { + resource.Version = "" + } + + return resource +} + +func (m *DefaultRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error) { + resource := coerceResourceForMatching(input) + + hasResource := len(resource.Resource) > 0 + hasGroup := len(resource.Group) > 0 + hasVersion := len(resource.Version) > 0 + + if !hasResource { + return nil, fmt.Errorf("a resource must be present, got: %v", resource) + } + + ret := []schema.GroupVersionResource{} + switch { + case hasGroup && hasVersion: + // fully qualified. Find the exact match + for plural, singular := range m.pluralToSingular { + if singular == resource { + ret = append(ret, plural) + break + } + if plural == resource { + ret = append(ret, plural) + break + } + } + + case hasGroup: + // given a group, prefer an exact match. If you don't find one, resort to a prefix match on group + foundExactMatch := false + requestedGroupResource := resource.GroupResource() + for plural, singular := range m.pluralToSingular { + if singular.GroupResource() == requestedGroupResource { + foundExactMatch = true + ret = append(ret, plural) + } + if plural.GroupResource() == requestedGroupResource { + foundExactMatch = true + ret = append(ret, plural) + } + } + + // if you didn't find an exact match, match on group prefixing. This allows storageclass.storage to match + // storageclass.storage.k8s.io + if !foundExactMatch { + for plural, singular := range m.pluralToSingular { + if !strings.HasPrefix(plural.Group, requestedGroupResource.Group) { + continue + } + if singular.Resource == requestedGroupResource.Resource { + ret = append(ret, plural) + } + if plural.Resource == requestedGroupResource.Resource { + ret = append(ret, plural) + } + } + + } + + case hasVersion: + for plural, singular := range m.pluralToSingular { + if singular.Version == resource.Version && singular.Resource == resource.Resource { + ret = append(ret, plural) + } + if plural.Version == resource.Version && plural.Resource == resource.Resource { + ret = append(ret, plural) + } + } + + default: + for plural, singular := range m.pluralToSingular { + if singular.Resource == resource.Resource { + ret = append(ret, plural) + } + if plural.Resource == resource.Resource { + ret = append(ret, plural) + } + } + } + + if len(ret) == 0 { + return nil, &NoResourceMatchError{PartialResource: resource} + } + + sort.Sort(resourceByPreferredGroupVersion{ret, m.defaultGroupVersions}) + return ret, nil +} + +func (m *DefaultRESTMapper) ResourceFor(resource schema.GroupVersionResource) (schema.GroupVersionResource, error) { + resources, err := m.ResourcesFor(resource) + if err != nil { + return schema.GroupVersionResource{}, err + } + if len(resources) == 1 { + return resources[0], nil + } + + return schema.GroupVersionResource{}, &AmbiguousResourceError{PartialResource: resource, MatchingResources: resources} +} + +func (m *DefaultRESTMapper) KindsFor(input schema.GroupVersionResource) ([]schema.GroupVersionKind, error) { + resource := coerceResourceForMatching(input) + + hasResource := len(resource.Resource) > 0 + hasGroup := len(resource.Group) > 0 + hasVersion := len(resource.Version) > 0 + + if !hasResource { + return nil, fmt.Errorf("a resource must be present, got: %v", resource) + } + + ret := []schema.GroupVersionKind{} + switch { + // fully qualified. Find the exact match + case hasGroup && hasVersion: + kind, exists := m.resourceToKind[resource] + if exists { + ret = append(ret, kind) + } + + case hasGroup: + foundExactMatch := false + requestedGroupResource := resource.GroupResource() + for currResource, currKind := range m.resourceToKind { + if currResource.GroupResource() == requestedGroupResource { + foundExactMatch = true + ret = append(ret, currKind) + } + } + + // if you didn't find an exact match, match on group prefixing. This allows storageclass.storage to match + // storageclass.storage.k8s.io + if !foundExactMatch { + for currResource, currKind := range m.resourceToKind { + if !strings.HasPrefix(currResource.Group, requestedGroupResource.Group) { + continue + } + if currResource.Resource == requestedGroupResource.Resource { + ret = append(ret, currKind) + } + } + + } + + case hasVersion: + for currResource, currKind := range m.resourceToKind { + if currResource.Version == resource.Version && currResource.Resource == resource.Resource { + ret = append(ret, currKind) + } + } + + default: + for currResource, currKind := range m.resourceToKind { + if currResource.Resource == resource.Resource { + ret = append(ret, currKind) + } + } + } + + if len(ret) == 0 { + return nil, &NoResourceMatchError{PartialResource: input} + } + + sort.Sort(kindByPreferredGroupVersion{ret, m.defaultGroupVersions}) + return ret, nil +} + +func (m *DefaultRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error) { + kinds, err := m.KindsFor(resource) + if err != nil { + return schema.GroupVersionKind{}, err + } + if len(kinds) == 1 { + return kinds[0], nil + } + + return schema.GroupVersionKind{}, &AmbiguousResourceError{PartialResource: resource, MatchingKinds: kinds} +} + +type kindByPreferredGroupVersion struct { + list []schema.GroupVersionKind + sortOrder []schema.GroupVersion +} + +func (o kindByPreferredGroupVersion) Len() int { return len(o.list) } +func (o kindByPreferredGroupVersion) Swap(i, j int) { o.list[i], o.list[j] = o.list[j], o.list[i] } +func (o kindByPreferredGroupVersion) Less(i, j int) bool { + lhs := o.list[i] + rhs := o.list[j] + if lhs == rhs { + return false + } + + if lhs.GroupVersion() == rhs.GroupVersion() { + return lhs.Kind < rhs.Kind + } + + // otherwise, the difference is in the GroupVersion, so we need to sort with respect to the preferred order + lhsIndex := -1 + rhsIndex := -1 + + for i := range o.sortOrder { + if o.sortOrder[i] == lhs.GroupVersion() { + lhsIndex = i + } + if o.sortOrder[i] == rhs.GroupVersion() { + rhsIndex = i + } + } + + if rhsIndex == -1 { + return true + } + + return lhsIndex < rhsIndex +} + +type resourceByPreferredGroupVersion struct { + list []schema.GroupVersionResource + sortOrder []schema.GroupVersion +} + +func (o resourceByPreferredGroupVersion) Len() int { return len(o.list) } +func (o resourceByPreferredGroupVersion) Swap(i, j int) { o.list[i], o.list[j] = o.list[j], o.list[i] } +func (o resourceByPreferredGroupVersion) Less(i, j int) bool { + lhs := o.list[i] + rhs := o.list[j] + if lhs == rhs { + return false + } + + if lhs.GroupVersion() == rhs.GroupVersion() { + return lhs.Resource < rhs.Resource + } + + // otherwise, the difference is in the GroupVersion, so we need to sort with respect to the preferred order + lhsIndex := -1 + rhsIndex := -1 + + for i := range o.sortOrder { + if o.sortOrder[i] == lhs.GroupVersion() { + lhsIndex = i + } + if o.sortOrder[i] == rhs.GroupVersion() { + rhsIndex = i + } + } + + if rhsIndex == -1 { + return true + } + + return lhsIndex < rhsIndex +} + +// RESTMapping returns a struct representing the resource path and conversion interfaces a +// RESTClient should use to operate on the provided group/kind in order of versions. If a version search +// order is not provided, the search order provided to DefaultRESTMapper will be used to resolve which +// version should be used to access the named group/kind. +func (m *DefaultRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*RESTMapping, error) { + mappings, err := m.RESTMappings(gk, versions...) + if err != nil { + return nil, err + } + if len(mappings) == 0 { + return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions} + } + // since we rely on RESTMappings method + // take the first match and return to the caller + // as this was the existing behavior. + return mappings[0], nil +} + +// RESTMappings returns the RESTMappings for the provided group kind. If a version search order +// is not provided, the search order provided to DefaultRESTMapper will be used. +func (m *DefaultRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*RESTMapping, error) { + mappings := make([]*RESTMapping, 0) + potentialGVK := make([]schema.GroupVersionKind, 0) + hadVersion := false + + // Pick an appropriate version + for _, version := range versions { + if len(version) == 0 || version == runtime.APIVersionInternal { + continue + } + currGVK := gk.WithVersion(version) + hadVersion = true + if _, ok := m.kindToPluralResource[currGVK]; ok { + potentialGVK = append(potentialGVK, currGVK) + break + } + } + // Use the default preferred versions + if !hadVersion && len(potentialGVK) == 0 { + for _, gv := range m.defaultGroupVersions { + if gv.Group != gk.Group { + continue + } + potentialGVK = append(potentialGVK, gk.WithVersion(gv.Version)) + } + } + + if len(potentialGVK) == 0 { + return nil, &NoKindMatchError{GroupKind: gk, SearchedVersions: versions} + } + + for _, gvk := range potentialGVK { + //Ensure we have a REST mapping + res, ok := m.kindToPluralResource[gvk] + if !ok { + continue + } + + // Ensure we have a REST scope + scope, ok := m.kindToScope[gvk] + if !ok { + return nil, fmt.Errorf("the provided version %q and kind %q cannot be mapped to a supported scope", gvk.GroupVersion(), gvk.Kind) + } + + mappings = append(mappings, &RESTMapping{ + Resource: res, + GroupVersionKind: gvk, + Scope: scope, + }) + } + + if len(mappings) == 0 { + return nil, &NoResourceMatchError{PartialResource: schema.GroupVersionResource{Group: gk.Group, Resource: gk.Kind}} + } + return mappings, nil +} + +// MaybeResetRESTMapper calls Reset() on the mapper if it is a ResettableRESTMapper. +func MaybeResetRESTMapper(mapper RESTMapper) { + m, ok := mapper.(ResettableRESTMapper) + if ok { + m.Reset() + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go new file mode 100644 index 00000000000..f168f033c70 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/restmapper_test.go @@ -0,0 +1,724 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 meta + +import ( + "reflect" + "strings" + "testing" + + "k8s.io/apimachinery/pkg/runtime/schema" +) + +func TestRESTMapperVersionAndKindForResource(t *testing.T) { + testGroup := "test.group" + testVersion := "test" + testGroupVersion := schema.GroupVersion{Group: testGroup, Version: testVersion} + + testCases := []struct { + Resource schema.GroupVersionResource + GroupVersionToRegister schema.GroupVersion + ExpectedGVK schema.GroupVersionKind + Err bool + }{ + {Resource: schema.GroupVersionResource{Resource: "internalobjec"}, Err: true}, + {Resource: schema.GroupVersionResource{Resource: "internalObjec"}, Err: true}, + + {Resource: schema.GroupVersionResource{Resource: "internalobject"}, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, + {Resource: schema.GroupVersionResource{Resource: "internalobjects"}, ExpectedGVK: testGroupVersion.WithKind("InternalObject")}, + } + for i, testCase := range testCases { + mapper := NewDefaultRESTMapper([]schema.GroupVersion{testGroupVersion}) + if len(testCase.ExpectedGVK.Kind) != 0 { + mapper.Add(testCase.ExpectedGVK, RESTScopeNamespace) + } + actualGVK, err := mapper.KindFor(testCase.Resource) + + hasErr := err != nil + if hasErr != testCase.Err { + t.Errorf("%d: unexpected error behavior %t: %v", i, testCase.Err, err) + continue + } + if err != nil { + continue + } + + if actualGVK != testCase.ExpectedGVK { + t.Errorf("%d: unexpected version and kind: e=%s a=%s", i, testCase.ExpectedGVK, actualGVK) + } + } +} + +func TestRESTMapperGroupForResource(t *testing.T) { + testCases := []struct { + Resource schema.GroupVersionResource + GroupVersionKind schema.GroupVersionKind + Err bool + }{ + {Resource: schema.GroupVersionResource{Resource: "myObject"}, GroupVersionKind: schema.GroupVersionKind{Group: "testapi", Version: "test", Kind: "MyObject"}}, + {Resource: schema.GroupVersionResource{Resource: "myobject"}, GroupVersionKind: schema.GroupVersionKind{Group: "testapi2", Version: "test", Kind: "MyObject"}}, + {Resource: schema.GroupVersionResource{Resource: "myObje"}, Err: true, GroupVersionKind: schema.GroupVersionKind{Group: "testapi", Version: "test", Kind: "MyObject"}}, + {Resource: schema.GroupVersionResource{Resource: "myobje"}, Err: true, GroupVersionKind: schema.GroupVersionKind{Group: "testapi", Version: "test", Kind: "MyObject"}}, + } + for i, testCase := range testCases { + mapper := NewDefaultRESTMapper([]schema.GroupVersion{testCase.GroupVersionKind.GroupVersion()}) + mapper.Add(testCase.GroupVersionKind, RESTScopeNamespace) + + actualGVK, err := mapper.KindFor(testCase.Resource) + if testCase.Err { + if err == nil { + t.Errorf("%d: expected error", i) + } + } else if err != nil { + t.Errorf("%d: unexpected error: %v", i, err) + } else if actualGVK != testCase.GroupVersionKind { + t.Errorf("%d: expected group %q, got %q", i, testCase.GroupVersionKind, actualGVK) + } + } +} + +func TestRESTMapperKindsFor(t *testing.T) { + testCases := []struct { + Name string + PreferredOrder []schema.GroupVersion + KindsToRegister []schema.GroupVersionKind + PartialResourceToRequest schema.GroupVersionResource + + ExpectedKinds []schema.GroupVersionKind + ExpectedKindErr string + }{ + { + // exact matches are preferred + Name: "groups, with group exact", + PreferredOrder: []schema.GroupVersion{ + {Group: "first-group-1", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group-1", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + PartialResourceToRequest: schema.GroupVersionResource{Group: "first-group", Resource: "my-kind"}, + + ExpectedKinds: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + }, + + { + // group prefixes work + Name: "groups, with group prefix", + PreferredOrder: []schema.GroupVersion{ + {Group: "second-group", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + }, + PartialResourceToRequest: schema.GroupVersionResource{Group: "first", Resource: "my-kind"}, + + ExpectedKinds: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + }, + + { + // group prefixes can be ambiguous + Name: "groups, with ambiguous group prefix", + PreferredOrder: []schema.GroupVersion{ + {Group: "first-group-1", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group-1", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + PartialResourceToRequest: schema.GroupVersionResource{Group: "first", Resource: "my-kind"}, + + ExpectedKinds: []schema.GroupVersionKind{ + {Group: "first-group-1", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + ExpectedKindErr: " matches multiple kinds ", + }, + + { + Name: "ambiguous groups, with preference order", + PreferredOrder: []schema.GroupVersion{ + {Group: "second-group", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "your-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "your-kind"}, + }, + PartialResourceToRequest: schema.GroupVersionResource{Resource: "my-kinds"}, + + ExpectedKinds: []schema.GroupVersionKind{ + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + ExpectedKindErr: " matches multiple kinds ", + }, + + { + Name: "ambiguous groups, with explicit group match", + PreferredOrder: []schema.GroupVersion{ + {Group: "second-group", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "your-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "your-kind"}, + }, + PartialResourceToRequest: schema.GroupVersionResource{Group: "first-group", Resource: "my-kinds"}, + + ExpectedKinds: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + }, + + { + Name: "ambiguous groups, with ambiguous version match", + PreferredOrder: []schema.GroupVersion{ + {Group: "first-group", Version: "first-version"}, + {Group: "second-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "your-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "your-kind"}, + }, + PartialResourceToRequest: schema.GroupVersionResource{Version: "first-version", Resource: "my-kinds"}, + + ExpectedKinds: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + }, + ExpectedKindErr: " matches multiple kinds ", + }, + } + for _, testCase := range testCases { + tcName := testCase.Name + mapper := NewDefaultRESTMapper(testCase.PreferredOrder) + for _, kind := range testCase.KindsToRegister { + mapper.Add(kind, RESTScopeNamespace) + } + + actualKinds, err := mapper.KindsFor(testCase.PartialResourceToRequest) + if err != nil { + t.Errorf("%s: unexpected error: %v", tcName, err) + continue + } + if !reflect.DeepEqual(testCase.ExpectedKinds, actualKinds) { + t.Errorf("%s: expected %v, got %v", tcName, testCase.ExpectedKinds, actualKinds) + } + + singleKind, err := mapper.KindFor(testCase.PartialResourceToRequest) + if err == nil && len(testCase.ExpectedKindErr) != 0 { + t.Errorf("%s: expected error: %v", tcName, testCase.ExpectedKindErr) + continue + } + if err != nil { + if len(testCase.ExpectedKindErr) == 0 { + t.Errorf("%s: unexpected error: %v", tcName, err) + continue + } else { + if !strings.Contains(err.Error(), testCase.ExpectedKindErr) { + t.Errorf("%s: expected %v, got %v", tcName, testCase.ExpectedKindErr, err) + continue + } + } + + } else { + if testCase.ExpectedKinds[0] != singleKind { + t.Errorf("%s: expected %v, got %v", tcName, testCase.ExpectedKinds[0], singleKind) + } + + } + } +} + +func TestRESTMapperResourcesFor(t *testing.T) { + testCases := []struct { + Name string + PreferredOrder []schema.GroupVersion + KindsToRegister []schema.GroupVersionKind + PluralPartialResourceToRequest schema.GroupVersionResource + SingularPartialResourceToRequest schema.GroupVersionResource + + ExpectedResources []schema.GroupVersionResource + ExpectedResourceErr string + }{ + { + // exact matches are preferred + Name: "groups, with group exact", + PreferredOrder: []schema.GroupVersion{ + {Group: "first-group-1", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group-1", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + PluralPartialResourceToRequest: schema.GroupVersionResource{Group: "first-group", Resource: "my-kinds"}, + SingularPartialResourceToRequest: schema.GroupVersionResource{Group: "first-group", Resource: "my-kind"}, + + ExpectedResources: []schema.GroupVersionResource{ + {Group: "first-group", Version: "first-version", Resource: "my-kinds"}, + }, + }, + + { + // group prefixes work + Name: "groups, with group prefix", + PreferredOrder: []schema.GroupVersion{ + {Group: "second-group", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + }, + PluralPartialResourceToRequest: schema.GroupVersionResource{Group: "first", Resource: "my-kinds"}, + SingularPartialResourceToRequest: schema.GroupVersionResource{Group: "first", Resource: "my-kind"}, + + ExpectedResources: []schema.GroupVersionResource{ + {Group: "first-group", Version: "first-version", Resource: "my-kinds"}, + }, + }, + + { + // group prefixes can be ambiguous + Name: "groups, with ambiguous group prefix", + PreferredOrder: []schema.GroupVersion{ + {Group: "first-group-1", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group-1", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + }, + PluralPartialResourceToRequest: schema.GroupVersionResource{Group: "first", Resource: "my-kinds"}, + SingularPartialResourceToRequest: schema.GroupVersionResource{Group: "first", Resource: "my-kind"}, + + ExpectedResources: []schema.GroupVersionResource{ + {Group: "first-group-1", Version: "first-version", Resource: "my-kinds"}, + {Group: "first-group", Version: "first-version", Resource: "my-kinds"}, + }, + ExpectedResourceErr: " matches multiple resources ", + }, + + { + Name: "ambiguous groups, with preference order", + PreferredOrder: []schema.GroupVersion{ + {Group: "second-group", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "your-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "your-kind"}, + }, + PluralPartialResourceToRequest: schema.GroupVersionResource{Resource: "my-kinds"}, + SingularPartialResourceToRequest: schema.GroupVersionResource{Resource: "my-kind"}, + + ExpectedResources: []schema.GroupVersionResource{ + {Group: "second-group", Version: "first-version", Resource: "my-kinds"}, + {Group: "first-group", Version: "first-version", Resource: "my-kinds"}, + }, + ExpectedResourceErr: " matches multiple resources ", + }, + + { + Name: "ambiguous groups, with explicit group match", + PreferredOrder: []schema.GroupVersion{ + {Group: "second-group", Version: "first-version"}, + {Group: "first-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "your-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "your-kind"}, + }, + PluralPartialResourceToRequest: schema.GroupVersionResource{Group: "first-group", Resource: "my-kinds"}, + SingularPartialResourceToRequest: schema.GroupVersionResource{Group: "first-group", Resource: "my-kind"}, + + ExpectedResources: []schema.GroupVersionResource{ + {Group: "first-group", Version: "first-version", Resource: "my-kinds"}, + }, + }, + + { + Name: "ambiguous groups, with ambiguous version match", + PreferredOrder: []schema.GroupVersion{ + {Group: "first-group", Version: "first-version"}, + {Group: "second-group", Version: "first-version"}, + }, + KindsToRegister: []schema.GroupVersionKind{ + {Group: "first-group", Version: "first-version", Kind: "my-kind"}, + {Group: "first-group", Version: "first-version", Kind: "your-kind"}, + {Group: "second-group", Version: "first-version", Kind: "my-kind"}, + {Group: "second-group", Version: "first-version", Kind: "your-kind"}, + }, + PluralPartialResourceToRequest: schema.GroupVersionResource{Version: "first-version", Resource: "my-kinds"}, + SingularPartialResourceToRequest: schema.GroupVersionResource{Version: "first-version", Resource: "my-kind"}, + + ExpectedResources: []schema.GroupVersionResource{ + {Group: "first-group", Version: "first-version", Resource: "my-kinds"}, + {Group: "second-group", Version: "first-version", Resource: "my-kinds"}, + }, + ExpectedResourceErr: " matches multiple resources ", + }, + } + for _, testCase := range testCases { + tcName := testCase.Name + + for _, partialResource := range []schema.GroupVersionResource{testCase.PluralPartialResourceToRequest, testCase.SingularPartialResourceToRequest} { + mapper := NewDefaultRESTMapper(testCase.PreferredOrder) + for _, kind := range testCase.KindsToRegister { + mapper.Add(kind, RESTScopeNamespace) + } + + actualResources, err := mapper.ResourcesFor(partialResource) + if err != nil { + t.Errorf("%s: unexpected error: %v", tcName, err) + continue + } + if !reflect.DeepEqual(testCase.ExpectedResources, actualResources) { + t.Errorf("%s: expected %v, got %v", tcName, testCase.ExpectedResources, actualResources) + } + + singleResource, err := mapper.ResourceFor(partialResource) + if err == nil && len(testCase.ExpectedResourceErr) != 0 { + t.Errorf("%s: expected error: %v", tcName, testCase.ExpectedResourceErr) + continue + } + if err != nil { + if len(testCase.ExpectedResourceErr) == 0 { + t.Errorf("%s: unexpected error: %v", tcName, err) + continue + } else { + if !strings.Contains(err.Error(), testCase.ExpectedResourceErr) { + t.Errorf("%s: expected %v, got %v", tcName, testCase.ExpectedResourceErr, err) + continue + } + } + + } else { + if testCase.ExpectedResources[0] != singleResource { + t.Errorf("%s: expected %v, got %v", tcName, testCase.ExpectedResources[0], singleResource) + } + + } + } + } +} + +func TestKindToResource(t *testing.T) { + testCases := []struct { + Kind string + Plural, Singular string + }{ + {Kind: "Pod", Plural: "pods", Singular: "pod"}, + + {Kind: "ReplicationController", Plural: "replicationcontrollers", Singular: "replicationcontroller"}, + + // Add "ies" when ending with "y" + {Kind: "ImageRepository", Plural: "imagerepositories", Singular: "imagerepository"}, + // Add "es" when ending with "s" + {Kind: "miss", Plural: "misses", Singular: "miss"}, + // Add "s" otherwise + {Kind: "lowercase", Plural: "lowercases", Singular: "lowercase"}, + } + for i, testCase := range testCases { + version := schema.GroupVersion{} + + plural, singular := UnsafeGuessKindToResource(version.WithKind(testCase.Kind)) + if singular != version.WithResource(testCase.Singular) || plural != version.WithResource(testCase.Plural) { + t.Errorf("%d: unexpected plural and singular: %v %v", i, plural, singular) + } + } +} + +func TestRESTMapperResourceSingularizer(t *testing.T) { + testGroupVersion := schema.GroupVersion{Group: "tgroup", Version: "test"} + + testCases := []struct { + Kind string + Plural string + Singular string + }{ + {Kind: "Pod", Plural: "pods", Singular: "pod"}, + {Kind: "ReplicationController", Plural: "replicationcontrollers", Singular: "replicationcontroller"}, + {Kind: "ImageRepository", Plural: "imagerepositories", Singular: "imagerepository"}, + {Kind: "Status", Plural: "statuses", Singular: "status"}, + + {Kind: "lowercase", Plural: "lowercases", Singular: "lowercase"}, + // TODO this test is broken. This updates to reflect actual behavior. Kinds are expected to be singular + // old (incorrect), comment: Don't add extra s if the original object is already plural + {Kind: "lowercases", Plural: "lowercaseses", Singular: "lowercases"}, + } + for i, testCase := range testCases { + mapper := NewDefaultRESTMapper([]schema.GroupVersion{testGroupVersion}) + // create singular/plural mapping + mapper.Add(testGroupVersion.WithKind(testCase.Kind), RESTScopeNamespace) + + singular, err := mapper.ResourceSingularizer(testCase.Plural) + if err != nil { + t.Errorf("%d: unexpected error: %v", i, err) + } + if singular != testCase.Singular { + t.Errorf("%d: mismatched singular: got %v, expected %v", i, singular, testCase.Singular) + } + } +} + +func TestRESTMapperRESTMapping(t *testing.T) { + testGroup := "tgroup" + testGroupVersion := schema.GroupVersion{Group: testGroup, Version: "test"} + internalGroupVersion := schema.GroupVersion{Group: testGroup, Version: "test"} + + testCases := []struct { + Kind string + APIGroupVersions []schema.GroupVersion + DefaultVersions []schema.GroupVersion + + Resource schema.GroupVersionResource + ExpectedGroupVersion *schema.GroupVersion + Err bool + }{ + {Kind: "Unknown", Err: true}, + {Kind: "InternalObject", Err: true}, + + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "Unknown", Err: true}, + + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "test"}}, Resource: testGroupVersion.WithResource("internalobjects")}, + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "test"}}, Resource: testGroupVersion.WithResource("internalobjects")}, + + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "test"}}, Resource: testGroupVersion.WithResource("internalobjects")}, + + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []schema.GroupVersion{}, Resource: internalGroupVersion.WithResource("internalobjects"), ExpectedGroupVersion: &schema.GroupVersion{Group: testGroup, Version: "test"}}, + + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "test"}}, Resource: testGroupVersion.WithResource("internalobjects")}, + + // TODO: add test for a resource that exists in one version but not another + } + for i, testCase := range testCases { + mapper := NewDefaultRESTMapper(testCase.DefaultVersions) + mapper.Add(internalGroupVersion.WithKind("InternalObject"), RESTScopeNamespace) + + preferredVersions := []string{} + for _, gv := range testCase.APIGroupVersions { + preferredVersions = append(preferredVersions, gv.Version) + } + gk := schema.GroupKind{Group: testGroup, Kind: testCase.Kind} + + mapping, err := mapper.RESTMapping(gk, preferredVersions...) + hasErr := err != nil + if hasErr != testCase.Err { + t.Errorf("%d: unexpected error behavior %t: %v", i, testCase.Err, err) + } + if hasErr { + continue + } + if mapping.Resource != testCase.Resource { + t.Errorf("%d: unexpected resource: %#v", i, mapping) + } + + groupVersion := testCase.ExpectedGroupVersion + if groupVersion == nil { + groupVersion = &testCase.APIGroupVersions[0] + } + if mapping.GroupVersionKind.GroupVersion() != *groupVersion { + t.Errorf("%d: unexpected version: %#v", i, mapping) + } + + } +} + +func TestRESTMapperRESTMappingSelectsVersion(t *testing.T) { + expectedGroupVersion1 := schema.GroupVersion{Group: "tgroup", Version: "test1"} + expectedGroupVersion2 := schema.GroupVersion{Group: "tgroup", Version: "test2"} + expectedGroupVersion3 := schema.GroupVersion{Group: "tgroup", Version: "test3"} + internalObjectGK := schema.GroupKind{Group: "tgroup", Kind: "InternalObject"} + otherObjectGK := schema.GroupKind{Group: "tgroup", Kind: "OtherObject"} + + mapper := NewDefaultRESTMapper([]schema.GroupVersion{expectedGroupVersion1, expectedGroupVersion2}) + mapper.Add(expectedGroupVersion1.WithKind("InternalObject"), RESTScopeNamespace) + mapper.Add(expectedGroupVersion2.WithKind("OtherObject"), RESTScopeNamespace) + + // pick default matching object kind based on search order + mapping, err := mapper.RESTMapping(otherObjectGK) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if mapping.Resource != expectedGroupVersion2.WithResource("otherobjects") || mapping.GroupVersionKind.GroupVersion() != expectedGroupVersion2 { + t.Errorf("unexpected mapping: %#v", mapping) + } + + mapping, err = mapper.RESTMapping(internalObjectGK) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if mapping.Resource != expectedGroupVersion1.WithResource("internalobjects") || mapping.GroupVersionKind.GroupVersion() != expectedGroupVersion1 { + t.Errorf("unexpected mapping: %#v", mapping) + } + + // mismatch of version + _, err = mapper.RESTMapping(internalObjectGK, expectedGroupVersion2.Version) + if err == nil { + t.Errorf("unexpected non-error") + } + _, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion1.Version) + if err == nil { + t.Errorf("unexpected non-error") + } + + // not in the search versions + _, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version) + if err == nil { + t.Errorf("unexpected non-error") + } + + // explicit search order + _, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version, expectedGroupVersion1.Version) + if err == nil { + t.Errorf("unexpected non-error") + } + + mapping, err = mapper.RESTMapping(otherObjectGK, expectedGroupVersion3.Version, expectedGroupVersion2.Version) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if mapping.Resource != expectedGroupVersion2.WithResource("otherobjects") || mapping.GroupVersionKind.GroupVersion() != expectedGroupVersion2 { + t.Errorf("unexpected mapping: %#v", mapping) + } +} + +func TestRESTMapperRESTMappings(t *testing.T) { + testGroup := "tgroup" + testGroupVersion := schema.GroupVersion{Group: testGroup, Version: "v1"} + + testCases := []struct { + Kind string + APIGroupVersions []schema.GroupVersion + DefaultVersions []schema.GroupVersion + AddGroupVersionKind []schema.GroupVersionKind + + ExpectedRESTMappings []*RESTMapping + Err bool + }{ + {Kind: "Unknown", Err: true}, + {Kind: "InternalObject", Err: true}, + + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "Unknown", Err: true}, + + // ask for specific version - not available - thus error + {DefaultVersions: []schema.GroupVersion{testGroupVersion}, Kind: "InternalObject", APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "v2"}}, Err: true}, + + // ask for specific version - available - check ExpectedRESTMappings + { + DefaultVersions: []schema.GroupVersion{testGroupVersion}, + Kind: "InternalObject", + APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "v2"}}, + AddGroupVersionKind: []schema.GroupVersionKind{schema.GroupVersion{Group: testGroup, Version: "v2"}.WithKind("InternalObject")}, + ExpectedRESTMappings: []*RESTMapping{{Resource: schema.GroupVersionResource{Group: testGroup, Version: "v2", Resource: "internalobjects"}, GroupVersionKind: schema.GroupVersionKind{Group: testGroup, Version: "v2", Kind: "InternalObject"}}}, + }, + + // ask for specific versions - only one available - check ExpectedRESTMappings + { + DefaultVersions: []schema.GroupVersion{testGroupVersion}, + Kind: "InternalObject", + APIGroupVersions: []schema.GroupVersion{{Group: testGroup, Version: "v3"}, {Group: testGroup, Version: "v2"}}, + AddGroupVersionKind: []schema.GroupVersionKind{schema.GroupVersion{Group: testGroup, Version: "v2"}.WithKind("InternalObject")}, + ExpectedRESTMappings: []*RESTMapping{{Resource: schema.GroupVersionResource{Group: testGroup, Version: "v2", Resource: "internalobjects"}, GroupVersionKind: schema.GroupVersionKind{Group: testGroup, Version: "v2", Kind: "InternalObject"}}}, + }, + + // do not ask for specific version - search through default versions - check ExpectedRESTMappings + { + DefaultVersions: []schema.GroupVersion{testGroupVersion, {Group: testGroup, Version: "v2"}}, + Kind: "InternalObject", + AddGroupVersionKind: []schema.GroupVersionKind{schema.GroupVersion{Group: testGroup, Version: "v1"}.WithKind("InternalObject"), schema.GroupVersion{Group: testGroup, Version: "v2"}.WithKind("InternalObject")}, + ExpectedRESTMappings: []*RESTMapping{ + { + Resource: schema.GroupVersionResource{Group: testGroup, Version: "v1", Resource: "internalobjects"}, + GroupVersionKind: schema.GroupVersionKind{Group: testGroup, Version: "v1", Kind: "InternalObject"}, + }, + { + Resource: schema.GroupVersionResource{Group: testGroup, Version: "v2", Resource: "internalobjects"}, + GroupVersionKind: schema.GroupVersionKind{Group: testGroup, Version: "v2", Kind: "InternalObject"}, + }, + }, + }, + } + + for i, testCase := range testCases { + mapper := NewDefaultRESTMapper(testCase.DefaultVersions) + for _, gvk := range testCase.AddGroupVersionKind { + mapper.Add(gvk, RESTScopeNamespace) + } + + preferredVersions := []string{} + for _, gv := range testCase.APIGroupVersions { + preferredVersions = append(preferredVersions, gv.Version) + } + gk := schema.GroupKind{Group: testGroup, Kind: testCase.Kind} + + mappings, err := mapper.RESTMappings(gk, preferredVersions...) + hasErr := err != nil + if hasErr != testCase.Err { + t.Errorf("%d: unexpected error behavior %t: %v", i, testCase.Err, err) + } + if hasErr { + continue + } + if len(mappings) != len(testCase.ExpectedRESTMappings) { + t.Errorf("%d: unexpected number = %d of rest mappings was returned, expected = %d", i, len(mappings), len(testCase.ExpectedRESTMappings)) + } + for j, mapping := range mappings { + exp := testCase.ExpectedRESTMappings[j] + if mapping.Resource != exp.Resource { + t.Errorf("%d - %d: unexpected resource: %#v", i, j, mapping) + } + if mapping.GroupVersionKind != exp.GroupVersionKind { + t.Errorf("%d - %d: unexpected GroupVersionKind: %#v", i, j, mapping) + } + } + } +} + +func TestRESTMapperReportsErrorOnBadVersion(t *testing.T) { + expectedGroupVersion1 := schema.GroupVersion{Group: "tgroup", Version: "test1"} + expectedGroupVersion2 := schema.GroupVersion{Group: "tgroup", Version: "test2"} + internalObjectGK := schema.GroupKind{Group: "tgroup", Kind: "InternalObject"} + + mapper := NewDefaultRESTMapper([]schema.GroupVersion{expectedGroupVersion1, expectedGroupVersion2}) + mapper.Add(expectedGroupVersion1.WithKind("InternalObject"), RESTScopeNamespace) + _, err := mapper.RESTMapping(internalObjectGK, "test3") + if err == nil { + t.Errorf("unexpected non-error") + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/table/table.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/table/table.go new file mode 100644 index 00000000000..1887f32626b --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/table/table.go @@ -0,0 +1,70 @@ +/* +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 table + +import ( + "time" + + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/duration" +) + +// MetaToTableRow converts a list or object into one or more table rows. The provided rowFn is invoked for +// each accessed item, with name and age being passed to each. +func MetaToTableRow(obj runtime.Object, rowFn func(obj runtime.Object, m metav1.Object, name, age string) ([]interface{}, error)) ([]metav1.TableRow, error) { + if meta.IsListType(obj) { + rows := make([]metav1.TableRow, 0, 16) + err := meta.EachListItem(obj, func(obj runtime.Object) error { + nestedRows, err := MetaToTableRow(obj, rowFn) + if err != nil { + return err + } + rows = append(rows, nestedRows...) + return nil + }) + if err != nil { + return nil, err + } + return rows, nil + } + + rows := make([]metav1.TableRow, 0, 1) + m, err := meta.Accessor(obj) + if err != nil { + return nil, err + } + row := metav1.TableRow{ + Object: runtime.RawExtension{Object: obj}, + } + row.Cells, err = rowFn(obj, m, m.GetName(), ConvertToHumanReadableDateType(m.GetCreationTimestamp())) + if err != nil { + return nil, err + } + rows = append(rows, row) + return rows, nil +} + +// ConvertToHumanReadableDateType returns the elapsed time since timestamp in +// human-readable approximation. +func ConvertToHumanReadableDateType(timestamp metav1.Time) string { + if timestamp.IsZero() { + return "" + } + return duration.HumanDuration(time.Since(timestamp.Time)) +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go new file mode 100644 index 00000000000..72c6438cb61 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/meta/testrestmapper/test_restmapper.go @@ -0,0 +1,165 @@ +/* +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 testrestmapper + +import ( + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/sets" +) + +// TestOnlyStaticRESTMapper returns a union RESTMapper of all known types with priorities chosen in the following order: +// 1. legacy kube group preferred version, extensions preferred version, metrics preferred version, legacy +// kube any version, extensions any version, metrics any version, all other groups alphabetical preferred version, +// all other groups alphabetical. +// +// TODO callers of this method should be updated to build their own specific restmapper based on their scheme for their tests +// TODO the things being tested are related to whether various cases are handled, not tied to the particular types being checked. +func TestOnlyStaticRESTMapper(scheme *runtime.Scheme, versionPatterns ...schema.GroupVersion) meta.RESTMapper { + unionMapper := meta.MultiRESTMapper{} + unionedGroups := sets.NewString() + for _, enabledVersion := range scheme.PrioritizedVersionsAllGroups() { + if !unionedGroups.Has(enabledVersion.Group) { + unionedGroups.Insert(enabledVersion.Group) + unionMapper = append(unionMapper, newRESTMapper(enabledVersion.Group, scheme)) + } + } + + if len(versionPatterns) != 0 { + resourcePriority := []schema.GroupVersionResource{} + kindPriority := []schema.GroupVersionKind{} + for _, versionPriority := range versionPatterns { + resourcePriority = append(resourcePriority, versionPriority.WithResource(meta.AnyResource)) + kindPriority = append(kindPriority, versionPriority.WithKind(meta.AnyKind)) + } + + return meta.PriorityRESTMapper{Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority} + } + + prioritizedGroups := []string{"", "extensions", "metrics"} + resourcePriority, kindPriority := prioritiesForGroups(scheme, prioritizedGroups...) + + prioritizedGroupsSet := sets.NewString(prioritizedGroups...) + remainingGroups := sets.String{} + for _, enabledVersion := range scheme.PrioritizedVersionsAllGroups() { + if !prioritizedGroupsSet.Has(enabledVersion.Group) { + remainingGroups.Insert(enabledVersion.Group) + } + } + + remainingResourcePriority, remainingKindPriority := prioritiesForGroups(scheme, remainingGroups.List()...) + resourcePriority = append(resourcePriority, remainingResourcePriority...) + kindPriority = append(kindPriority, remainingKindPriority...) + + return meta.PriorityRESTMapper{Delegate: unionMapper, ResourcePriority: resourcePriority, KindPriority: kindPriority} +} + +// prioritiesForGroups returns the resource and kind priorities for a PriorityRESTMapper, preferring the preferred version of each group first, +// then any non-preferred version of the group second. +func prioritiesForGroups(scheme *runtime.Scheme, groups ...string) ([]schema.GroupVersionResource, []schema.GroupVersionKind) { + resourcePriority := []schema.GroupVersionResource{} + kindPriority := []schema.GroupVersionKind{} + + for _, group := range groups { + availableVersions := scheme.PrioritizedVersionsForGroup(group) + if len(availableVersions) > 0 { + resourcePriority = append(resourcePriority, availableVersions[0].WithResource(meta.AnyResource)) + kindPriority = append(kindPriority, availableVersions[0].WithKind(meta.AnyKind)) + } + } + for _, group := range groups { + resourcePriority = append(resourcePriority, schema.GroupVersionResource{Group: group, Version: meta.AnyVersion, Resource: meta.AnyResource}) + kindPriority = append(kindPriority, schema.GroupVersionKind{Group: group, Version: meta.AnyVersion, Kind: meta.AnyKind}) + } + + return resourcePriority, kindPriority +} + +func newRESTMapper(group string, scheme *runtime.Scheme) meta.RESTMapper { + mapper := meta.NewDefaultRESTMapper(scheme.PrioritizedVersionsForGroup(group)) + for _, gv := range scheme.PrioritizedVersionsForGroup(group) { + for kind := range scheme.KnownTypes(gv) { + if ignoredKinds.Has(kind) { + continue + } + scope := meta.RESTScopeNamespace + if rootScopedKinds[gv.WithKind(kind).GroupKind()] { + scope = meta.RESTScopeRoot + } + mapper.Add(gv.WithKind(kind), scope) + } + } + + return mapper +} + +// hardcoded is good enough for the test we're running +var rootScopedKinds = map[schema.GroupKind]bool{ + {Group: "admission.k8s.io", Kind: "AdmissionReview"}: true, + + {Group: "admissionregistration.k8s.io", Kind: "ValidatingWebhookConfiguration"}: true, + {Group: "admissionregistration.k8s.io", Kind: "MutatingWebhookConfiguration"}: true, + + {Group: "authentication.k8s.io", Kind: "TokenReview"}: true, + + {Group: "authorization.k8s.io", Kind: "SubjectAccessReview"}: true, + {Group: "authorization.k8s.io", Kind: "SelfSubjectAccessReview"}: true, + {Group: "authorization.k8s.io", Kind: "SelfSubjectRulesReview"}: true, + + {Group: "certificates.k8s.io", Kind: "CertificateSigningRequest"}: true, + + {Group: "", Kind: "Node"}: true, + {Group: "", Kind: "Namespace"}: true, + {Group: "", Kind: "PersistentVolume"}: true, + {Group: "", Kind: "ComponentStatus"}: true, + + {Group: "rbac.authorization.k8s.io", Kind: "ClusterRole"}: true, + {Group: "rbac.authorization.k8s.io", Kind: "ClusterRoleBinding"}: true, + + {Group: "scheduling.k8s.io", Kind: "PriorityClass"}: true, + + {Group: "storage.k8s.io", Kind: "StorageClass"}: true, + {Group: "storage.k8s.io", Kind: "VolumeAttachment"}: true, + + {Group: "apiextensions.k8s.io", Kind: "CustomResourceDefinition"}: true, + + {Group: "apiserver.k8s.io", Kind: "AdmissionConfiguration"}: true, + + {Group: "audit.k8s.io", Kind: "Event"}: true, + {Group: "audit.k8s.io", Kind: "Policy"}: true, + + {Group: "apiregistration.k8s.io", Kind: "APIService"}: true, + + {Group: "metrics.k8s.io", Kind: "NodeMetrics"}: true, + + {Group: "wardle.example.com", Kind: "Fischer"}: true, +} + +// hardcoded is good enough for the test we're running +var ignoredKinds = sets.NewString( + "ListOptions", + "DeleteOptions", + "Status", + "PodLogOptions", + "PodExecOptions", + "PodAttachOptions", + "PodPortForwardOptions", + "PodProxyOptions", + "NodeProxyOptions", + "ServiceProxyOptions", +) diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/OWNERS b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/OWNERS new file mode 100644 index 00000000000..40237324761 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/OWNERS @@ -0,0 +1,11 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +# Disable inheritance as this is an api owners file +options: + no_parent_owners: true +approvers: + - api-approvers +reviewers: + - api-reviewers +labels: + - kind/api-change diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/doc.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/doc.go new file mode 100644 index 00000000000..9f20152e452 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/doc.go @@ -0,0 +1,18 @@ +/* +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 validation contains generic api type validation functions. +package validation // import "k8s.io/apimachinery/pkg/api/validation" diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/generic.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/generic.go new file mode 100644 index 00000000000..e0b5b14900d --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/generic.go @@ -0,0 +1,88 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 validation + +import ( + "strings" + + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// IsNegativeErrorMsg is a error message for value must be greater than or equal to 0. +const IsNegativeErrorMsg string = `must be greater than or equal to 0` + +// ValidateNameFunc validates that the provided name is valid for a given resource type. +// Not all resources have the same validation rules for names. Prefix is true +// if the name will have a value appended to it. If the name is not valid, +// this returns a list of descriptions of individual characteristics of the +// value that were not valid. Otherwise this returns an empty list or nil. +type ValidateNameFunc func(name string, prefix bool) []string + +// NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain. +func NameIsDNSSubdomain(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1123Subdomain(name) +} + +// NameIsDNSLabel is a ValidateNameFunc for names that must be a DNS 1123 label. +func NameIsDNSLabel(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1123Label(name) +} + +// NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label. +func NameIsDNS1035Label(name string, prefix bool) []string { + if prefix { + name = maskTrailingDash(name) + } + return validation.IsDNS1035Label(name) +} + +// ValidateNamespaceName can be used to check whether the given namespace name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +var ValidateNamespaceName = NameIsDNSLabel + +// ValidateServiceAccountName can be used to check whether the given service account name is valid. +// Prefix indicates this name will be used as part of generation, in which case +// trailing dashes are allowed. +var ValidateServiceAccountName = NameIsDNSSubdomain + +// maskTrailingDash replaces the final character of a string with a subdomain safe +// value if it is a dash and if the length of this string is greater than 1. Note that +// this is used when a value could be appended to the string, see ValidateNameFunc +// for more info. +func maskTrailingDash(name string) string { + if len(name) > 1 && strings.HasSuffix(name, "-") { + return name[:len(name)-2] + "a" + } + return name +} + +// ValidateNonnegativeField validates that given value is not negative. +func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if value < 0 { + allErrs = append(allErrs, field.Invalid(fldPath, value, IsNegativeErrorMsg)) + } + return allErrs +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/generic_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/generic_test.go new file mode 100644 index 00000000000..a753cc2b221 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/generic_test.go @@ -0,0 +1,65 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 validation + +import "testing" + +func TestMaskTrailingDash(t *testing.T) { + testCases := []struct { + beforeMasking string + expectedAfterMasking string + description string + }{ + { + beforeMasking: "", + expectedAfterMasking: "", + description: "empty string", + }, + { + beforeMasking: "-", + expectedAfterMasking: "-", + description: "only a single dash", + }, + { + beforeMasking: "-foo", + expectedAfterMasking: "-foo", + description: "has leading dash", + }, + { + beforeMasking: "-foo-", + expectedAfterMasking: "-foa", + description: "has both leading and trailing dashes", + }, + { + beforeMasking: "b-", + expectedAfterMasking: "a", + description: "has trailing dash", + }, + { + beforeMasking: "ab", + expectedAfterMasking: "ab", + description: "has neither leading nor trailing dashes", + }, + } + + for _, tc := range testCases { + afterMasking := maskTrailingDash(tc.beforeMasking) + if afterMasking != tc.expectedAfterMasking { + t.Errorf("error in test case: %s. expected: %s, actual: %s", tc.description, tc.expectedAfterMasking, afterMasking) + } + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/objectmeta.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/objectmeta.go new file mode 100644 index 00000000000..593d7ba8cf7 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/objectmeta.go @@ -0,0 +1,265 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT 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 validation + +import ( + "fmt" + "strings" + + apiequality "k8s.io/apimachinery/pkg/api/equality" + "k8s.io/apimachinery/pkg/api/meta" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + v1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/util/validation" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +// FieldImmutableErrorMsg is a error message for field is immutable. +const FieldImmutableErrorMsg string = `field is immutable` + +const TotalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB + +// BannedOwners is a black list of object that are not allowed to be owners. +var BannedOwners = map[schema.GroupVersionKind]struct{}{ + {Group: "", Version: "v1", Kind: "Event"}: {}, +} + +// ValidateAnnotations validates that a set of annotations are correctly defined. +func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for k := range annotations { + // The rule is QualifiedName except that case doesn't matter, so convert to lowercase before checking. + for _, msg := range validation.IsQualifiedName(strings.ToLower(k)) { + allErrs = append(allErrs, field.Invalid(fldPath, k, msg)) + } + } + if err := ValidateAnnotationsSize(annotations); err != nil { + allErrs = append(allErrs, field.TooLong(fldPath, "", TotalAnnotationSizeLimitB)) + } + return allErrs +} + +func ValidateAnnotationsSize(annotations map[string]string) error { + var totalSize int64 + for k, v := range annotations { + totalSize += (int64)(len(k)) + (int64)(len(v)) + } + if totalSize > (int64)(TotalAnnotationSizeLimitB) { + return fmt.Errorf("annotations size %d is larger than limit %d", totalSize, TotalAnnotationSizeLimitB) + } + return nil +} + +func validateOwnerReference(ownerReference metav1.OwnerReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + gvk := schema.FromAPIVersionAndKind(ownerReference.APIVersion, ownerReference.Kind) + // gvk.Group is empty for the legacy group. + if len(gvk.Version) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("apiVersion"), ownerReference.APIVersion, "version must not be empty")) + } + if len(gvk.Kind) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("kind"), ownerReference.Kind, "kind must not be empty")) + } + if len(ownerReference.Name) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), ownerReference.Name, "name must not be empty")) + } + if len(ownerReference.UID) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("uid"), ownerReference.UID, "uid must not be empty")) + } + if _, ok := BannedOwners[gvk]; ok { + allErrs = append(allErrs, field.Invalid(fldPath, ownerReference, fmt.Sprintf("%s is disallowed from being an owner", gvk))) + } + return allErrs +} + +// ValidateOwnerReferences validates that a set of owner references are correctly defined. +func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + firstControllerName := "" + for _, ref := range ownerReferences { + allErrs = append(allErrs, validateOwnerReference(ref, fldPath)...) + if ref.Controller != nil && *ref.Controller { + curControllerName := ref.Kind + "/" + ref.Name + if firstControllerName != "" { + allErrs = append(allErrs, field.Invalid(fldPath, ownerReferences, + fmt.Sprintf("Only one reference can have Controller set to true. Found \"true\" in references for %v and %v", firstControllerName, curControllerName))) + } else { + firstControllerName = curControllerName + } + } + } + return allErrs +} + +// ValidateFinalizerName validates finalizer names. +func ValidateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + for _, msg := range validation.IsQualifiedName(stringValue) { + allErrs = append(allErrs, field.Invalid(fldPath, stringValue, msg)) + } + + return allErrs +} + +// ValidateNoNewFinalizers validates the new finalizers has no new finalizers compare to old finalizers. +func ValidateNoNewFinalizers(newFinalizers []string, oldFinalizers []string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + extra := sets.NewString(newFinalizers...).Difference(sets.NewString(oldFinalizers...)) + if len(extra) != 0 { + allErrs = append(allErrs, field.Forbidden(fldPath, fmt.Sprintf("no new finalizers can be added if the object is being deleted, found new finalizers %#v", extra.List()))) + } + return allErrs +} + +// ValidateImmutableField validates the new value and the old value are deeply equal. +func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + if !apiequality.Semantic.DeepEqual(oldVal, newVal) { + allErrs = append(allErrs, field.Invalid(fldPath, newVal, FieldImmutableErrorMsg)) + } + return allErrs +} + +// ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already +// been performed. +// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. +func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { + metadata, err := meta.Accessor(objMeta) + if err != nil { + var allErrs field.ErrorList + allErrs = append(allErrs, field.Invalid(fldPath, objMeta, err.Error())) + return allErrs + } + return ValidateObjectMetaAccessor(metadata, requiresNamespace, nameFn, fldPath) +} + +// ValidateObjectMetaAccessor validates an object's metadata on creation. It expects that name generation has already +// been performed. +// It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before. +func ValidateObjectMetaAccessor(meta metav1.Object, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + if len(meta.GetGenerateName()) != 0 { + for _, msg := range nameFn(meta.GetGenerateName(), true) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generateName"), meta.GetGenerateName(), msg)) + } + } + // If the generated name validates, but the calculated value does not, it's a problem with generation, and we + // report it here. This may confuse users, but indicates a programming bug and still must be validated. + // If there are multiple fields out of which one is required then add an or as a separator + if len(meta.GetName()) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("name"), "name or generateName is required")) + } else { + for _, msg := range nameFn(meta.GetName(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("name"), meta.GetName(), msg)) + } + } + if requiresNamespace { + if len(meta.GetNamespace()) == 0 { + allErrs = append(allErrs, field.Required(fldPath.Child("namespace"), "")) + } else { + for _, msg := range ValidateNamespaceName(meta.GetNamespace(), false) { + allErrs = append(allErrs, field.Invalid(fldPath.Child("namespace"), meta.GetNamespace(), msg)) + } + } + } else { + if len(meta.GetNamespace()) != 0 { + allErrs = append(allErrs, field.Forbidden(fldPath.Child("namespace"), "not allowed on this type")) + } + } + + allErrs = append(allErrs, ValidateNonnegativeField(meta.GetGeneration(), fldPath.Child("generation"))...) + allErrs = append(allErrs, v1validation.ValidateLabels(meta.GetLabels(), fldPath.Child("labels"))...) + allErrs = append(allErrs, ValidateAnnotations(meta.GetAnnotations(), fldPath.Child("annotations"))...) + allErrs = append(allErrs, ValidateOwnerReferences(meta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) + allErrs = append(allErrs, ValidateFinalizers(meta.GetFinalizers(), fldPath.Child("finalizers"))...) + allErrs = append(allErrs, v1validation.ValidateManagedFields(meta.GetManagedFields(), fldPath.Child("managedFields"))...) + return allErrs +} + +// ValidateFinalizers tests if the finalizers name are valid, and if there are conflicting finalizers. +func ValidateFinalizers(finalizers []string, fldPath *field.Path) field.ErrorList { + allErrs := field.ErrorList{} + hasFinalizerOrphanDependents := false + hasFinalizerDeleteDependents := false + for _, finalizer := range finalizers { + allErrs = append(allErrs, ValidateFinalizerName(finalizer, fldPath)...) + if finalizer == metav1.FinalizerOrphanDependents { + hasFinalizerOrphanDependents = true + } + if finalizer == metav1.FinalizerDeleteDependents { + hasFinalizerDeleteDependents = true + } + } + if hasFinalizerDeleteDependents && hasFinalizerOrphanDependents { + allErrs = append(allErrs, field.Invalid(fldPath, finalizers, fmt.Sprintf("finalizer %s and %s cannot be both set", metav1.FinalizerOrphanDependents, metav1.FinalizerDeleteDependents))) + } + return allErrs +} + +// ValidateObjectMetaUpdate validates an object's metadata when updated. +func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList { + newMetadata, err := meta.Accessor(newMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, newMeta, err.Error())) + return allErrs + } + oldMetadata, err := meta.Accessor(oldMeta) + if err != nil { + allErrs := field.ErrorList{} + allErrs = append(allErrs, field.Invalid(fldPath, oldMeta, err.Error())) + return allErrs + } + return ValidateObjectMetaAccessorUpdate(newMetadata, oldMetadata, fldPath) +} + +// ValidateObjectMetaAccessorUpdate validates an object's metadata when updated. +func ValidateObjectMetaAccessorUpdate(newMeta, oldMeta metav1.Object, fldPath *field.Path) field.ErrorList { + var allErrs field.ErrorList + + // Finalizers cannot be added if the object is already being deleted. + if oldMeta.GetDeletionTimestamp() != nil { + allErrs = append(allErrs, ValidateNoNewFinalizers(newMeta.GetFinalizers(), oldMeta.GetFinalizers(), fldPath.Child("finalizers"))...) + } + + // Reject updates that don't specify a resource version + if len(newMeta.GetResourceVersion()) == 0 { + allErrs = append(allErrs, field.Invalid(fldPath.Child("resourceVersion"), newMeta.GetResourceVersion(), "must be specified for an update")) + } + + // Generation shouldn't be decremented + if newMeta.GetGeneration() < oldMeta.GetGeneration() { + allErrs = append(allErrs, field.Invalid(fldPath.Child("generation"), newMeta.GetGeneration(), "must not be decremented")) + } + + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetName(), oldMeta.GetName(), fldPath.Child("name"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetNamespace(), oldMeta.GetNamespace(), fldPath.Child("namespace"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetUID(), oldMeta.GetUID(), fldPath.Child("uid"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetCreationTimestamp(), oldMeta.GetCreationTimestamp(), fldPath.Child("creationTimestamp"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionTimestamp(), oldMeta.GetDeletionTimestamp(), fldPath.Child("deletionTimestamp"))...) + allErrs = append(allErrs, ValidateImmutableField(newMeta.GetDeletionGracePeriodSeconds(), oldMeta.GetDeletionGracePeriodSeconds(), fldPath.Child("deletionGracePeriodSeconds"))...) + + allErrs = append(allErrs, v1validation.ValidateLabels(newMeta.GetLabels(), fldPath.Child("labels"))...) + allErrs = append(allErrs, ValidateAnnotations(newMeta.GetAnnotations(), fldPath.Child("annotations"))...) + allErrs = append(allErrs, ValidateOwnerReferences(newMeta.GetOwnerReferences(), fldPath.Child("ownerReferences"))...) + allErrs = append(allErrs, v1validation.ValidateManagedFields(newMeta.GetManagedFields(), fldPath.Child("managedFields"))...) + + return allErrs +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/objectmeta_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/objectmeta_test.go new file mode 100644 index 00000000000..0331cf9f3b9 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/objectmeta_test.go @@ -0,0 +1,500 @@ +/* +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 validation + +import ( + "math/rand" + "reflect" + "strings" + "testing" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +const ( + maxLengthErrMsg = "must be no more than" + namePartErrMsg = "name part must consist of" + nameErrMsg = "a qualified name must consist of" +) + +// Ensure custom name functions are allowed +func TestValidateObjectMetaCustomName(t *testing.T) { + errs := ValidateObjectMeta( + &metav1.ObjectMeta{Name: "test", GenerateName: "foo"}, + false, + func(s string, prefix bool) []string { + if s == "test" { + return nil + } + return []string{"name-gen"} + }, + field.NewPath("field")) + if len(errs) != 1 { + t.Fatalf("unexpected errors: %v", errs) + } + if !strings.Contains(errs[0].Error(), "name-gen") { + t.Errorf("unexpected error message: %v", errs) + } +} + +// Ensure namespace names follow dns label format +func TestValidateObjectMetaNamespaces(t *testing.T) { + errs := ValidateObjectMeta( + &metav1.ObjectMeta{Name: "test", Namespace: "foo.bar"}, + true, + func(s string, prefix bool) []string { + return nil + }, + field.NewPath("field")) + if len(errs) != 1 { + t.Fatalf("unexpected errors: %v", errs) + } + if !strings.Contains(errs[0].Error(), `Invalid value: "foo.bar"`) { + t.Errorf("unexpected error message: %v", errs) + } + maxLength := 63 + letters := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") + b := make([]rune, maxLength+1) + for i := range b { + b[i] = letters[rand.Intn(len(letters))] + } + errs = ValidateObjectMeta( + &metav1.ObjectMeta{Name: "test", Namespace: string(b)}, + true, + func(s string, prefix bool) []string { + return nil + }, + field.NewPath("field")) + if len(errs) != 2 { + t.Fatalf("unexpected errors: %v", errs) + } + if !strings.Contains(errs[0].Error(), "Invalid value") || !strings.Contains(errs[1].Error(), "Invalid value") { + t.Errorf("unexpected error message: %v", errs) + } +} + +func TestValidateObjectMetaOwnerReferences(t *testing.T) { + trueVar := true + falseVar := false + testCases := []struct { + description string + ownerReferences []metav1.OwnerReference + expectError bool + expectedErrorMessage string + }{ + { + description: "simple success - third party extension.", + ownerReferences: []metav1.OwnerReference{ + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind", + Name: "name", + UID: "1", + }, + }, + expectError: false, + expectedErrorMessage: "", + }, + { + description: "simple failures - event shouldn't be set as an owner", + ownerReferences: []metav1.OwnerReference{ + { + APIVersion: "v1", + Kind: "Event", + Name: "name", + UID: "1", + }, + }, + expectError: true, + expectedErrorMessage: "is disallowed from being an owner", + }, + { + description: "simple controller ref success - one reference with Controller set", + ownerReferences: []metav1.OwnerReference{ + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind", + Name: "name", + UID: "1", + Controller: &falseVar, + }, + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind", + Name: "name", + UID: "2", + Controller: &trueVar, + }, + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind", + Name: "name", + UID: "3", + Controller: &falseVar, + }, + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind", + Name: "name", + UID: "4", + }, + }, + expectError: false, + expectedErrorMessage: "", + }, + { + description: "simple controller ref failure - two references with Controller set", + ownerReferences: []metav1.OwnerReference{ + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind1", + Name: "name", + UID: "1", + Controller: &falseVar, + }, + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind2", + Name: "name", + UID: "2", + Controller: &trueVar, + }, + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind3", + Name: "name", + UID: "3", + Controller: &trueVar, + }, + { + APIVersion: "customresourceVersion", + Kind: "customresourceKind4", + Name: "name", + UID: "4", + }, + }, + expectError: true, + expectedErrorMessage: "Only one reference can have Controller set to true. Found \"true\" in references for customresourceKind2/name and customresourceKind3/name", + }, + } + + for _, tc := range testCases { + errs := ValidateObjectMeta( + &metav1.ObjectMeta{Name: "test", Namespace: "test", OwnerReferences: tc.ownerReferences}, + true, + func(s string, prefix bool) []string { + return nil + }, + field.NewPath("field")) + if len(errs) != 0 && !tc.expectError { + t.Errorf("unexpected error: %v in test case %v", errs, tc.description) + } + if len(errs) == 0 && tc.expectError { + t.Errorf("expect error in test case %v", tc.description) + } + if len(errs) != 0 && !strings.Contains(errs[0].Error(), tc.expectedErrorMessage) { + t.Errorf("unexpected error message: %v in test case %v", errs, tc.description) + } + } +} + +func TestValidateObjectMetaUpdateIgnoresCreationTimestamp(t *testing.T) { + if errs := ValidateObjectMetaUpdate( + &metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + &metav1.ObjectMeta{Name: "test", ResourceVersion: "1", CreationTimestamp: metav1.NewTime(time.Unix(10, 0))}, + field.NewPath("field"), + ); len(errs) != 1 { + t.Fatalf("unexpected errors: %v", errs) + } + if errs := ValidateObjectMetaUpdate( + &metav1.ObjectMeta{Name: "test", ResourceVersion: "1", CreationTimestamp: metav1.NewTime(time.Unix(10, 0))}, + &metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + field.NewPath("field"), + ); len(errs) != 1 { + t.Fatalf("unexpected errors: %v", errs) + } + if errs := ValidateObjectMetaUpdate( + &metav1.ObjectMeta{Name: "test", ResourceVersion: "1", CreationTimestamp: metav1.NewTime(time.Unix(10, 0))}, + &metav1.ObjectMeta{Name: "test", ResourceVersion: "1", CreationTimestamp: metav1.NewTime(time.Unix(11, 0))}, + field.NewPath("field"), + ); len(errs) != 1 { + t.Fatalf("unexpected errors: %v", errs) + } +} + +func TestValidateFinalizersUpdate(t *testing.T) { + testcases := map[string]struct { + Old metav1.ObjectMeta + New metav1.ObjectMeta + ExpectedErr string + }{ + "invalid adding finalizers": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &metav1.Time{}, Finalizers: []string{"x/a"}}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &metav1.Time{}, Finalizers: []string{"x/a", "y/b"}}, + ExpectedErr: "y/b", + }, + "invalid changing finalizers": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &metav1.Time{}, Finalizers: []string{"x/a"}}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &metav1.Time{}, Finalizers: []string{"x/b"}}, + ExpectedErr: "x/b", + }, + "valid removing finalizers": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &metav1.Time{}, Finalizers: []string{"x/a", "y/b"}}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &metav1.Time{}, Finalizers: []string{"x/a"}}, + ExpectedErr: "", + }, + "valid adding finalizers for objects not being deleted": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Finalizers: []string{"x/a"}}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Finalizers: []string{"x/a", "y/b"}}, + ExpectedErr: "", + }, + } + for name, tc := range testcases { + errs := ValidateObjectMetaUpdate(&tc.New, &tc.Old, field.NewPath("field")) + if len(errs) == 0 { + if len(tc.ExpectedErr) != 0 { + t.Errorf("case: %q, expected error to contain %q", name, tc.ExpectedErr) + } + } else if e, a := tc.ExpectedErr, errs.ToAggregate().Error(); !strings.Contains(a, e) { + t.Errorf("case: %q, expected error to contain %q, got error %q", name, e, a) + } + } +} + +func TestValidateFinalizersPreventConflictingFinalizers(t *testing.T) { + testcases := map[string]struct { + ObjectMeta metav1.ObjectMeta + ExpectedErr string + }{ + "conflicting finalizers": { + ObjectMeta: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Finalizers: []string{metav1.FinalizerOrphanDependents, metav1.FinalizerDeleteDependents}}, + ExpectedErr: "cannot be both set", + }, + } + for name, tc := range testcases { + errs := ValidateObjectMeta(&tc.ObjectMeta, false, NameIsDNSSubdomain, field.NewPath("field")) + if len(errs) == 0 { + if len(tc.ExpectedErr) != 0 { + t.Errorf("case: %q, expected error to contain %q", name, tc.ExpectedErr) + } + } else if e, a := tc.ExpectedErr, errs.ToAggregate().Error(); !strings.Contains(a, e) { + t.Errorf("case: %q, expected error to contain %q, got error %q", name, e, a) + } + } +} + +func TestValidateObjectMetaUpdatePreventsDeletionFieldMutation(t *testing.T) { + now := metav1.NewTime(time.Unix(1000, 0).UTC()) + later := metav1.NewTime(time.Unix(2000, 0).UTC()) + gracePeriodShort := int64(30) + gracePeriodLong := int64(40) + + testcases := map[string]struct { + Old metav1.ObjectMeta + New metav1.ObjectMeta + ExpectedNew metav1.ObjectMeta + ExpectedErrs []string + }{ + "valid without deletion fields": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + ExpectedErrs: []string{}, + }, + "valid with deletion fields": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now, DeletionGracePeriodSeconds: &gracePeriodShort}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now, DeletionGracePeriodSeconds: &gracePeriodShort}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now, DeletionGracePeriodSeconds: &gracePeriodShort}, + ExpectedErrs: []string{}, + }, + + "invalid set deletionTimestamp": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now}, + ExpectedErrs: []string{"field.deletionTimestamp: Invalid value: 1970-01-01 00:16:40 +0000 UTC: field is immutable"}, + }, + "invalid clear deletionTimestamp": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + ExpectedErrs: []string{"field.deletionTimestamp: Invalid value: \"null\": field is immutable"}, + }, + "invalid change deletionTimestamp": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &now}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &later}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionTimestamp: &later}, + ExpectedErrs: []string{"field.deletionTimestamp: Invalid value: 1970-01-01 00:33:20 +0000 UTC: field is immutable"}, + }, + + "invalid set deletionGracePeriodSeconds": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionGracePeriodSeconds: &gracePeriodShort}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionGracePeriodSeconds: &gracePeriodShort}, + ExpectedErrs: []string{"field.deletionGracePeriodSeconds: Invalid value: 30: field is immutable"}, + }, + "invalid clear deletionGracePeriodSeconds": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionGracePeriodSeconds: &gracePeriodShort}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1"}, + ExpectedErrs: []string{"field.deletionGracePeriodSeconds: Invalid value: \"null\": field is immutable"}, + }, + "invalid change deletionGracePeriodSeconds": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionGracePeriodSeconds: &gracePeriodShort}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionGracePeriodSeconds: &gracePeriodLong}, + ExpectedNew: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", DeletionGracePeriodSeconds: &gracePeriodLong}, + ExpectedErrs: []string{"field.deletionGracePeriodSeconds: Invalid value: 40: field is immutable"}, + }, + } + + for k, tc := range testcases { + errs := ValidateObjectMetaUpdate(&tc.New, &tc.Old, field.NewPath("field")) + if len(errs) != len(tc.ExpectedErrs) { + t.Logf("%s: Expected: %#v", k, tc.ExpectedErrs) + t.Logf("%s: Got: %#v", k, errs) + t.Errorf("%s: expected %d errors, got %d", k, len(tc.ExpectedErrs), len(errs)) + continue + } + for i := range errs { + if errs[i].Error() != tc.ExpectedErrs[i] { + t.Errorf("%s: error #%d: expected %q, got %q", k, i, tc.ExpectedErrs[i], errs[i].Error()) + } + } + if !reflect.DeepEqual(tc.New, tc.ExpectedNew) { + t.Errorf("%s: Expected after validation:\n%#v\ngot\n%#v", k, tc.ExpectedNew, tc.New) + } + } +} + +func TestObjectMetaGenerationUpdate(t *testing.T) { + testcases := map[string]struct { + Old metav1.ObjectMeta + New metav1.ObjectMeta + ExpectedErrs []string + }{ + "invalid generation change - decremented": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Generation: 5}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Generation: 4}, + ExpectedErrs: []string{"field.generation: Invalid value: 4: must not be decremented"}, + }, + "valid generation change - incremented by one": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Generation: 1}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Generation: 2}, + ExpectedErrs: []string{}, + }, + "valid generation field - not updated": { + Old: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Generation: 5}, + New: metav1.ObjectMeta{Name: "test", ResourceVersion: "1", Generation: 5}, + ExpectedErrs: []string{}, + }, + } + + for k, tc := range testcases { + errList := []string{} + errs := ValidateObjectMetaUpdate(&tc.New, &tc.Old, field.NewPath("field")) + if len(errs) != len(tc.ExpectedErrs) { + t.Logf("%s: Expected: %#v", k, tc.ExpectedErrs) + for _, err := range errs { + errList = append(errList, err.Error()) + } + t.Logf("%s: Got: %#v", k, errList) + t.Errorf("%s: expected %d errors, got %d", k, len(tc.ExpectedErrs), len(errs)) + continue + } + for i := range errList { + if errList[i] != tc.ExpectedErrs[i] { + t.Errorf("%s: error #%d: expected %q, got %q", k, i, tc.ExpectedErrs[i], errList[i]) + } + } + } +} + +// Ensure trailing slash is allowed in generate name +func TestValidateObjectMetaTrimsTrailingSlash(t *testing.T) { + errs := ValidateObjectMeta( + &metav1.ObjectMeta{Name: "test", GenerateName: "foo-"}, + false, + NameIsDNSSubdomain, + field.NewPath("field")) + if len(errs) != 0 { + t.Fatalf("unexpected errors: %v", errs) + } +} + +func TestValidateAnnotations(t *testing.T) { + successCases := []map[string]string{ + {"simple": "bar"}, + {"now-with-dashes": "bar"}, + {"1-starts-with-num": "bar"}, + {"1234": "bar"}, + {"simple/simple": "bar"}, + {"now-with-dashes/simple": "bar"}, + {"now-with-dashes/now-with-dashes": "bar"}, + {"now.with.dots/simple": "bar"}, + {"now-with.dashes-and.dots/simple": "bar"}, + {"1-num.2-num/3-num": "bar"}, + {"1234/5678": "bar"}, + {"1.2.3.4/5678": "bar"}, + {"UpperCase123": "bar"}, + {"a": strings.Repeat("b", TotalAnnotationSizeLimitB-1)}, + { + "a": strings.Repeat("b", TotalAnnotationSizeLimitB/2-1), + "c": strings.Repeat("d", TotalAnnotationSizeLimitB/2-1), + }, + } + for i := range successCases { + errs := ValidateAnnotations(successCases[i], field.NewPath("field")) + if len(errs) != 0 { + t.Errorf("case[%d] expected success, got %#v", i, errs) + } + } + + nameErrorCases := []struct { + annotations map[string]string + expect string + }{ + {map[string]string{"nospecialchars^=@": "bar"}, namePartErrMsg}, + {map[string]string{"cantendwithadash-": "bar"}, namePartErrMsg}, + {map[string]string{"only/one/slash": "bar"}, nameErrMsg}, + {map[string]string{strings.Repeat("a", 254): "bar"}, maxLengthErrMsg}, + } + for i := range nameErrorCases { + errs := ValidateAnnotations(nameErrorCases[i].annotations, field.NewPath("field")) + if len(errs) != 1 { + t.Errorf("case[%d]: expected failure", i) + } else { + if !strings.Contains(errs[0].Detail, nameErrorCases[i].expect) { + t.Errorf("case[%d]: error details do not include %q: %q", i, nameErrorCases[i].expect, errs[0].Detail) + } + } + } + totalSizeErrorCases := []map[string]string{ + {"a": strings.Repeat("b", TotalAnnotationSizeLimitB)}, + { + "a": strings.Repeat("b", TotalAnnotationSizeLimitB/2), + "c": strings.Repeat("d", TotalAnnotationSizeLimitB/2), + }, + } + for i := range totalSizeErrorCases { + errs := ValidateAnnotations(totalSizeErrorCases[i], field.NewPath("field")) + if len(errs) != 1 { + t.Errorf("case[%d] expected failure", i) + } + } +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/path/name.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/path/name.go new file mode 100644 index 00000000000..ffb9f56d800 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/path/name.go @@ -0,0 +1,68 @@ +/* +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 path + +import ( + "fmt" + "strings" +) + +// NameMayNotBe specifies strings that cannot be used as names specified as path segments (like the REST API or etcd store) +var NameMayNotBe = []string{".", ".."} + +// NameMayNotContain specifies substrings that cannot be used in names specified as path segments (like the REST API or etcd store) +var NameMayNotContain = []string{"/", "%"} + +// IsValidPathSegmentName validates the name can be safely encoded as a path segment +func IsValidPathSegmentName(name string) []string { + for _, illegalName := range NameMayNotBe { + if name == illegalName { + return []string{fmt.Sprintf(`may not be '%s'`, illegalName)} + } + } + + var errors []string + for _, illegalContent := range NameMayNotContain { + if strings.Contains(name, illegalContent) { + errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent)) + } + } + + return errors +} + +// IsValidPathSegmentPrefix validates the name can be used as a prefix for a name which will be encoded as a path segment +// It does not check for exact matches with disallowed names, since an arbitrary suffix might make the name valid +func IsValidPathSegmentPrefix(name string) []string { + var errors []string + for _, illegalContent := range NameMayNotContain { + if strings.Contains(name, illegalContent) { + errors = append(errors, fmt.Sprintf(`may not contain '%s'`, illegalContent)) + } + } + + return errors +} + +// ValidatePathSegmentName validates the name can be safely encoded as a path segment +func ValidatePathSegmentName(name string, prefix bool) []string { + if prefix { + return IsValidPathSegmentPrefix(name) + } + + return IsValidPathSegmentName(name) +} diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/path/name_test.go b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/path/name_test.go new file mode 100644 index 00000000000..42890527388 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/api/validation/path/name_test.go @@ -0,0 +1,168 @@ +/* +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 path + +import ( + "strings" + "testing" +) + +func TestValidatePathSegmentName(t *testing.T) { + testcases := map[string]struct { + Name string + Prefix bool + ExpectedMsg string + }{ + "empty": { + Name: "", + Prefix: false, + ExpectedMsg: "", + }, + "empty,prefix": { + Name: "", + Prefix: true, + ExpectedMsg: "", + }, + + "valid": { + Name: "foo.bar.baz", + Prefix: false, + ExpectedMsg: "", + }, + "valid,prefix": { + Name: "foo.bar.baz", + Prefix: true, + ExpectedMsg: "", + }, + + // Make sure mixed case, non DNS subdomain characters are tolerated + "valid complex": { + Name: "sha256:ABCDEF012345@ABCDEF012345", + Prefix: false, + ExpectedMsg: "", + }, + // Make sure non-ascii characters are tolerated + "valid extended charset": { + Name: "Iñtërnâtiônàlizætiøn", + Prefix: false, + ExpectedMsg: "", + }, + + "dot": { + Name: ".", + Prefix: false, + ExpectedMsg: ".", + }, + "dot leading": { + Name: ".test", + Prefix: false, + ExpectedMsg: "", + }, + "dot,prefix": { + Name: ".", + Prefix: true, + ExpectedMsg: "", + }, + + "dot dot": { + Name: "..", + Prefix: false, + ExpectedMsg: "..", + }, + "dot dot leading": { + Name: "..test", + Prefix: false, + ExpectedMsg: "", + }, + "dot dot,prefix": { + Name: "..", + Prefix: true, + ExpectedMsg: "", + }, + + "slash": { + Name: "foo/bar", + Prefix: false, + ExpectedMsg: "/", + }, + "slash,prefix": { + Name: "foo/bar", + Prefix: true, + ExpectedMsg: "/", + }, + + "percent": { + Name: "foo%bar", + Prefix: false, + ExpectedMsg: "%", + }, + "percent,prefix": { + Name: "foo%bar", + Prefix: true, + ExpectedMsg: "%", + }, + } + + for k, tc := range testcases { + msgs := ValidatePathSegmentName(tc.Name, tc.Prefix) + if len(tc.ExpectedMsg) == 0 && len(msgs) > 0 { + t.Errorf("%s: expected no message, got %v", k, msgs) + } + if len(tc.ExpectedMsg) > 0 && len(msgs) == 0 { + t.Errorf("%s: expected error message, got none", k) + } + if len(tc.ExpectedMsg) > 0 && !strings.Contains(msgs[0], tc.ExpectedMsg) { + t.Errorf("%s: expected message containing %q, got %v", k, tc.ExpectedMsg, msgs[0]) + } + } +} + +func TestValidateWithMultiErrors(t *testing.T) { + testcases := map[string]struct { + Name string + Prefix bool + ExpectedMsg []string + }{ + "slash,percent": { + Name: "foo//bar%", + Prefix: false, + ExpectedMsg: []string{"may not contain '/'", "may not contain '%'"}, + }, + "slash,percent,prefix": { + Name: "foo//bar%", + Prefix: true, + ExpectedMsg: []string{"may not contain '/'", "may not contain '%'"}, + }, + } + + for k, tc := range testcases { + msgs := ValidatePathSegmentName(tc.Name, tc.Prefix) + if len(tc.ExpectedMsg) == 0 && len(msgs) > 0 { + t.Errorf("%s: expected no message, got %v", k, msgs) + } + if len(tc.ExpectedMsg) > 0 && len(msgs) == 0 { + t.Errorf("%s: expected error message, got none", k) + } + if len(tc.ExpectedMsg) > 0 { + for i := 0; i < len(tc.ExpectedMsg); i++ { + if msgs[i] != tc.ExpectedMsg[i] { + t.Errorf("%s: expected message containing %q, got %v", k, tc.ExpectedMsg[i], msgs[i]) + } + } + } + } +} diff --git a/third_party/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto b/third_party/protobuf/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto similarity index 98% rename from third_party/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto rename to third_party/protobuf/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto index 8824c98a997..2b95700f720 100644 --- a/third_party/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto @@ -1,7 +1,18 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/zero. +/* +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. +*/ // This file was autogenerated by go-to-protobuf. Do not edit it manually! @@ -23,6 +34,7 @@ message APIGroup { optional string name = 1; // versions are the versions supported in this group. + // +listType=atomic repeated GroupVersionForDiscovery versions = 2; // preferredVersion is the version preferred by the API server, which @@ -38,6 +50,7 @@ message APIGroup { // 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. // +optional + // +listType=atomic repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 4; } @@ -45,6 +58,7 @@ message APIGroup { // /apis. message APIGroupList { // groups is a list of APIGroup. + // +listType=atomic repeated APIGroup groups = 1; } @@ -77,9 +91,11 @@ message APIResource { optional Verbs verbs = 4; // shortNames is a list of suggested short names of the resource. + // +listType=atomic repeated string shortNames = 5; // categories is a list of the grouped resources this resource belongs to (e.g. 'all') + // +listType=atomic repeated string categories = 7; // The hash value of the storage version, the version this resource is @@ -101,6 +117,7 @@ message APIResourceList { optional string groupVersion = 1; // resources contains the name of the resources and if they are namespaced. + // +listType=atomic repeated APIResource resources = 2; } @@ -111,6 +128,7 @@ message APIResourceList { // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object message APIVersions { // versions are the api versions that are available. + // +listType=atomic repeated string versions = 1; // a map of client CIDR to server address that is serving this group. @@ -120,6 +138,7 @@ message APIVersions { // 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. + // +listType=atomic repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 2; } @@ -134,6 +153,7 @@ message ApplyOptions { // request. Valid values are: // - All: all dry run stages will be processed // +optional + // +listType=atomic repeated string dryRun = 1; // Force is going to "force" Apply requests. It means user will @@ -224,6 +244,7 @@ message CreateOptions { // request. Valid values are: // - All: all dry run stages will be processed // +optional + // +listType=atomic repeated string dryRun = 1; // fieldManager is a name associated with the actor or entity @@ -292,6 +313,7 @@ message DeleteOptions { // request. Valid values are: // - All: all dry run stages will be processed // +optional + // +listType=atomic repeated string dryRun = 5; } @@ -407,6 +429,7 @@ message LabelSelector { // matchExpressions is a list of label selector requirements. The requirements are ANDed. // +optional + // +listType=atomic repeated LabelSelectorRequirement matchExpressions = 2; } @@ -425,6 +448,7 @@ message LabelSelectorRequirement { // the values array must be empty. This array is replaced during a strategic // merge patch. // +optional + // +listType=atomic repeated string values = 3; } @@ -777,6 +801,8 @@ message ObjectMeta { // +optional // +patchMergeKey=uid // +patchStrategy=merge + // +listType=map + // +listMapKey=uid repeated OwnerReference ownerReferences = 13; // Must be empty before the object is deleted from the registry. Each entry @@ -794,6 +820,7 @@ message ObjectMeta { // are not vulnerable to ordering changes in the list. // +optional // +patchStrategy=merge + // +listType=set repeated string finalizers = 14; // ManagedFields maps workflow-id and version to the set of fields @@ -805,6 +832,7 @@ message ObjectMeta { // workflow used when modifying the object. // // +optional + // +listType=atomic repeated ManagedFieldsEntry managedFields = 17; } @@ -879,6 +907,7 @@ message PatchOptions { // request. Valid values are: // - All: all dry run stages will be processed // +optional + // +listType=atomic repeated string dryRun = 1; // Force is going to "force" Apply requests. It means user will @@ -932,6 +961,7 @@ message Preconditions { // For example: "/healthz", "/apis". message RootPaths { // paths are the paths available at root. + // +listType=atomic repeated string paths = 1; } @@ -974,6 +1004,7 @@ message Status { // is not guaranteed to conform to any schema except that defined by // the reason type. // +optional + // +listType=atomic optional StatusDetails details = 5; // Suggested HTTP return code for this status, 0 if not set. @@ -1038,6 +1069,7 @@ message StatusDetails { // The Causes array includes more details associated with the StatusReason // failure. Not all StatusReasons may provide detailed causes. // +optional + // +listType=atomic repeated StatusCause causes = 4; // If specified, the time in seconds before the operation should be retried. Some errors may indicate @@ -1124,6 +1156,7 @@ message UpdateOptions { // request. Valid values are: // - All: all dry run stages will be processed // +optional + // +listType=atomic repeated string dryRun = 1; // fieldManager is a name associated with the actor or entity diff --git a/third_party/k8s.io/apimachinery/pkg/runtime/generated.proto b/third_party/protobuf/k8s.io/apimachinery/pkg/runtime/generated.proto similarity index 86% rename from third_party/k8s.io/apimachinery/pkg/runtime/generated.proto rename to third_party/protobuf/k8s.io/apimachinery/pkg/runtime/generated.proto index 9f0e98684db..5f06cc5743d 100644 --- a/third_party/k8s.io/apimachinery/pkg/runtime/generated.proto +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/runtime/generated.proto @@ -1,7 +1,18 @@ -// Copyright 2022 Lingfei Kong . All rights reserved. -// Use of this source code is governed by a MIT style -// license that can be found in the LICENSE file. The original repo for -// this file is https://github.com/superproj/zero. +/* +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. +*/ // This file was autogenerated by go-to-protobuf. Do not edit it manually! diff --git a/third_party/protobuf/k8s.io/apimachinery/pkg/runtime/schema/generated.proto b/third_party/protobuf/k8s.io/apimachinery/pkg/runtime/schema/generated.proto new file mode 100644 index 00000000000..01a9c01e5c8 --- /dev/null +++ b/third_party/protobuf/k8s.io/apimachinery/pkg/runtime/schema/generated.proto @@ -0,0 +1,26 @@ +/* +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. +*/ + + +// This file was autogenerated by go-to-protobuf. Do not edit it manually! + +syntax = "proto2"; + +package k8s.io.apimachinery.pkg.runtime.schema; + +// Package-wide variables from generator "generated". +option go_package = "k8s.io/apimachinery/pkg/runtime/schema"; + diff --git a/third_party/openapi/v3/annotations.proto b/third_party/protobuf/openapi/v3/annotations.proto similarity index 100% rename from third_party/openapi/v3/annotations.proto rename to third_party/protobuf/openapi/v3/annotations.proto diff --git a/third_party/openapi/v3/openapi.proto b/third_party/protobuf/openapi/v3/openapi.proto similarity index 100% rename from third_party/openapi/v3/openapi.proto rename to third_party/protobuf/openapi/v3/openapi.proto diff --git a/third_party/validate/README.md b/third_party/protobuf/validate/README.md similarity index 100% rename from third_party/validate/README.md rename to third_party/protobuf/validate/README.md diff --git a/third_party/validate/validate.proto b/third_party/protobuf/validate/validate.proto similarity index 100% rename from third_party/validate/validate.proto rename to third_party/protobuf/validate/validate.proto