Skip to content

Commit

Permalink
change SecretKeyRef to secretkeyselector
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjunlei committed Jul 16, 2020
1 parent bd95b63 commit 15f46cb
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 77 deletions.
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ spec:
authPassword:
key: password
name: default-email-secret
namespace: kubesphere-monitoring-system
authUsername: sender1
from: [email protected]
requireTLS: true
Expand Down Expand Up @@ -178,7 +177,6 @@ spec:
authPassword:
key: password
name: default-email-secret
namespace: kubesphere-monitoring-system
authUsername: sender1
from: [email protected]
requireTLS: true
Expand Down Expand Up @@ -376,7 +374,6 @@ spec:
authPassword:
key: password
name: default-email-secret
namespace: default
authUsername: sender1
from: [email protected]
requireTLS: true
Expand Down Expand Up @@ -427,7 +424,6 @@ spec:
authPassword:
key: password
name: user1-email-secret
namespace: default
authUsername: sender1
from: [email protected]
requireTLS: true
Expand Down
22 changes: 14 additions & 8 deletions config/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,29 +39,35 @@ spec:
authentications.
properties:
key:
description: The key of the secret to select from. Must be a valid
secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
namespace:
type: string
optional:
description: Specify whether the Secret or its key must be defined
type: boolean
required:
- key
- name
- namespace
type: object
authSecret:
description: The secret contains the SMTP secret for CRAM-MD5 authentication.
properties:
key:
description: The key of the secret to select from. Must be a valid
secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
namespace:
type: string
optional:
description: Specify whether the Secret or its key must be defined
type: boolean
required:
- key
- name
- namespace
type: object
authUsername:
description: The username for CRAM-MD5, LOGIN and PLAIN authentications.
Expand Down
22 changes: 14 additions & 8 deletions config/crd/bases/notification.kubesphere.io_emailconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,35 @@ spec:
authentications.
properties:
key:
description: The key of the secret to select from. Must be a valid
secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
namespace:
type: string
optional:
description: Specify whether the Secret or its key must be defined
type: boolean
required:
- key
- name
- namespace
type: object
authSecret:
description: The secret contains the SMTP secret for CRAM-MD5 authentication.
properties:
key:
description: The key of the secret to select from. Must be a valid
secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
namespace:
type: string
optional:
description: Specify whether the Secret or its key must be defined
type: boolean
required:
- key
- name
- namespace
type: object
authUsername:
description: The username for CRAM-MD5, LOGIN and PLAIN authentications.
Expand Down
2 changes: 0 additions & 2 deletions config/samples/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec:
authPassword:
key: password
name: default-email-secret
namespace: kubesphere-monitoring-system
authUsername: sender1
from: [email protected]
requireTLS: true
Expand All @@ -42,7 +41,6 @@ spec:
authPassword:
key: password
name: default-email-secret
namespace: kubesphere-monitoring-system
authUsername: sender1
from: [email protected]
requireTLS: true
Expand Down
1 change: 0 additions & 1 deletion config/samples/email_default_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ spec:
port: "25"
authUsername: sender1
authPassword:
namespace: kubesphere-monitoring-system
name: default-email-secret
key: password
requireTLS: true
1 change: 0 additions & 1 deletion config/samples/email_tenant_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ spec:
port: "25"
authUsername: sender1
authPassword:
namespace: kubesphere-monitoring-system
name: default-email-secret
key: password
requireTLS: true
22 changes: 14 additions & 8 deletions helm/crds/emailconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,29 +38,35 @@ spec:
authentications.
properties:
key:
description: The key of the secret to select from. Must be a valid
secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
namespace:
type: string
optional:
description: Specify whether the Secret or its key must be defined
type: boolean
required:
- key
- name
- namespace
type: object
authSecret:
description: The secret contains the SMTP secret for CRAM-MD5 authentication.
properties:
key:
description: The key of the secret to select from. Must be a valid
secret key.
type: string
name:
description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?'
type: string
namespace:
type: string
optional:
description: Specify whether the Secret or its key must be defined
type: boolean
required:
- key
- name
- namespace
type: object
authUsername:
description: The username for CRAM-MD5, LOGIN and PLAIN authentications.
Expand Down
11 changes: 3 additions & 8 deletions pkg/apis/v1alpha1/emailconfig_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package v1alpha1

import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand All @@ -33,9 +34,9 @@ type EmailConfigSpec struct {
// The identity for PLAIN authentication.
AuthIdentify *string `json:"authIdentify,omitempty"`
// The secret contains the SMTP password for LOGIN and PLAIN authentications.
AuthPassword *SecretKeyRef `json:"authPassword,omitempty"`
AuthPassword *v1.SecretKeySelector `json:"authPassword,omitempty"`
// The secret contains the SMTP secret for CRAM-MD5 authentication.
AuthSecret *SecretKeyRef `json:"authSecret,omitempty"`
AuthSecret *v1.SecretKeySelector `json:"authSecret,omitempty"`
// The default SMTP TLS requirement.
RequireTLS *bool `json:"requireTLS,omitempty"`
}
Expand All @@ -45,12 +46,6 @@ type HostPort struct {
Port string `json:"port"`
}

type SecretKeyRef struct {
Namespace string `json:"namespace"`
Name string `json:"name"`
Key string `json:"key"`
}

// EmailConfigStatus defines the observed state of EmailConfig
type EmailConfigStatus struct {
}
Expand Down
55 changes: 20 additions & 35 deletions pkg/apis/v1alpha1/zz_generated.deepcopy.go

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

Loading

0 comments on commit 15f46cb

Please sign in to comment.