Skip to content

Commit

Permalink
Feature smart metrics (#1083)
Browse files Browse the repository at this point in the history
* [Issue-1080] Extend CRD/proto spec for SmartInfo Support

Signed-off-by: Andrzej Zukowski <[email protected]>

* [Issue-1080] Include additional UTs

Signed-off-by: Andrzej Zukowski <[email protected]>

---------

Signed-off-by: Andrzej Zukowski <[email protected]>
  • Loading branch information
Andrzej-Zukowski authored Feb 15, 2024
1 parent 6dbf230 commit d5847f2
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Makefile.validation
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ coverage:
go tool cover -html=coverage.out -o coverage.html

test:
${GO_ENV_VARS} go test ${LDFLAGS} `go list ./... | grep -v halmgr | grep pkg` -race -cover -coverprofile=coverage.out -covermode=atomic
${GO_ENV_VARS} go test ${LDFLAGS} `go list ./... | grep pkg` -race -cover -coverprofile=coverage.out -covermode=atomic

# Run tests for pr-validation with writing output to log file
# Test are different (ginkgo, go testing, etc.) so can't use native ginkgo methods to print junit output.
Expand Down
133 changes: 71 additions & 62 deletions api/generated/v1/types.pb.go

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

4 changes: 3 additions & 1 deletion api/v1/drivecrd/drive_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
// +kubebuilder:printcolumn:name="Security Status",type="string",JSONPath=".spec.SecurityStatus",description="SED drive security status"
// +kubebuilder:printcolumn:name="Encryption Capable",type="string",JSONPath=".spec.EncryptionCapable",description="SED drive or not"
// +kubebuilder:printcolumn:name="Encryption Protocol",type="string",JSONPath=".spec.EncryptionProtocol",description="SED encryption protocol"
// +kubebuilder:printcolumn:name="Smart Info",type="string",JSONPath=".spec.SmartInfo",description="Smart Info data"
type Drive struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down Expand Up @@ -82,7 +83,8 @@ func (in *Drive) Equals(drive *api.Drive) bool {
in.Spec.Health == drive.Health &&
in.Spec.Type == drive.Type &&
in.Spec.Size == drive.Size &&
in.Spec.Path == drive.Path
in.Spec.Path == drive.Path &&
in.Spec.SmartInfo == drive.SmartInfo
}

func (in *Drive) GetDriveDescription() string {
Expand Down
1 change: 1 addition & 0 deletions api/v1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ message Drive {
string SecurityStatus = 20;
string EncryptionCapable = 21;
string EncryptionProtocol = 22;
string SmartInfo = 23;
}

message Volume {
Expand Down

0 comments on commit d5847f2

Please sign in to comment.