Skip to content
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

RDR: setting client info #121

Merged
merged 1 commit into from
Mar 26, 2024
Merged
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ require (
github.com/operator-framework/api v0.20.0
github.com/pkg/errors v0.9.1
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.70.0
github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240313134224-73ae0f2516f9
github.com/stretchr/testify v1.8.4
github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240325171742-7a2177d09b00
google.golang.org/grpc v1.60.0
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.28.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne
github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240313134224-73ae0f2516f9 h1:YgDh6I1VD5N73DtMnpIndCy4OLGr2wA5tSu7Vl31wLQ=
github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240313134224-73ae0f2516f9/go.mod h1:PCVDTkuTpxNiohFR367a8rEExaIOhKnwdkHfv5qmPJs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240325171742-7a2177d09b00 h1:XNUvXtgCSvj/dOWKUXOmzX/a7+cCAhdFilxc+MhO0TY=
github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240325171742-7a2177d09b00/go.mod h1:cE35IBM6w9KQfLbmJBR8b/jhoitTkvjPBb/Yp6QQnKI=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
Expand Down
11 changes: 10 additions & 1 deletion service/status-report/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ func main() {
}

var pltVersion string
var clusterID configv1.ClusterID
clusterVersion := &configv1.ClusterVersion{}
clusterVersion.Name = "version"
if err = cl.Get(ctx, types.NamespacedName{Name: clusterVersion.Name}, clusterVersion); err != nil {
Expand All @@ -121,11 +122,17 @@ func main() {
if item != nil {
pltVersion = item.Version
}
clusterID = clusterVersion.Spec.ClusterID
}
if pltVersion == "" {
klog.Warningf("Unable to find ocp version with completed update")
}

namespacedName := types.NamespacedName{
Namespace: storageClient.Namespace,
Name: storageClient.Name,
}

providerClient, err := providerclient.NewProviderClient(
ctx,
storageClient.Spec.StorageProviderEndpoint,
Expand All @@ -138,7 +145,9 @@ func main() {

status := providerclient.NewStorageClientStatus().
SetPlatformVersion(pltVersion).
SetOperatorVersion(oprVersion)
SetOperatorVersion(oprVersion).
SetClusterID(string(clusterID)).
Madhu-1 marked this conversation as resolved.
Show resolved Hide resolved
SetNamespacedName(namespacedName.String())
statusResponse, err := providerClient.ReportStatus(ctx, storageClient.Status.ConsumerID, status)
if err != nil {
klog.Exitf("Failed to report status of storageClient %v: %v", storageClient.Status.ConsumerID, err)
Expand Down

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.

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

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ github.com/prometheus/common/model
github.com/prometheus/procfs
github.com/prometheus/procfs/internal/fs
github.com/prometheus/procfs/internal/util
# github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240313134224-73ae0f2516f9
# github.com/red-hat-storage/ocs-operator/v4 v4.0.0-20240325171742-7a2177d09b00
## explicit; go 1.21
github.com/red-hat-storage/ocs-operator/v4/services/provider/client
github.com/red-hat-storage/ocs-operator/v4/services/provider/interfaces
Expand Down
Loading