Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
vendor/

.idea/

# Python
.ruff_cache/
51 changes: 51 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,57 @@ rm -rf $$TMP_DIR ;\
}
endef

# Update CRD YAML and Go type definitions from upstream openkruise/agents
.PHONY: update-upstream
update-upstream:
@hack/update_upstream.sh

# Generate Java SDK from CRD definitions (requires JDK 8+)
.PHONY: generate-java
generate-java:
@hack/generate_java_sdk.sh
@hack/patch_sdk_types.sh --java

# Generate Python SDK from CRD definitions (requires yq + datamodel-codegen)
.PHONY: generate-python
generate-python:
@hack/generate_python_sdk.sh
@hack/patch_sdk_types.sh --python

# Patch generated SDK types (AnyType → concrete K8s types)
# Usage:
# make patch-sdk-types # patch both Java and Python
# make patch-sdk-types LANG=java # patch Java only
# make patch-sdk-types LANG=python # patch Python only
.PHONY: patch-sdk-types
patch-sdk-types:
ifeq ($(LANG),java)
@hack/patch_sdk_types.sh --java
else ifeq ($(LANG),python)
@hack/patch_sdk_types.sh --python
else
@hack/patch_sdk_types.sh
endif

# Generate all SDKs (Go + Java + Python) and apply type patches
# Usage:
# make generate-all # update upstream + generate all + patch types
# make generate-all SKIP_UPDATE=true # skip upstream update, generate + patch only
.PHONY: generate-all
ifeq ($(SKIP_UPDATE),true)
generate-all:
@hack/generate_client.sh --skip-update
@hack/generate_java_sdk.sh --skip-update
@hack/generate_python_sdk.sh --skip-update
@hack/patch_sdk_types.sh
else
generate-all: update-upstream
@hack/generate_client.sh --skip-update
@hack/generate_java_sdk.sh --skip-update
@hack/generate_python_sdk.sh --skip-update
@hack/patch_sdk_types.sh
endif

.PHONY: gen-schema-only
gen-schema-only:
go run cmd/gen-schema/main.go
Expand Down
102 changes: 102 additions & 0 deletions agents/crds/agents.kruise.io_checkpoints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.18.0
name: checkpoints.agents.kruise.io
spec:
group: agents.kruise.io
names:
kind: Checkpoint
listKind: CheckpointList
plural: checkpoints
shortNames:
- cp
singular: checkpoint
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.phase
name: Status
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: Checkpoint is the Schema for the Checkpoints 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: spec defines the desired state of Checkpoint
properties:
keepRunning:
description: |-
KeepRunning indicates whether the pod remains in the Running state after passing the checkpoint.
Default is true.
type: boolean
persistentContents:
description: 'PersistentContents indicates resume pod with persistent
content, Enum: memory, filesystem'
items:
type: string
type: array
podName:
description: PodName is checkpoint podName.
type: string
sandboxName:
description: SandboxName is checkpoint sandboxName.
type: string
ttlAfterFinished:
description: 'valid format: 30s, 30m, 30d'
type: string
type: object
status:
description: status defines the observed state of Checkpoint
properties:
checkpointId:
description: checkpoint-id
type: string
completionTime:
description: CompletionTime is checkpoint completed time, and phase
is Succeeded or Failed.
format: date-time
type: string
message:
description: message
type: string
observedGeneration:
description: |-
observedGeneration is the most recent generation observed for this Checkpoint. It corresponds to the
Checkpoint's generation, which is updated on mutation by the API Server.
format: int64
type: integer
phase:
description: Checkpoint Phase
type: string
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
Loading