diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml new file mode 100644 index 0000000000..f389d442e1 --- /dev/null +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_redisclusters.redis.cnrm.cloud.google.com.yaml @@ -0,0 +1,349 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cnrm.cloud.google.com/version: 0.0.0-dev + creationTimestamp: null + labels: + cnrm.cloud.google.com/managed-by-kcc: "true" + cnrm.cloud.google.com/system: "true" + name: redisclusters.redis.cnrm.cloud.google.com +spec: + group: redis.cnrm.cloud.google.com + names: + categories: + - gcp + kind: RedisCluster + listKind: RedisClusterList + plural: redisclusters + singular: rediscluster + preserveUnknownFields: false + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: When 'True', the most recent reconcile of the resource succeeded + jsonPath: .status.conditions[?(@.type=='Ready')].status + name: Ready + type: string + - description: The reason for the value in 'Ready' + jsonPath: .status.conditions[?(@.type=='Ready')].reason + name: Status + type: string + - description: The last transition time for the value in 'Status' + jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime + name: Status Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: RedisCluster is the Schema for the RedisCluster API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: RedisClusterSpec defines the desired state of RedisCluster + properties: + authorizationMode: + description: Optional. The authorization mode of the Redis cluster. + If not provided, auth feature is disabled for the cluster. + type: string + deletionProtectionEnabled: + description: Optional. The delete operation will fail when the value + is set to true. + type: boolean + nodeType: + description: Optional. The type of a redis node in the cluster. NodeType + determines the underlying machine-type of a redis node. + type: string + persistenceConfig: + description: Optional. Persistence config (RDB, AOF) for the cluster. + properties: + aofConfig: + description: Optional. AOF configuration. This field will be ignored + if mode is not AOF. + properties: + appendFsync: + description: Optional. fsync configuration. + type: string + type: object + mode: + description: Optional. The mode of persistence. + type: string + rdbConfig: + description: Optional. RDB configuration. This field will be ignored + if mode is not RDB. + properties: + rdbSnapshotPeriod: + description: Optional. Period between RDB snapshots. + type: string + rdbSnapshotStartTime: + description: Optional. The time that the first snapshot was/will + be attempted, and to which future snapshots will be aligned. + If not provided, the current time will be used. + type: string + type: object + type: object + pscConfigs: + description: Required. Each PscConfig configures the consumer network + where IPs will be designated to the cluster for client access through + Private Service Connect Automation. Currently, only one PscConfig + is supported. + items: + properties: + networkRef: + description: Required. The network where the IP address of the + discovery endpoint will be reserved, in the form of projects/{network_project}/global/networks/{network_id}. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The compute network selflink of form "projects//global/networks/", + when not managed by KCC. + type: string + name: + description: The `name` field of a `ComputeNetwork` resource. + type: string + namespace: + description: The `namespace` field of a `ComputeNetwork` + resource. + type: string + type: object + type: object + type: array + redisConfigs: + additionalProperties: + type: string + description: Optional. Key/Value pairs of customer overrides for mutable + Redis Configs + type: object + replicaCount: + description: Optional. The number of replica nodes per shard. + format: int32 + type: integer + resourceID: + description: The RedisCluster name. If not given, the metadata.name + will be used. + type: string + shardCount: + description: Required. Number of shards for the Redis cluster. + format: int32 + type: integer + transitEncryptionMode: + description: Optional. The in-transit encryption for the Redis cluster. + If not provided, encryption is disabled for the cluster. + type: string + zoneDistributionConfig: + description: Optional. This config will be used to determine how the + customer wants us to distribute cluster resources within the region. + properties: + mode: + description: Optional. The mode of zone distribution. Defaults + to MULTI_ZONE, when not specified. + type: string + zone: + description: Optional. When SINGLE ZONE distribution is selected, + zone field would be used to allocate all resources in that zone. + This is not applicable to MULTI_ZONE, and would be ignored for + MULTI_ZONE clusters. + type: string + type: object + type: object + status: + description: RedisClusterStatus defines the config connector machine state + of RedisCluster + properties: + conditions: + description: Conditions represent the latest available observations + of the object's current state. + items: + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. + type: string + message: + description: Human-readable message indicating details about + last transition. + type: string + reason: + description: Unique, one-word, CamelCase reason for the condition's + last transition. + type: string + status: + description: Status is the status of the condition. Can be True, + False, Unknown. + type: string + type: + description: Type is the type of the condition. + type: string + type: object + type: array + externalRef: + description: A unique specifier for the RedisCluster resource in GCP. + type: string + observedGeneration: + description: ObservedGeneration is the generation of the resource + that was most recently observed by the Config Connector controller. + If this is equal to metadata.generation, then that means that the + current reported status reflects the most recent desired state of + the resource. + format: int64 + type: integer + observedState: + description: ObservedState is the state of the resource as most recently + observed in GCP. + properties: + createTime: + description: Output only. The timestamp associated with the cluster + creation request. + type: string + discoveryEndpoints: + description: Output only. Endpoints created on each given network, + for Redis clients to connect to the cluster. Currently only + one discovery endpoint is supported. + items: + properties: + address: + description: Output only. Address of the exposed Redis endpoint + used by clients to connect to the service. The address + could be either IP or hostname. + type: string + port: + description: Output only. The port number of the exposed + Redis endpoint. + format: int32 + type: integer + pscConfig: + description: Output only. Customer configuration for where + the endpoint is created and accessed from. + properties: + networkRef: + description: Required. The network where the IP address + of the discovery endpoint will be reserved, in the + form of projects/{network_project}/global/networks/{network_id}. + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The compute network selflink of form + "projects//global/networks/", + when not managed by KCC. + type: string + name: + description: The `name` field of a `ComputeNetwork` + resource. + type: string + namespace: + description: The `namespace` field of a `ComputeNetwork` + resource. + type: string + type: object + type: object + type: object + type: array + preciseSizeGb: + description: Output only. Precise value of redis memory size in + GB for the entire cluster. + type: number + pscConnections: + description: Output only. PSC connections for discovery of the + cluster topology and accessing the cluster. + items: + properties: + address: + description: Output only. The IP allocated on the consumer + network for the PSC forwarding rule. + type: string + forwardingRule: + description: 'Output only. The URI of the consumer side + forwarding rule. Example: projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.' + type: string + network: + description: The consumer network where the IP address resides, + in the form of projects/{project_id}/global/networks/{network_id}. + type: string + projectID: + description: Output only. The consumer project_id where + the forwarding rule is created from. + type: string + pscConnectionID: + description: Output only. The PSC connection id of the forwarding + rule connected to the service attachment. + type: string + type: object + type: array + sizeGb: + description: Output only. Redis memory size in GB for the entire + cluster rounded up to the next integer. + format: int32 + type: integer + state: + description: Output only. The current state of this cluster. Can + be CREATING, READY, UPDATING, DELETING and SUSPENDED + type: string + stateInfo: + description: Output only. Additional information about the current + state of the cluster. + properties: + updateInfo: + description: Describes ongoing update on the cluster when + cluster state is UPDATING. + properties: + targetReplicaCount: + description: Target number of replica nodes per shard. + format: int32 + type: integer + targetShardCount: + description: Target number of shards for redis cluster + format: int32 + type: integer + type: object + type: object + uid: + description: Output only. System assigned, unique identifier for + the cluster. + type: string + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/pkg/clients/generated/apis/redis/v1alpha1/doc.go b/pkg/clients/generated/apis/redis/v1alpha1/doc.go index a6803c4284..e74be89f6f 100644 --- a/pkg/clients/generated/apis/redis/v1alpha1/doc.go +++ b/pkg/clients/generated/apis/redis/v1alpha1/doc.go @@ -35,7 +35,4 @@ // +k8s:defaulter-gen=TypeMeta // +groupName=redis.cnrm.cloud.google.com -// Generate deepcopy object for redis/v1alpha1 API group -// -//go:generate go run ../../../../../../scripts/deepcopy-gen/main.go -O zz_generated.deepcopy -i . -h ../../../../../../hack/boilerplate_client_alpha.go.txt package v1alpha1 diff --git a/pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go index ea1668fcb2..445fcda59d 100644 --- a/pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/clients/generated/apis/redis/v1alpha1/zz_generated.deepcopy.go @@ -20,7 +20,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by deepcopy-gen. DO NOT EDIT. package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go index 61f2499ab1..d3dac805d0 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/doc.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go index 7a39491606..dfbe79f9af 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/doc.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. // Package fake has the automatically generated clients. package fake diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go index e1907953b0..a96eef0eb8 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_redis_client.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go index 04cf9288af..d3491c0d47 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/fake/fake_rediscluster.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. package fake diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go index 6a3bd5e4a8..1b9ebd92cd 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/generated_expansion.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go index 6a8e6db769..9eba919850 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/redis_client.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go index 7672bfe4d1..b1fdbfa73f 100644 --- a/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go +++ b/pkg/clients/generated/client/clientset/versioned/typed/redis/v1alpha1/rediscluster.go @@ -17,7 +17,7 @@ // that future versions of the go-client may include breaking changes. // Please try it out and give us feedback! -// Code generated by main. DO NOT EDIT. +// Code generated by client-gen. DO NOT EDIT. package v1alpha1 diff --git a/scripts/validate-prereqs.sh b/scripts/validate-prereqs.sh index 44ff977311..af4d9ab869 100755 --- a/scripts/validate-prereqs.sh +++ b/scripts/validate-prereqs.sh @@ -40,22 +40,26 @@ if [[ "${changed_file_count}" != "0" ]]; then fi make manifests changed_file_count=$(git diff --name-only | wc -l) -if [[ "${changed_file_count}" != "0" ]]; then +added_config_file_count=$(git ls-files --others --exclude-standard config/ | wc -l) +if [[ "${changed_file_count}" != "0" ]] || [[ "${added_config_file_count}" != "0" ]]; then echo "Full diff:" git diff echo "ERROR: Manifests must be regenerated. Please run 'make ready-pr' or 'make manifests' and update your PR." echo "Affected files:" git diff --name-only + git ls-files --others --exclude-standard config/ exit 1 fi make generate-go-client changed_file_count=$(git diff --name-only | wc -l) -if [[ "${changed_file_count}" != "0" ]]; then +added_go_client_file_count=$(git ls-files --others --exclude-standard pkg/clients/generated/ | wc -l) +if [[ "${changed_file_count}" != "0" ]] || [[ "${added_go_client_file_count}" != "0" ]]; then echo "Full diff:" git diff echo "ERROR: Resource Go Clients must be regenerated. Please run 'make ready-pr' or 'make generate-go-client' and update your PR." echo "Affected files:" git diff --name-only + git ls-files --others --exclude-standard pkg/clients/generated/ echo "First 100 lines of diff:" git diff | head -n100 exit 1 @@ -75,11 +79,13 @@ if [[ "${changed_file_count}" != "0" ]]; then fi make resource-docs changed_file_count=$(git diff --name-only | wc -l) -if [[ "${changed_file_count}" != "0" ]]; then +added_reference_doc_file_count=$(git ls-files --others --exclude-standard scripts/generate-google3-docs/resource-reference/generated/ | wc -l) +if [[ "${changed_file_count}" != "0" ]] || [[ "${added_reference_doc_file_count}" != "0" ]]; then echo "Full diff:" git diff echo "ERROR: Resource docs must be regenerated. Please run 'make ready-pr' or 'make resource-docs' and update your PR." echo "Affected files:" git diff --name-only + git ls-files --others --exclude-standard scripts/generate-google3-docs/resource-reference/generated/ exit 1 fi