-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: node collector info in odigos describe (#1597)
This PR: - record the status of autoscaler node collector info into the collector group condition to make it available for display. - enhance the `odigos describe` command to include info about the node collector deployment: ![image](https://github.com/user-attachments/assets/9d45ebb0-8a3d-44c7-a3da-de3daaacb167)
- Loading branch information
Showing
5 changed files
with
160 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package common | ||
|
||
import ( | ||
"encoding/json" | ||
"time" | ||
|
||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
func GetCollectorsGroupDeployedConditionsPatch(err error) string { | ||
|
||
status := metav1.ConditionTrue | ||
if err != nil { | ||
status = metav1.ConditionFalse | ||
} | ||
|
||
message := "Gateway collector is deployed in the cluster" | ||
if err != nil { | ||
message = err.Error() | ||
} | ||
|
||
reason := "GatewayDeployedCreatedSuccessfully" | ||
if err != nil { | ||
// in the future, we can be more specific and break it down to | ||
// more detailed reasons about what exactly failed | ||
reason = "GatewayDeployedCreationFailed" | ||
} | ||
|
||
patch := map[string]interface{}{ | ||
"status": map[string]interface{}{ | ||
"conditions": []metav1.Condition{{ | ||
Type: "Deployed", | ||
Status: status, | ||
Reason: reason, | ||
Message: message, | ||
LastTransitionTime: metav1.NewTime(time.Now()), | ||
}}, | ||
}, | ||
} | ||
|
||
patchData, _ := json.Marshal(patch) | ||
// marshal error is ignored as it is not expected to happen | ||
return string(patchData) | ||
} |
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