-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Onboard clients only if they are on same version as provider - 2
- Operator major and minor version of client and provider should match for onboarding process to begin - After this commit older clients will fail to get onboarded Minor: Rename package clientstatus to interfaces Signed-off-by: Leela Venkaiah G <[email protected]>
- Loading branch information
Showing
10 changed files
with
293 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package interfaces | ||
|
||
type StorageClientStatus interface { | ||
// TODO: it was mistake not using full name of the field and we are just | ||
// doing indirection for getters, change this interface after ensuring | ||
// no client is using it | ||
GetPlatformVersion() string | ||
GetOperatorVersion() string | ||
|
||
SetPlatformVersion(string) StorageClientStatus | ||
SetOperatorVersion(string) StorageClientStatus | ||
} | ||
|
||
type StorageClientOnboarding interface { | ||
// getters for fields are already provided by protobuf messages | ||
GetOnboardingTicket() string | ||
GetConsumerName() string | ||
GetClientOperatorVersion() string | ||
|
||
SetOnboardingTicket(string) StorageClientOnboarding | ||
SetConsumerName(string) StorageClientOnboarding | ||
SetClientOperatorVersion(string) StorageClientOnboarding | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package providerpb | ||
|
||
import ( | ||
ifaces "github.com/red-hat-storage/ocs-operator/v4/services/provider/interfaces" | ||
) | ||
|
||
// ensure ReportStatusRequest satisfies StorageClientStatus interface | ||
var _ ifaces.StorageClientStatus = &ReportStatusRequest{} | ||
|
||
func (r *ReportStatusRequest) GetPlatformVersion() string { | ||
return r.GetClientPlatformVersion() | ||
} | ||
|
||
func (r *ReportStatusRequest) GetOperatorVersion() string { | ||
return r.GetClientOperatorVersion() | ||
} | ||
|
||
func (r *ReportStatusRequest) SetPlatformVersion(version string) ifaces.StorageClientStatus { | ||
r.ClientPlatformVersion = version | ||
return r | ||
} | ||
|
||
func (r *ReportStatusRequest) SetOperatorVersion(version string) ifaces.StorageClientStatus { | ||
r.ClientOperatorVersion = version | ||
return r | ||
} | ||
|
||
// ensure OnboardConsumerRequest satisfies StorageClientOnboarding interface | ||
var _ ifaces.StorageClientOnboarding = &OnboardConsumerRequest{} | ||
|
||
func (o *OnboardConsumerRequest) SetOnboardingTicket(ticket string) ifaces.StorageClientOnboarding { | ||
o.OnboardingTicket = ticket | ||
return o | ||
} | ||
|
||
func (o *OnboardConsumerRequest) SetConsumerName(name string) ifaces.StorageClientOnboarding { | ||
o.ConsumerName = name | ||
return o | ||
} | ||
|
||
func (o *OnboardConsumerRequest) SetClientOperatorVersion(version string) ifaces.StorageClientOnboarding { | ||
o.ClientOperatorVersion = version | ||
return o | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters