Skip to content

Commit

Permalink
remove validation of email in private image hubs (#964)
Browse files Browse the repository at this point in the history
* remove validation of email in private image hubs
  • Loading branch information
anneliawa authored Oct 27, 2023
1 parent 78d4216 commit ca64b0c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 16 deletions.
4 changes: 2 additions & 2 deletions charts/radix-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: radix-operator
version: 1.23.12
appVersion: 1.43.12
version: 1.23.13
appVersion: 1.43.13
kubeVersion: ">=1.24.0"
description: Radix Operator
keywords:
Expand Down
2 changes: 0 additions & 2 deletions charts/radix-operator/templates/radixapplication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1951,15 +1951,13 @@ spec:
properties:
email:
description: The email address linked to the username.
minLength: 3
type: string
username:
description: Username with permission to pull images. The password
is set in Radix Web Console.
minLength: 1
type: string
required:
- email
- username
type: object
description: 'Defines protected container registries used by components
Expand Down
2 changes: 0 additions & 2 deletions json-schema/radixapplication.json
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,6 @@
"properties": {
"email": {
"description": "The email address linked to the username.",
"minLength": 3,
"type": "string"
},
"username": {
Expand All @@ -2005,7 +2004,6 @@
}
},
"required": [
"email",
"username"
],
"type": "object"
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/radix/v1/radixapptypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ type RadixPrivateImageHubCredential struct {
Username string `json:"username"`

// The email address linked to the username.
// +kubebuilder:validation:MinLength=3
// +optional
Email string `json:"email"`
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/apis/radixvalidators/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ func MissingPrivateImageHubUsernameError(server string) error {
return fmt.Errorf("username is required for private image hub %s", server)
}

// MissingPrivateImageHubEmailError Error when email for private image hubs is not defined
func MissingPrivateImageHubEmailError(server string) error {
return fmt.Errorf("email is required for private image hub %s", server)
}

// EnvForDNSAppAliasNotDefinedError Error when env not defined
func EnvForDNSAppAliasNotDefinedError(env string) error {
return fmt.Errorf("env %s referred to by dnsAppAlias is not defined", env)
Expand Down
5 changes: 1 addition & 4 deletions pkg/apis/radixvalidators/validate_ra.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,11 @@ func CanRadixApplicationBeInsertedErrors(client radixclient.Interface, app *radi
}

func validatePrivateImageHubs(app *radixv1.RadixApplication) []error {
errs := []error{}
var errs []error
for server, config := range app.Spec.PrivateImageHubs {
if config.Username == "" {
errs = append(errs, MissingPrivateImageHubUsernameError(server))
}
if config.Email == "" {
errs = append(errs, MissingPrivateImageHubEmailError(server))
}
}
return errs
}
Expand Down

0 comments on commit ca64b0c

Please sign in to comment.