-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show KServe defaultDeploymentMode in DSC status
JIRA: https://issues.redhat.com/browse/RHOAIENG-16240 The dashboard would like to be able to read this value, and should only read it from the status. The value for the status is always read from the KServe ConfigMap, rather than ever assuming that what is set in the DSC, or what the operator defaults to, is correct: this is because that ConfigMap can be annotated to be unmanaged by the operator, in which case a user may have changed the value to something else, and the status should reflect this reality.
- Loading branch information
Showing
10 changed files
with
87 additions
and
11 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package kserve | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
|
||
corev1 "k8s.io/api/core/v1" | ||
) | ||
|
||
// ConfigMap Keys. | ||
const ( | ||
DeployConfigName = "deploy" | ||
IngressConfigKeyName = "ingress" | ||
) | ||
|
||
type DeployConfig struct { | ||
DefaultDeploymentMode string `json:"defaultDeploymentMode,omitempty"` | ||
} | ||
|
||
func getDeployConfig(cm *corev1.ConfigMap) (*DeployConfig, error) { | ||
deployConfig := DeployConfig{} | ||
if err := json.Unmarshal([]byte(cm.Data[DeployConfigName]), &deployConfig); err != nil { | ||
return nil, fmt.Errorf("error retrieving value for key '%s' from ConfigMap %s. %w", DeployConfigName, cm.Name, err) | ||
} | ||
return &deployConfig, nil | ||
} |
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
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