Skip to content

Commit

Permalink
Merge pull request #251 from kannon92/fix-generation
Browse files Browse the repository at this point in the history
Fix generation
  • Loading branch information
k8s-ci-robot authored Aug 8, 2023
2 parents b1f8c2b + ef73ef0 commit 61ad4b0
Show file tree
Hide file tree
Showing 13 changed files with 99 additions and 86 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ code-generator:
openapi-gen:
@GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install k8s.io/code-generator/cmd/openapi-gen@latest
$(PROJECT_DIR)/bin/openapi-gen --go-header-file hack/boilerplate.go.txt -i sigs.k8s.io/jobset/api/jobset/v1alpha2 -p sigs.k8s.io/jobset/api/jobset/v1alpha2 --alsologtostderr

if [ $(GOPATH)/src/sigs.k8s.io/jobset/api/jobset/v1alpha2/openapi_generated.go != $(PROJECT_DIR)/api/jobset/v1alpha2/openapi_generated.go ]; then \
mv $(GOPATH)/src/sigs.k8s.io/jobset/api/jobset/v1alpha2/openapi_generated.go $(PROJECT_DIR)/api/jobset/v1alpha2/openapi_generated.go; \
fi

.PHONY: envtest
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
Expand Down
4 changes: 3 additions & 1 deletion api/jobset/v1alpha2/jobset_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type JobSetStatus struct {
// +optional
// +listType=map
// +listMapKey=name
ReplicatedJobsStatus []ReplicatedJobStatus `json:"ReplicatedJobsStatus,omitempty"`
ReplicatedJobsStatus []ReplicatedJobStatus `json:"replicatedJobsStatus,omitempty"`
}

// ReplicatedJobStatus defines the observed ReplicatedJobs Readiness.
Expand Down Expand Up @@ -172,6 +172,8 @@ type SuccessPolicy struct {

// TargetReplicatedJobs are the names of the replicated jobs the operator will apply to.
// A null or empty list will apply to all replicatedJobs.
// +optional
// +listType=atomic
TargetReplicatedJobs []string `json:"targetReplicatedJobs,omitempty"`
}

Expand Down
7 changes: 6 additions & 1 deletion api/jobset/v1alpha2/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 33 additions & 32 deletions config/components/crd/bases/jobset.x-k8s.io_jobsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9617,6 +9617,7 @@ spec:
items:
type: string
type: array
x-kubernetes-list-type: atomic
required:
- operator
type: object
Expand All @@ -9630,38 +9631,6 @@ spec:
status:
description: JobSetStatus defines the observed state of JobSet
properties:
ReplicatedJobsStatus:
description: ReplicatedJobsStatus track the number of JobsReady for
each replicatedJob.
items:
description: ReplicatedJobStatus defines the observed ReplicatedJobs
Readiness.
properties:
active:
format: int32
type: integer
failed:
format: int32
type: integer
name:
type: string
ready:
format: int32
type: integer
succeeded:
format: int32
type: integer
required:
- active
- failed
- name
- ready
- succeeded
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
conditions:
items:
description: "Condition contains details for one aspect of the current
Expand Down Expand Up @@ -9733,6 +9702,38 @@ spec:
x-kubernetes-list-map-keys:
- type
x-kubernetes-list-type: map
replicatedJobsStatus:
description: ReplicatedJobsStatus track the number of JobsReady for
each replicatedJob.
items:
description: ReplicatedJobStatus defines the observed ReplicatedJobs
Readiness.
properties:
active:
format: int32
type: integer
failed:
format: int32
type: integer
name:
type: string
ready:
format: int32
type: integer
succeeded:
format: int32
type: integer
required:
- active
- failed
- name
- ready
- succeeded
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
restarts:
description: Restarts tracks the number of times the JobSet has restarted
(i.e. recreated in case of RecreateAll policy).
Expand Down
17 changes: 9 additions & 8 deletions hack/python-sdk/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,26 +109,26 @@
"description": "JobSetStatus defines the observed state of JobSet",
"type": "object",
"properties": {
"ReplicatedJobsStatus": {
"description": "ReplicatedJobsStatus track the number of JobsReady for each replicatedJob.",
"conditions": {
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/jobset.v1alpha2.ReplicatedJobStatus"
"$ref": "#/definitions/v1.Condition"
},
"x-kubernetes-list-map-keys": [
"name"
"type"
],
"x-kubernetes-list-type": "map"
},
"conditions": {
"replicatedJobsStatus": {
"description": "ReplicatedJobsStatus track the number of JobsReady for each replicatedJob.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/v1.Condition"
"$ref": "#/definitions/jobset.v1alpha2.ReplicatedJobStatus"
},
"x-kubernetes-list-map-keys": [
"type"
"name"
],
"x-kubernetes-list-type": "map"
},
Expand Down Expand Up @@ -230,7 +230,8 @@
"items": {
"type": "string",
"default": ""
}
},
"x-kubernetes-list-type": "atomic"
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion hack/update-codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ bash "${CODEGEN_PKG}/generate-groups.sh" \
CLIENT_GO=$(find $GOPATH -regextype sed -regex ".*jobset.*client-go")
if [ -z "$CLIENT_GO" ]; then
echo "WARNING: generated client-go files were not found."
elif [ "$CLIENT_GO" -ne "$REPO_ROOT/client-go" ]; then
elif [ "$CLIENT_GO" != "$REPO_ROOT/client-go" ]; then
echo "moving generated files from $CLIENT_GO to $REPO_ROOT/client-go"
rm -rf $REPO_ROOT/client-go
mv -f $CLIENT_GO $REPO_ROOT

fi


2 changes: 1 addition & 1 deletion sdk/python/docs/JobsetV1alpha2JobSetStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ JobSetStatus defines the observed state of JobSet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**replicated_jobs_status** | [**list[JobsetV1alpha2ReplicatedJobStatus]**](JobsetV1alpha2ReplicatedJobStatus.md) | ReplicatedJobsStatus track the number of JobsReady for each replicatedJob. | [optional]
**conditions** | [**list[V1Condition]**](V1Condition.md) | | [optional]
**replicated_jobs_status** | [**list[JobsetV1alpha2ReplicatedJobStatus]**](JobsetV1alpha2ReplicatedJobStatus.md) | ReplicatedJobsStatus track the number of JobsReady for each replicatedJob. | [optional]
**restarts** | **int** | Restarts tracks the number of times the JobSet has restarted (i.e. recreated in case of RecreateAll policy). | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
54 changes: 27 additions & 27 deletions sdk/python/jobset/models/jobset_v1alpha2_job_set_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,35 +33,56 @@ class JobsetV1alpha2JobSetStatus(object):
and the value is json key in definition.
"""
openapi_types = {
'replicated_jobs_status': 'list[JobsetV1alpha2ReplicatedJobStatus]',
'conditions': 'list[V1Condition]',
'replicated_jobs_status': 'list[JobsetV1alpha2ReplicatedJobStatus]',
'restarts': 'int'
}

attribute_map = {
'replicated_jobs_status': 'ReplicatedJobsStatus',
'conditions': 'conditions',
'replicated_jobs_status': 'replicatedJobsStatus',
'restarts': 'restarts'
}

def __init__(self, replicated_jobs_status=None, conditions=None, restarts=None, local_vars_configuration=None): # noqa: E501
def __init__(self, conditions=None, replicated_jobs_status=None, restarts=None, local_vars_configuration=None): # noqa: E501
"""JobsetV1alpha2JobSetStatus - a model defined in OpenAPI""" # noqa: E501
if local_vars_configuration is None:
local_vars_configuration = Configuration()
self.local_vars_configuration = local_vars_configuration

self._replicated_jobs_status = None
self._conditions = None
self._replicated_jobs_status = None
self._restarts = None
self.discriminator = None

if replicated_jobs_status is not None:
self.replicated_jobs_status = replicated_jobs_status
if conditions is not None:
self.conditions = conditions
if replicated_jobs_status is not None:
self.replicated_jobs_status = replicated_jobs_status
if restarts is not None:
self.restarts = restarts

@property
def conditions(self):
"""Gets the conditions of this JobsetV1alpha2JobSetStatus. # noqa: E501
:return: The conditions of this JobsetV1alpha2JobSetStatus. # noqa: E501
:rtype: list[V1Condition]
"""
return self._conditions

@conditions.setter
def conditions(self, conditions):
"""Sets the conditions of this JobsetV1alpha2JobSetStatus.
:param conditions: The conditions of this JobsetV1alpha2JobSetStatus. # noqa: E501
:type: list[V1Condition]
"""

self._conditions = conditions

@property
def replicated_jobs_status(self):
"""Gets the replicated_jobs_status of this JobsetV1alpha2JobSetStatus. # noqa: E501
Expand All @@ -85,27 +106,6 @@ def replicated_jobs_status(self, replicated_jobs_status):

self._replicated_jobs_status = replicated_jobs_status

@property
def conditions(self):
"""Gets the conditions of this JobsetV1alpha2JobSetStatus. # noqa: E501
:return: The conditions of this JobsetV1alpha2JobSetStatus. # noqa: E501
:rtype: list[V1Condition]
"""
return self._conditions

@conditions.setter
def conditions(self, conditions):
"""Sets the conditions of this JobsetV1alpha2JobSetStatus.
:param conditions: The conditions of this JobsetV1alpha2JobSetStatus. # noqa: E501
:type: list[V1Condition]
"""

self._conditions = conditions

@property
def restarts(self):
"""Gets the restarts of this JobsetV1alpha2JobSetStatus. # noqa: E501
Expand Down
1 change: 0 additions & 1 deletion sdk/python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ six >= 1.10
python_dateutil >= 2.5.3
setuptools >= 21.0.0
urllib3 >= 1.15.1
kubernetes
6 changes: 3 additions & 3 deletions sdk/python/test/test_jobset_v1alpha2_job_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ def make_instance(self, include_optional):
], ),
suspend = True, ),
status = jobset.models.jobset_v1alpha2_job_set_status.JobsetV1alpha2JobSetStatus(
conditions = [
None
],
replicated_jobs_status = [
jobset.models.jobset_v1alpha2_replicated_job_status.JobsetV1alpha2ReplicatedJobStatus(
active = 56,
Expand All @@ -68,9 +71,6 @@ def make_instance(self, include_optional):
ready = 56,
succeeded = 56, )
],
conditions = [
None
],
restarts = 56, )
)
else :
Expand Down
12 changes: 6 additions & 6 deletions sdk/python/test/test_jobset_v1alpha2_job_set_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ def make_instance(self, include_optional):
], ),
suspend = True, ),
status = jobset.models.jobset_v1alpha2_job_set_status.JobsetV1alpha2JobSetStatus(
conditions = [
None
],
replicated_jobs_status = [
jobset.models.jobset_v1alpha2_replicated_job_status.JobsetV1alpha2ReplicatedJobStatus(
active = 56,
Expand All @@ -71,9 +74,6 @@ def make_instance(self, include_optional):
ready = 56,
succeeded = 56, )
],
conditions = [
None
],
restarts = 56, ), )
],
kind = '0',
Expand Down Expand Up @@ -105,6 +105,9 @@ def make_instance(self, include_optional):
], ),
suspend = True, ),
status = jobset.models.jobset_v1alpha2_job_set_status.JobsetV1alpha2JobSetStatus(
conditions = [
None
],
replicated_jobs_status = [
jobset.models.jobset_v1alpha2_replicated_job_status.JobsetV1alpha2ReplicatedJobStatus(
active = 56,
Expand All @@ -113,9 +116,6 @@ def make_instance(self, include_optional):
ready = 56,
succeeded = 56, )
],
conditions = [
None
],
restarts = 56, ), )
],
)
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/test/test_jobset_v1alpha2_job_set_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def make_instance(self, include_optional):
# model = jobset.models.jobset_v1alpha2_job_set_status.JobsetV1alpha2JobSetStatus() # noqa: E501
if include_optional :
return JobsetV1alpha2JobSetStatus(
conditions = [
None
],
replicated_jobs_status = [
jobset.models.jobset_v1alpha2_replicated_job_status.JobsetV1alpha2ReplicatedJobStatus(
active = 56,
Expand All @@ -46,9 +49,6 @@ def make_instance(self, include_optional):
ready = 56,
succeeded = 56, )
],
conditions = [
None
],
restarts = 56
)
else :
Expand Down

0 comments on commit 61ad4b0

Please sign in to comment.