Skip to content

Commit

Permalink
refactor: bump operator-go to 0.12-dev (#163)
Browse files Browse the repository at this point in the history
* refactor: bump domain to kubedoop.dev

* bump(deps): bump operator-go to 0.12-dev
  • Loading branch information
lwpk110 authored Nov 19, 2024
1 parent 73ae04d commit bbbf330
Show file tree
Hide file tree
Showing 55 changed files with 341 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ body:
- type: markdown
attributes:
value: |
First, check out our [Collaboration Guide](https://zncdata.dev/docs/developer-manual/collaboration)
First, check out our [Collaboration Guide](https://kubedoop.dev/docs/developer-manual/collaboration)
Please provide a searchable summary of the issue in the title above ⬆️.
- type: dropdown
attributes:
Expand Down
43 changes: 22 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ docker-push: ## Push docker image with the manager.
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' build/Dockerfile > Dockerfile.cross
- $(CONTAINER_TOOL) buildx create --name $(PROJECT_NAME)-builder
$(CONTAINER_TOOL) buildx use $(PROJECT_NAME)-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
Expand Down Expand Up @@ -266,26 +266,6 @@ mv $(1) $(1)-$(3) ;\
ln -sf $(1)-$(3) $(1)
endef

HELM_DEPENDS ?= commons-operator listener-operator
TEST_NAMESPACE = kubedoop-operators

.PHONY: helm-install-depends
helm-install-depends: helm ## Install the helm chart depends.
$(HELM) repo add kubedoop https://zncdatadev.github.io/kubedoop-helm-charts/
ifneq ($(strip $(HELM_DEPENDS)),)
for dep in $(HELM_DEPENDS); do \
$(HELM) upgrade --install --create-namespace --namespace $(TEST_NAMESPACE) --wait $$dep kubedoop/$$dep --version $(VERSION); \
done
endif

## helm uninstall depends
.PHONY: helm-uninstall-depends
helm-uninstall-depends: helm ## Uninstall the helm chart depends.
ifneq ($(strip $(HELM_DEPENDS)),)
for dep in $(HELM_DEPENDS); do \
$(HELM) uninstall --namespace $(TEST_NAMESPACE) $$dep; \
done
endif

##@ Chainsaw-E2E

Expand All @@ -298,6 +278,9 @@ KIND_KUBECONFIG ?= ./kind-kubeconfig-$(KINDTEST_K8S_VERSION)
KIND_CLUSTER_NAME ?= ${PROJECT_NAME}-$(KINDTEST_K8S_VERSION)
KIND_CONFIG ?= test/e2e/kind-config.yaml

HELM_DEPENDS ?= commons-operator listener-operator
TEST_NAMESPACE = kubedoop-operators

CHAINSAW = $(LOCALBIN)/chainsaw

# Create a kind cluster
Expand All @@ -309,6 +292,24 @@ kind-create: kind ## Create a kind cluster.
kind-delete: kind ## Delete a kind cluster.
$(KIND) delete cluster --name $(KIND_CLUSTER_NAME)

.PHONY: helm-install-depends
helm-install-depends: helm ## Install the helm chart depends.
$(HELM) repo add kubedoop https://zncdatadev.github.io/kubedoop-helm-charts/
ifneq ($(strip $(HELM_DEPENDS)),)
for dep in $(HELM_DEPENDS); do \
$(HELM) upgrade --install --create-namespace --namespace $(TEST_NAMESPACE) --wait $$dep kubedoop/$$dep --version $(VERSION); \
done
endif

## helm uninstall depends
.PHONY: helm-uninstall-depends
helm-uninstall-depends: helm ## Uninstall the helm chart depends.
ifneq ($(strip $(HELM_DEPENDS)),)
for dep in $(HELM_DEPENDS); do \
$(HELM) uninstall --namespace $(TEST_NAMESPACE) $$dep; \
done
endif

# chainsaw

# Use `grep 0.2.6 > /dev/null` instead of `grep -q 0.2.6`. It will not be able to determine the version number,
Expand Down
6 changes: 3 additions & 3 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: zncdata.dev
domain: kubedoop.dev
layout:
- go.kubebuilder.io/v4
projectName: secret-operator
Expand All @@ -12,7 +12,7 @@ resources:
crdVersion: v1
namespaced: true
controller: true
domain: zncdata.dev
domain: kubedoop.dev
group: secrets
kind: SecretClass
path: github.com/zncdatadev/secret-operator/api/v1alpha1
Expand All @@ -21,7 +21,7 @@ resources:
crdVersion: v1
namespaced: true
controller: true
domain: zncdata.dev
domain: kubedoop.dev
group: secrets
kind: SecretCSI
path: github.com/zncdatadev/secret-operator/api/v1alpha1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Kubedoop built-in operators:

## Contributing

If you'd like to contribute to Kubedoop, please refer to our [Contributing Guide](https://zncdata.dev/docs/developer-manual/collaboration) for more information.
If you'd like to contribute to Kubedoop, please refer to our [Contributing Guide](https://kubedoop.dev/docs/developer-manual/collaboration) for more information.
We welcome contributions of all kinds, including but not limited to code, documentation, and use cases.

## License
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.

// Package v1alpha1 contains API Schema definitions for the secrets v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=secrets.zncdata.dev
// +groupName=secrets.kubedoop.dev
package v1alpha1

import (
Expand All @@ -26,7 +26,7 @@ import (

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "secrets.zncdata.dev", Version: "v1alpha1"}
GroupVersion = schema.GroupVersion{Group: "secrets.kubedoop.dev", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
Expand Down
2 changes: 1 addition & 1 deletion cmd/csi_driver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func main() {
Scheme: scheme,
HealthProbeBindAddress: *probeAddr,
LeaderElection: *enableLeaderElection,
LeaderElectionID: "8b74b19a.zncdata.dev",
LeaderElectionID: "8b74b19a.kubedoop.dev",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func main() {
HealthProbeBindAddress: *probeAddr,
LeaderElection: *enableLeaderElection,
WebhookServer: webhookServer,
LeaderElectionID: "8b74b19a.zncdata.dev",
LeaderElectionID: "8b74b19a.kubedoop.dev",
// LeaderElectionReleaseOnCancel defines if the leader should step down voluntarily
// when the Manager ends. This requires the binary to immediately end when the
// Manager is stopped, otherwise, this setting is unsafe. Setting this significantly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: secretclasses.secrets.zncdata.dev
name: secretclasses.secrets.kubedoop.dev
spec:
group: secrets.zncdata.dev
group: secrets.kubedoop.dev
names:
kind: SecretClass
listKind: SecretClassList
Expand Down
199 changes: 199 additions & 0 deletions config/crd/bases/secrets.kubedoop.dev_secretclasses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: secretclasses.secrets.kubedoop.dev
spec:
group: secrets.kubedoop.dev
names:
kind: SecretClass
listKind: SecretClassList
plural: secretclasses
singular: secretclass
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: SecretClass is the Schema for the secretclasses 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: SecretClassSpec defines the desired state of SecretClass
properties:
backend:
properties:
autoTls:
properties:
ca:
properties:
autoGenerated:
default: false
type: boolean
caCertificateLifeTime:
default: 8760h
description: |-
Use time.ParseDuration to parse the string
Default is 8760h (1 year)
type: string
secret:
properties:
name:
type: string
namespace:
type: string
required:
- name
- namespace
type: object
required:
- secret
type: object
maxCertificateLifeTime:
default: 360h
description: |-
Use time.ParseDuration to parse the string
Default is 360h (15 days)
type: string
required:
- ca
type: object
k8sSearch:
properties:
searchNamespace:
properties:
name:
type: string
pod:
type: object
type: object
required:
- searchNamespace
type: object
kerberosKeytab:
properties:
adminKeytabSecret:
properties:
name:
description: Contains the `keytab` name of the secret
type: string
namespace:
type: string
required:
- name
- namespace
type: object
adminPrincipal:
type: string
adminServer:
properties:
mit:
properties:
kadminServer:
type: string
required:
- kadminServer
type: object
required:
- mit
type: object
kdc:
type: string
realm:
type: string
required:
- adminKeytabSecret
- adminPrincipal
- adminServer
- kdc
- realm
type: object
type: object
type: object
status:
description: SecretClassStatus defines the observed state of SecretClass
properties:
conditions:
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.5
name: secretcsis.secrets.zncdata.dev
name: secretcsis.secrets.kubedoop.dev
spec:
group: secrets.zncdata.dev
group: secrets.kubedoop.dev
names:
kind: SecretCSI
listKind: SecretCSIList
Expand Down
4 changes: 2 additions & 2 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# since it depends on service name and namespace that are out of this kustomize package.
# It should be run by config/default
resources:
- bases/secrets.zncdata.dev_secretclasses.yaml
- bases/secrets.zncdata.dev_secretcsis.yaml
- bases/secrets.kubedoop.dev_secretclasses.yaml
- bases/secrets.kubedoop.dev_secretcsis.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patches:
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_secretclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
name: secretclasses.secrets.zncdata.dev
name: secretclasses.secrets.kubedoop.dev
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_secretcsis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME
name: secretcsis.secrets.zncdata.dev
name: secretcsis.secrets.kubedoop.dev
Loading

0 comments on commit bbbf330

Please sign in to comment.