Skip to content
Draft
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
1 change: 1 addition & 0 deletions pkg/errors/codes/codes.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const (
VolumeAccessInconsistent
PreCheckFailed
ProviderNotReady
InconsistentVersion
// This is not a valid code, it is used to get the maximum code value.
// Any new codes should be defined above this.
_maxCode
Expand Down
2 changes: 2 additions & 0 deletions pkg/errors/codes/codes_string.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func (c MocCode) String() string {
return "PreCheckFailed"
case ProviderNotReady:
return "ProviderNotReady"
case InconsistentVersion:
return "InconsistentVersion"
default:
return "MocCode(" + strconv.FormatUint(uint64(c), 10) + ")"
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ var (
IPOutOfRange error = NewMocError(moccodes.IPOutOfRange)
PreCheckFailed error = NewMocError(moccodes.PreCheckFailed)
ProviderNotReady error = NewMocError(moccodes.ProviderNotReady)
InconsistentVersion error = NewMocError(moccodes.InconsistentVersion)
)

// legacyErrorMessages - map of error codes to their legacy string representation. This is solely for backwards compatibility
Expand Down Expand Up @@ -570,6 +571,10 @@ func IsProviderNotReady(err error) bool {
return checkError(err, ProviderNotReady)
}

func IsInconsistentVersion(err error) bool {
return checkError(err, InconsistentVersion)
}

// checkError checks if the wrappedError has the same MocCode as the err error according to GetMocErrorCode.
// If the error is not matched by GetMocErrorCode and the error does not have a GRPC code (or is a GRPC Unknown code),
// it will attempt to match the error strings through string matching (even for multierrors).
Expand Down
1 change: 1 addition & 0 deletions rpc/common/admin/health/moc_common_health.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ message AgentInfoResponse{
google.protobuf.BoolValue Result = 2;
string Error = 3;
string deploymentId = 4;
string version = 5;
}

service HealthAgent {
Expand Down
63 changes: 36 additions & 27 deletions rpc/common/admin/moc_common_health.pb.go

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

Loading