fix minor things

This commit is contained in:
Sergey Dudoladov
2019-01-02 17:45:50 +01:00
parent cba48ea9dd
commit 7b4128d4bc
10 changed files with 23 additions and 21 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// CRDResource
// CRDResource* define names necesssary for the k8s CRD API
const (
PostgresCRDResourceKind = "postgresql"
PostgresCRDResourcePlural = "postgresqls"
@@ -14,7 +14,7 @@ import (
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// OperatorConfiguration defines the specification for the OperatorConfigration.
// OperatorConfiguration defines the specification for the OperatorConfiguration.
type OperatorConfiguration struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata"`
@@ -24,7 +24,7 @@ type OperatorConfiguration struct {
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// OperatorConfigurationList defines the list of the OperatorConfigration.
// OperatorConfigurationList is used in the k8s API calls
type OperatorConfigurationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
@@ -32,13 +32,13 @@ type OperatorConfigurationList struct {
Items []OperatorConfiguration `json:"items"`
}
// PostgresUsersConfiguration defines the user of the Postgres.
// PostgresUsersConfiguration defines the system users of Postgres.
type PostgresUsersConfiguration struct {
SuperUsername string `json:"super_username,omitempty"`
ReplicationUsername string `json:"replication_username,omitempty"`
}
// KubernetesMetaConfiguration defines the pod service account info
// KubernetesMetaConfiguration defines k8s conf required for all Postgres clusters and the operator itself
type KubernetesMetaConfiguration struct {
PodServiceAccountName string `json:"pod_service_account_name,omitempty"`
// TODO: change it to the proper json
@@ -79,7 +79,7 @@ type OperatorTimeouts struct {
ReadyWaitTimeout Duration `json:"ready_wait_timeout,omitempty"`
}
// LoadBalancerConfiguration defines the LB DNS configration
// LoadBalancerConfiguration defines the LB configuration
type LoadBalancerConfiguration struct {
DbHostedZone string `json:"db_hosted_zone,omitempty"`
EnableMasterLoadBalancer bool `json:"enable_master_load_balancer,omitempty"`
@@ -88,7 +88,8 @@ type LoadBalancerConfiguration struct {
ReplicaDNSNameFormat config.StringTemplate `json:"replica_dns_name_format,omitempty"`
}
//AWSGCPConfiguration defines the configration of AWS s3
// AWSGCPConfiguration defines the configuration for AWS
// TODO complete Google Cloud Platform (GCP) configuration
type AWSGCPConfiguration struct {
WALES3Bucket string `json:"wal_s3_bucket,omitempty"`
AWSRegion string `json:"aws_region,omitempty"`
@@ -163,5 +164,5 @@ type OperatorConfigurationUsers struct {
TeamAPIRoleConfiguration map[string]string `json:"team_api_role_configuration,omitempty"`
}
//Duration is time.Duration
//Duration shortens this frequently used name
type Duration time.Duration
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"github.com/zalando-incubator/postgres-operator/pkg/apis/acid.zalan.do"
)
// APIVersion refered API version
// APIVersion of the `postgresql` and `operator` CRDs
const (
APIVersion = "v1"
)
+2 -2
View File
@@ -14,7 +14,7 @@ var (
serviceNameRegex = regexp.MustCompile(serviceNameRegexString)
)
// Clone returns Postgresql.DeepCopy
// Clone convenience wrapper around DeepCopy
func (p *Postgresql) Clone() *Postgresql {
if p == nil {
return nil
@@ -84,7 +84,7 @@ func validateCloneClusterDescription(clone *CloneDescription) error {
return nil
}
// Success returns status ClusterFailed or not
// Success of the last operation on a Postgres cluster
func (status PostgresStatus) Success() bool {
return status != ClusterStatusAddFailed &&
status != ClusterStatusUpdateFailed &&
+3 -2
View File
@@ -1,12 +1,13 @@
package cluster
import (
"time"
acidv1 "github.com/zalando-incubator/postgres-operator/pkg/apis/acid.zalan.do/v1"
"k8s.io/api/apps/v1beta1"
"k8s.io/api/core/v1"
policybeta1 "k8s.io/api/policy/v1beta1"
"k8s.io/apimachinery/pkg/types"
"time"
)
// PostgresRole describes role of the node
@@ -20,7 +21,7 @@ const (
Replica PostgresRole = "replica"
)
// PodEventType describe value of event type
// PodEventType describes value of event type
type PodEventType string
// Possible values for the EventType
+1 -1
View File
@@ -460,7 +460,7 @@ func (c *Cluster) setSpec(newSpec *acidv1.Postgresql) {
c.specMu.Unlock()
}
// GetSpec returns cluster.Postgresql
// GetSpec returns a copy of the operator-side spec of a Postgres cluster in a thread-safe manner
func (c *Cluster) GetSpec() (*acidv1.Postgresql, error) {
c.specMu.RLock()
defer c.specMu.RUnlock()
+1 -1
View File
@@ -125,7 +125,7 @@ func (n *NamespacedName) Decode(value string) error {
return n.DecodeWorker(value, GetOperatorNamespace())
}
// UnmarshalJSON covert to NamespacedName from byte slice
// UnmarshalJSON converts a byte slice to NamespacedName
func (n *NamespacedName) UnmarshalJSON(data []byte) error {
result := NamespacedName{}
var tmp string
+2 -2
View File
@@ -19,7 +19,7 @@ type fieldInfo struct {
Field reflect.Value
}
// StringTemplate is string
// StringTemplate is a convenience alias
type StringTemplate string
func decoderFrom(field reflect.Value) (d decoder) {
@@ -240,7 +240,7 @@ func (f *StringTemplate) Format(a ...string) string {
return res
}
// MarshalJSON returns json.Marshal(byte slice) from StringTemplate
// MarshalJSON converts a StringTemplate to byte slice
func (f StringTemplate) MarshalJSON() ([]byte, error) {
return json.Marshal(string(f))
}
+1 -1
View File
@@ -43,7 +43,7 @@ type httpClient interface {
Do(req *http.Request) (*http.Response, error)
}
// Interface have to implement TeamInfo
// Interface to the TeamsAPIClient
type Interface interface {
TeamInfo(teamID, token string) (tm *Team, err error)
}