Skip to content

Commit

Permalink
fix: cleanup optional properties, fixes RHOAIENG-12838
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirajsb committed Sep 12, 2024
1 parent ab472e6 commit 46aaf41
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
17 changes: 10 additions & 7 deletions api/v1alpha1/modelregistry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ type TLSServerSettings struct {
// ISTIO_MUTUAL: Secure connections from the downstream using mutual TLS by presenting server certificates for authentication. Compared to Mutual mode, this mode uses certificates, representing gateway workload identity, generated automatically by Istio for mTLS authentication. When this mode is used, all other TLS fields should be empty.
//
// OPTIONAL_MUTUAL: Similar to MUTUAL mode, except that the client certificate is optional. Unlike SIMPLE mode, A client certificate will still be explicitly requested during handshake, but the client is not required to send a certificate. If a client certificate is presented, it will be validated. ca_certificates should be specified for validating client certificates.
Mode string `json:"mode"`
Mode string `json:"mode,omitempty"`

// The name of the secret that holds the TLS certs including the CA certificates.
// If not provided, it is set automatically using model registry operator env variable DEFAULT_CERT.
Expand Down Expand Up @@ -249,16 +249,19 @@ type GatewayConfig struct {
}

type IstioConfig struct {
//+kubebuilder:required

// Authorino authentication provider name
AuthProvider string `json:"authProvider"`
//
// If missing, it is set using the operator environment property DEFAULT_AUTH_PROVIDER
// Model registry will have an error status if the operator property is also missing
AuthProvider string `json:"authProvider,omitempty"`

// Authorino AuthConfig selector labels
// Authorino AuthConfig selector labels.
//
// If missing, it is set using the operator environment property DEFAULT_AUTH_CONFIG_LABELS
//+optional
AuthConfigLabels map[string]string `json:"authConfigLabels,omitempty"`

//+kubebuilder:required
//+kubebuilder:default=ISTIO_MUTUAL
//+kubebuilder:Enum=DISABLE;SIMPLE;MUTUAL;ISTIO_MUTUAL

Expand Down Expand Up @@ -336,10 +339,10 @@ type ModelRegistryStatus struct {

// Hosts where model registry services are available
// NOTE: Gateway service names are different for gRPC and REST service routes
Hosts []string `json:"hosts"`
Hosts []string `json:"hosts,omitempty"`

// Formatted Host names separated by comma
HostsStr string `json:"hostsStr"`
HostsStr string `json:"hostsStr,omitempty"`

Conditions []metav1.Condition `json:"conditions,omitempty"`
}
Expand Down
17 changes: 6 additions & 11 deletions config/crd/bases/modelregistry.opendatahub.io_modelregistries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ spec:
authConfigLabels:
additionalProperties:
type: string
description: Authorino AuthConfig selector labels
description: "Authorino AuthConfig selector labels. \n If missing,
it is set using the operator environment property DEFAULT_AUTH_CONFIG_LABELS"
type: object
authProvider:
description: Authorino authentication provider name
description: "Authorino authentication provider name \n If missing,
it is set using the operator environment property DEFAULT_AUTH_PROVIDER
Model registry will have an error status if the operator property
is also missing"
type: string
gateway:
description: Optional Istio Gateway for registry services. Gateway
Expand Down Expand Up @@ -239,8 +243,6 @@ spec:
- ISTIO_MUTUAL
- OPTIONAL_MUTUAL
type: string
required:
- mode
type: object
type: object
istioIngress:
Expand Down Expand Up @@ -320,8 +322,6 @@ spec:
- ISTIO_MUTUAL
- OPTIONAL_MUTUAL
type: string
required:
- mode
type: object
type: object
required:
Expand All @@ -341,8 +341,6 @@ spec:
for mTLS authentication. When this mode is used, all other fields
in `ClientTLSSettings` should be empty."
type: string
required:
- authProvider
type: object
mysql:
description: MySQL configuration options
Expand Down Expand Up @@ -721,9 +719,6 @@ spec:
hostsStr:
description: Formatted Host names separated by comma
type: string
required:
- hosts
- hostsStr
type: object
type: object
served: true
Expand Down

0 comments on commit 46aaf41

Please sign in to comment.