Skip to content

Commit

Permalink
Merge pull request #3005 from rewantsoni/network
Browse files Browse the repository at this point in the history
update the odf-info api to contain the exported endpoint address
  • Loading branch information
openshift-merge-bot[bot] authored Feb 10, 2025
2 parents 9fc89b6 + 53e7ab1 commit f622c19
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 3 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/odfinfoconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ package v1alpha1

import "k8s.io/apimachinery/pkg/types"

const ApiServerExportedAddressAnnotationName = "ocs.openshift.io/api-server-exported-address"

// ConnectedClient describes the connected clients of the storage cluster key
type ConnectedClient struct {
Name string `yaml:"name"`
Expand All @@ -31,6 +33,7 @@ type InfoStorageCluster struct {
StorageProviderEndpoint string `yaml:"storageProviderEndpoint"`
CephClusterFSID string `yaml:"cephClusterFSID"`
StorageClusterUID string `yaml:"storageClusterUID"`
Annotations map[string]string `yaml:"annotations"`
}

// OdfInfoData describes odf-info CM's data
Expand Down
9 changes: 8 additions & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

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

9 changes: 9 additions & 0 deletions controllers/storagecluster/odfinfoconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ func getOdfInfoData(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCl
return "", err
}

annotations := map[string]string{}
for key, value := range storageCluster.GetAnnotations() {
parts := strings.Split(key, "/")
if len(parts) == 2 && strings.HasSuffix(parts[0], "ocs.openshift.io") {
annotations[key] = value
}
}

data := ocsv1a1.OdfInfoData{
Version: ocsVersion,
DeploymentType: odfDeploymentType,
Expand All @@ -147,6 +155,7 @@ func getOdfInfoData(r *StorageClusterReconciler, storageCluster *ocsv1.StorageCl
StorageProviderEndpoint: storageCluster.Status.StorageProviderEndpoint,
CephClusterFSID: cephFSId,
StorageClusterUID: string(storageCluster.UID),
Annotations: annotations,
},
}
yamlData, err := yaml.Marshal(data)
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.

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

0 comments on commit f622c19

Please sign in to comment.