-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
class-generator: update schema and add PodMetrics
#2315
Conversation
WalkthroughThis pull request updates the cluster version file and introduces a new class in the pod metrics module. The version number in Changes
Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (2)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Report bugs in Issues The following are automatically added:
Available user actions:
Supported /retest check runs
Supported labels
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
ocp_resources/pod_metrics.py (2)
10-13
: Enhance the docstring with more details.Consider expanding the docstring to provide more context about pod metrics, such as what metrics are collected, their purpose, and how they are used.
class PodMetrics(NamespacedResource): """ - PodMetrics sets resource usage metrics of a pod. + PodMetrics represents resource usage metrics of a pod, including CPU and memory + consumption of its containers. These metrics are collected within a specified + time window and are used for monitoring, autoscaling, and resource optimization. """
17-42
: Enhance the constructor docstring.The docstring could be improved by:
- Adding return type documentation
- Including type information in parameter descriptions
- Adding examples of valid values
def __init__( self, containers: list[Any] | None = None, timestamp: str | None = None, window: str | None = None, **kwargs: Any, ) -> None: """ + Initialize a PodMetrics instance. + Args: - containers (list[Any]): Metrics for all containers are collected within the same time window. + containers (list[Any] | None): List of container metrics objects. Each object contains + resource usage data (CPU, memory) for a container. + Example: [{"name": "container1", "usage": {"cpu": "100m", "memory": "256Mi"}}] - timestamp (str): Time is a wrapper around time.Time which supports correct marshaling - to YAML and JSON. Wrappers are provided for many of the factory - methods that the time package offers. + timestamp (str | None): RFC3339 timestamp when metrics were collected. + Example: "2024-02-15T10:30:00Z" - window (str): Duration is a wrapper around time.Duration which supports correct - marshaling to YAML and JSON. In particular, it marshals into - strings, which can be used as map keys in json. + window (str | None): Duration over which metrics were collected. + Example: "5m" for 5 minutes + **kwargs (Any): Additional arguments passed to the parent class. + + Returns: + None """
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (205)
class_generator/schema/__not-kind.txt
is excluded by!class_generator/schema/**
class_generator/schema/__resources-mappings.json
is excluded by!class_generator/schema/**
class_generator/schema/_definitions.json
is excluded by!class_generator/schema/**
class_generator/schema/aaq.json
is excluded by!class_generator/schema/**
class_generator/schema/aaqlist.json
is excluded by!class_generator/schema/**
class_generator/schema/all.json
is excluded by!class_generator/schema/**
class_generator/schema/apiresource.json
is excluded by!class_generator/schema/**
class_generator/schema/apiresourcelist.json
is excluded by!class_generator/schema/**
class_generator/schema/backingstore.json
is excluded by!class_generator/schema/**
class_generator/schema/backingstorelist.json
is excluded by!class_generator/schema/**
class_generator/schema/bucketclass.json
is excluded by!class_generator/schema/**
class_generator/schema/bucketclasslist.json
is excluded by!class_generator/schema/**
class_generator/schema/cdi.json
is excluded by!class_generator/schema/**
class_generator/schema/cdiconfig.json
is excluded by!class_generator/schema/**
class_generator/schema/cdiconfiglist.json
is excluded by!class_generator/schema/**
class_generator/schema/cdilist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephblockpool.json
is excluded by!class_generator/schema/**
class_generator/schema/cephblockpoollist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephblockpoolradosnamespace.json
is excluded by!class_generator/schema/**
class_generator/schema/cephblockpoolradosnamespacelist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephbucketnotification.json
is excluded by!class_generator/schema/**
class_generator/schema/cephbucketnotificationlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephbuckettopic.json
is excluded by!class_generator/schema/**
class_generator/schema/cephbuckettopiclist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephclient.json
is excluded by!class_generator/schema/**
class_generator/schema/cephclientlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephcluster.json
is excluded by!class_generator/schema/**
class_generator/schema/cephclusterlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephconnection.json
is excluded by!class_generator/schema/**
class_generator/schema/cephconnectionlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephcosidriver.json
is excluded by!class_generator/schema/**
class_generator/schema/cephcosidriverlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephfilesystem.json
is excluded by!class_generator/schema/**
class_generator/schema/cephfilesystemlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephfilesystemmirror.json
is excluded by!class_generator/schema/**
class_generator/schema/cephfilesystemmirrorlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephfilesystemsubvolumegroup.json
is excluded by!class_generator/schema/**
class_generator/schema/cephfilesystemsubvolumegrouplist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephnfs.json
is excluded by!class_generator/schema/**
class_generator/schema/cephnfslist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectrealm.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectrealmlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectstore.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectstorelist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectstoreuser.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectstoreuserlist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectzone.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectzonegroup.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectzonegrouplist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephobjectzonelist.json
is excluded by!class_generator/schema/**
class_generator/schema/cephrbdmirror.json
is excluded by!class_generator/schema/**
class_generator/schema/cephrbdmirrorlist.json
is excluded by!class_generator/schema/**
class_generator/schema/clientprofile.json
is excluded by!class_generator/schema/**
class_generator/schema/clientprofilelist.json
is excluded by!class_generator/schema/**
class_generator/schema/clientprofilemapping.json
is excluded by!class_generator/schema/**
class_generator/schema/clientprofilemappinglist.json
is excluded by!class_generator/schema/**
class_generator/schema/clustercatalog.json
is excluded by!class_generator/schema/**
class_generator/schema/clustercataloglist.json
is excluded by!class_generator/schema/**
class_generator/schema/clusterextension.json
is excluded by!class_generator/schema/**
class_generator/schema/clusterextensionlist.json
is excluded by!class_generator/schema/**
class_generator/schema/csiaddonsnode.json
is excluded by!class_generator/schema/**
class_generator/schema/csiaddonsnodelist.json
is excluded by!class_generator/schema/**
class_generator/schema/dataimportcron.json
is excluded by!class_generator/schema/**
class_generator/schema/dataimportcronlist.json
is excluded by!class_generator/schema/**
class_generator/schema/datasource.json
is excluded by!class_generator/schema/**
class_generator/schema/datasourcelist.json
is excluded by!class_generator/schema/**
class_generator/schema/datavolume.json
is excluded by!class_generator/schema/**
class_generator/schema/datavolumelist.json
is excluded by!class_generator/schema/**
class_generator/schema/driver.json
is excluded by!class_generator/schema/**
class_generator/schema/driverlist.json
is excluded by!class_generator/schema/**
class_generator/schema/encryptionkeyrotationcronjob.json
is excluded by!class_generator/schema/**
class_generator/schema/encryptionkeyrotationcronjoblist.json
is excluded by!class_generator/schema/**
class_generator/schema/encryptionkeyrotationjob.json
is excluded by!class_generator/schema/**
class_generator/schema/encryptionkeyrotationjoblist.json
is excluded by!class_generator/schema/**
class_generator/schema/hostpathprovisioner.json
is excluded by!class_generator/schema/**
class_generator/schema/hostpathprovisionerlist.json
is excluded by!class_generator/schema/**
class_generator/schema/hyperconverged.json
is excluded by!class_generator/schema/**
class_generator/schema/hyperconvergedlist.json
is excluded by!class_generator/schema/**
class_generator/schema/imagepruner.json
is excluded by!class_generator/schema/**
class_generator/schema/infrastructure.json
is excluded by!class_generator/schema/**
class_generator/schema/kubestorageversionmigrator.json
is excluded by!class_generator/schema/**
class_generator/schema/kubevirt.json
is excluded by!class_generator/schema/**
class_generator/schema/kubevirtlist.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolume.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumediscovery.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumediscoverylist.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumediscoveryresult.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumediscoveryresultlist.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumelist.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumeset.json
is excluded by!class_generator/schema/**
class_generator/schema/localvolumesetlist.json
is excluded by!class_generator/schema/**
class_generator/schema/machine.json
is excluded by!class_generator/schema/**
class_generator/schema/machinehealthcheck.json
is excluded by!class_generator/schema/**
class_generator/schema/machineset.json
is excluded by!class_generator/schema/**
class_generator/schema/migrationpolicy.json
is excluded by!class_generator/schema/**
class_generator/schema/migrationpolicylist.json
is excluded by!class_generator/schema/**
class_generator/schema/namespacestore.json
is excluded by!class_generator/schema/**
class_generator/schema/namespacestorelist.json
is excluded by!class_generator/schema/**
class_generator/schema/networkaddonsconfig.json
is excluded by!class_generator/schema/**
class_generator/schema/networkaddonsconfiglist.json
is excluded by!class_generator/schema/**
class_generator/schema/networkfence.json
is excluded by!class_generator/schema/**
class_generator/schema/networkfenceclass.json
is excluded by!class_generator/schema/**
class_generator/schema/networkfenceclasslist.json
is excluded by!class_generator/schema/**
class_generator/schema/networkfencelist.json
is excluded by!class_generator/schema/**
class_generator/schema/nmstate.json
is excluded by!class_generator/schema/**
class_generator/schema/nmstatelist.json
is excluded by!class_generator/schema/**
class_generator/schema/nodenetworkconfigurationenactment.json
is excluded by!class_generator/schema/**
class_generator/schema/nodenetworkconfigurationenactmentlist.json
is excluded by!class_generator/schema/**
class_generator/schema/nodenetworkconfigurationpolicy.json
is excluded by!class_generator/schema/**
class_generator/schema/nodenetworkconfigurationpolicylist.json
is excluded by!class_generator/schema/**
class_generator/schema/nodenetworkstate.json
is excluded by!class_generator/schema/**
class_generator/schema/nodenetworkstatelist.json
is excluded by!class_generator/schema/**
class_generator/schema/noobaa.json
is excluded by!class_generator/schema/**
class_generator/schema/noobaaaccount.json
is excluded by!class_generator/schema/**
class_generator/schema/noobaaaccountlist.json
is excluded by!class_generator/schema/**
class_generator/schema/noobaalist.json
is excluded by!class_generator/schema/**
class_generator/schema/objectbucket.json
is excluded by!class_generator/schema/**
class_generator/schema/objectbucketclaim.json
is excluded by!class_generator/schema/**
class_generator/schema/objectbucketclaimlist.json
is excluded by!class_generator/schema/**
class_generator/schema/objectbucketlist.json
is excluded by!class_generator/schema/**
class_generator/schema/objecttransfer.json
is excluded by!class_generator/schema/**
class_generator/schema/objecttransferlist.json
is excluded by!class_generator/schema/**
class_generator/schema/ocsinitialization.json
is excluded by!class_generator/schema/**
class_generator/schema/ocsinitializationlist.json
is excluded by!class_generator/schema/**
class_generator/schema/olm.json
is excluded by!class_generator/schema/**
class_generator/schema/olmlist.json
is excluded by!class_generator/schema/**
class_generator/schema/openstackvolumepopulator.json
is excluded by!class_generator/schema/**
class_generator/schema/openstackvolumepopulatorlist.json
is excluded by!class_generator/schema/**
class_generator/schema/operatorconfig.json
is excluded by!class_generator/schema/**
class_generator/schema/operatorconfiglist.json
is excluded by!class_generator/schema/**
class_generator/schema/ovirtvolumepopulator.json
is excluded by!class_generator/schema/**
class_generator/schema/ovirtvolumepopulatorlist.json
is excluded by!class_generator/schema/**
class_generator/schema/persistentvolumeclaimvolumesource.json
is excluded by!class_generator/schema/**
class_generator/schema/recipe.json
is excluded by!class_generator/schema/**
class_generator/schema/recipelist.json
is excluded by!class_generator/schema/**
class_generator/schema/reclaimspacecronjob.json
is excluded by!class_generator/schema/**
class_generator/schema/reclaimspacecronjoblist.json
is excluded by!class_generator/schema/**
class_generator/schema/reclaimspacejob.json
is excluded by!class_generator/schema/**
class_generator/schema/reclaimspacejoblist.json
is excluded by!class_generator/schema/**
class_generator/schema/route.json
is excluded by!class_generator/schema/**
class_generator/schema/routelist.json
is excluded by!class_generator/schema/**
class_generator/schema/ssp.json
is excluded by!class_generator/schema/**
class_generator/schema/ssplist.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclaim.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclaimlist.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclient.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclientlist.json
is excluded by!class_generator/schema/**
class_generator/schema/storagecluster.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclusterlist.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclusterpeer.json
is excluded by!class_generator/schema/**
class_generator/schema/storageclusterpeerlist.json
is excluded by!class_generator/schema/**
class_generator/schema/storageconsumer.json
is excluded by!class_generator/schema/**
class_generator/schema/storageconsumerlist.json
is excluded by!class_generator/schema/**
class_generator/schema/storageprofile.json
is excluded by!class_generator/schema/**
class_generator/schema/storageprofilelist.json
is excluded by!class_generator/schema/**
class_generator/schema/storagerequest.json
is excluded by!class_generator/schema/**
class_generator/schema/storagerequestlist.json
is excluded by!class_generator/schema/**
class_generator/schema/storagesystem.json
is excluded by!class_generator/schema/**
class_generator/schema/storagesystemlist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachine.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineclone.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineclonelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineclusterinstancetype.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineclusterinstancetypelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineclusterpreference.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineclusterpreferencelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineexport.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineexportlist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstance.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancemigration.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancemigrationlist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancepreset.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancepresetlist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancereplicaset.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancereplicasetlist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancetype.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachineinstancetypelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinepool.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinepoollist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinepreference.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinepreferencelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinerestore.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinerestorelist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinesnapshot.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinesnapshotcontent.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinesnapshotcontentlist.json
is excluded by!class_generator/schema/**
class_generator/schema/virtualmachinesnapshotlist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumeclonesource.json
is excluded by!class_generator/schema/**
class_generator/schema/volumeclonesourcelist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumegroupreplication.json
is excluded by!class_generator/schema/**
class_generator/schema/volumegroupreplicationclass.json
is excluded by!class_generator/schema/**
class_generator/schema/volumegroupreplicationclasslist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumegroupreplicationcontent.json
is excluded by!class_generator/schema/**
class_generator/schema/volumegroupreplicationcontentlist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumegroupreplicationlist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumeimportsource.json
is excluded by!class_generator/schema/**
class_generator/schema/volumeimportsourcelist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumereplication.json
is excluded by!class_generator/schema/**
class_generator/schema/volumereplicationclass.json
is excluded by!class_generator/schema/**
class_generator/schema/volumereplicationclasslist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumereplicationlist.json
is excluded by!class_generator/schema/**
class_generator/schema/volumeuploadsource.json
is excluded by!class_generator/schema/**
class_generator/schema/volumeuploadsourcelist.json
is excluded by!class_generator/schema/**
📒 Files selected for processing (2)
class_generator/__cluster_version__.txt
(1 hunks)ocp_resources/pod_metrics.py
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- class_generator/cluster_version.txt
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: python-module-install
- GitHub Check: tox
🔇 Additional comments (2)
ocp_resources/pod_metrics.py (2)
1-8
: LGTM!The imports are appropriate for the functionality being implemented, and the header comment provides useful information about code generation.
15-15
: LGTM!The explicit typing of
api_group
and its value fromNamespacedResource.ApiGroup.METRICS_K8S_IO
are appropriate.
/verified |
/verified |
/verified |
/lgtm |
Summary by CodeRabbit
New Features
Chores
Documentation
Machine
class.