From ca329c7d4974208228f3796d3081ee51fb5b2a88 Mon Sep 17 00:00:00 2001 From: Shawn Hsu Date: Sun, 16 Feb 2025 02:30:14 +0800 Subject: [PATCH 1/2] Rename k8 crd client-go --- README.md | 2 +- {k8s-test => k8s-crd}/README.md | 0 {k8s-test => k8s-crd}/crd/crd.go | 0 k8s-crd/crd/crd.yaml | 123 +++++++++++++++++ {k8s-test => k8s-crd}/go.mod | 0 {k8s-test => k8s-crd}/go.sum | 0 {k8s-test => k8s-crd}/main.go | 0 {k8s-test => k8s-crd}/service/service.go | 0 {k8s-test => k8s-crd}/service/service_test.go | 0 k8s-test/crd/crd.yaml | 125 ------------------ 10 files changed, 124 insertions(+), 126 deletions(-) rename {k8s-test => k8s-crd}/README.md (100%) rename {k8s-test => k8s-crd}/crd/crd.go (100%) create mode 100644 k8s-crd/crd/crd.yaml rename {k8s-test => k8s-crd}/go.mod (100%) rename {k8s-test => k8s-crd}/go.sum (100%) rename {k8s-test => k8s-crd}/main.go (100%) rename {k8s-test => k8s-crd}/service/service.go (100%) rename {k8s-test => k8s-crd}/service/service_test.go (100%) delete mode 100644 k8s-test/crd/crd.yaml diff --git a/README.md b/README.md index 385654e..acc21bc 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,6 @@ This repo contains the programming labs for [ambersun1234.github.io](https://amb + [Redis Cluster](./redis-cluster/) + [MinIO Webhook](./minio-webhook/) + [K8s Controller](./k8s-controller/) -+ [K8s Test](./k8s-test/) ++ [K8s CRD](./k8s-crd/) + [Argo Workflows](./argo-workflow/) + [uptrace](./uptrace-slog/) diff --git a/k8s-test/README.md b/k8s-crd/README.md similarity index 100% rename from k8s-test/README.md rename to k8s-crd/README.md diff --git a/k8s-test/crd/crd.go b/k8s-crd/crd/crd.go similarity index 100% rename from k8s-test/crd/crd.go rename to k8s-crd/crd/crd.go diff --git a/k8s-crd/crd/crd.yaml b/k8s-crd/crd/crd.yaml new file mode 100644 index 0000000..1b5e187 --- /dev/null +++ b/k8s-crd/crd/crd.yaml @@ -0,0 +1,123 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: foos.foo.example.com +spec: + group: foo.example.com + names: + kind: Foo + listKind: FooList + plural: foos + singular: foo + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: Foo is the Schema for the foos 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: FooSpec defines the desired state of Foo + properties: + value: + description: Foo is an example field of Foo. Edit foo_types.go to + remove/update + type: string + type: object + status: + description: FooStatus defines the observed state of Foo + properties: + conditions: + items: + description: "Condition contains details for one aspect of the current + state of this API Resource.\n---\nThis struct is intended for + direct use as an array at the field path .status.conditions. For + example,\n\n\n\ttype FooStatus struct{\n\t // Represents the + observations of a foo's current state.\n\t // Known .status.conditions.type + are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // + +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t + \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" + patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t + \ // other fields\n\t}" + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from one status to another. + This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + --- + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be + useful (see .node.status.conditions), the ability to deconflict is important. + The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/k8s-test/go.mod b/k8s-crd/go.mod similarity index 100% rename from k8s-test/go.mod rename to k8s-crd/go.mod diff --git a/k8s-test/go.sum b/k8s-crd/go.sum similarity index 100% rename from k8s-test/go.sum rename to k8s-crd/go.sum diff --git a/k8s-test/main.go b/k8s-crd/main.go similarity index 100% rename from k8s-test/main.go rename to k8s-crd/main.go diff --git a/k8s-test/service/service.go b/k8s-crd/service/service.go similarity index 100% rename from k8s-test/service/service.go rename to k8s-crd/service/service.go diff --git a/k8s-test/service/service_test.go b/k8s-crd/service/service_test.go similarity index 100% rename from k8s-test/service/service_test.go rename to k8s-crd/service/service_test.go diff --git a/k8s-test/crd/crd.yaml b/k8s-test/crd/crd.yaml deleted file mode 100644 index 0134a05..0000000 --- a/k8s-test/crd/crd.yaml +++ /dev/null @@ -1,125 +0,0 @@ ---- - apiVersion: apiextensions.k8s.io/v1 - kind: CustomResourceDefinition - metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.14.0 - name: foos.foo.example.com - spec: - group: foo.example.com - names: - kind: Foo - listKind: FooList - plural: foos - singular: foo - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - description: Foo is the Schema for the foos 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: FooSpec defines the desired state of Foo - properties: - value: - description: Foo is an example field of Foo. Edit foo_types.go to - remove/update - type: string - type: object - status: - description: FooStatus defines the observed state of Foo - properties: - conditions: - items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} - \ No newline at end of file From f67efb296c528f49d90b8a6e7f289fe3d7789ca5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2025 18:32:04 +0000 Subject: [PATCH 2/2] Bump golang.org/x/net from 0.27.0 to 0.33.0 in /golang-dig Bumps [golang.org/x/net](https://github.com/golang/net) from 0.27.0 to 0.33.0. - [Commits](https://github.com/golang/net/compare/v0.27.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-type: indirect ... Signed-off-by: dependabot[bot] --- golang-dig/go.mod | 2 +- golang-dig/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/golang-dig/go.mod b/golang-dig/go.mod index 08945b5..0417979 100644 --- a/golang-dig/go.mod +++ b/golang-dig/go.mod @@ -29,7 +29,7 @@ require ( github.com/ugorji/go/codec v1.2.12 // indirect golang.org/x/arch v0.8.0 // indirect golang.org/x/crypto v0.31.0 // indirect - golang.org/x/net v0.27.0 // indirect + golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect google.golang.org/protobuf v1.34.2 // indirect diff --git a/golang-dig/go.sum b/golang-dig/go.sum index d006a71..0638615 100644 --- a/golang-dig/go.sum +++ b/golang-dig/go.sum @@ -70,8 +70,8 @@ golang.org/x/arch v0.8.0 h1:3wRIsP3pM4yUptoR96otTUOXI367OS0+c9eeRi9doIc= golang.org/x/arch v0.8.0/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= +golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=