Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

API Changes #123

Merged
merged 15 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
75 changes: 28 additions & 47 deletions Gopkg.lock

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

19 changes: 10 additions & 9 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
# Code generation dependencies
required = [
"k8s.io/code-generator/cmd/client-gen",
# needed by generated clientsets, but not an explicit dep in client-gen itself
"k8s.io/apimachinery/pkg/apimachinery/registered",

"k8s.io/code-generator/cmd/conversion-gen",
"k8s.io/code-generator/cmd/deepcopy-gen",
"k8s.io/code-generator/cmd/defaulter-gen",
"k8s.io/code-generator/cmd/lister-gen",
"k8s.io/code-generator/cmd/informer-gen",
"k8s.io/code-generator/cmd/lister-gen",
]

[[constraint]]
Expand All @@ -49,23 +47,23 @@ required = [

[[constraint]]
name = "k8s.io/api"
branch = "release-1.9"
version = "kubernetes-1.10.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dependencies need approvals.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


[[constraint]]
branch = "release-1.9"
name = "k8s.io/apimachinery"

[[constraint]]
branch = "release-1.9"
name = "k8s.io/apiserver"
version = "kubernetes-1.10.0"

[[constraint]]
name = "k8s.io/client-go"
version = "~6.0"
version = "kubernetes-1.10.0"

[[constraint]]
branch = "release-1.9"
name = "k8s.io/code-generator"
version = "kubernetes-1.10.0"

[[constraint]]
branch = "master"
Expand All @@ -75,9 +73,12 @@ required = [
branch = "master"
name = "github.com/heptiolabs/healthcheck"

# gengo needs to be manually pinned to the version listed in code-generators
# Gopkg.toml, because the k8s project does not produce Gopkg.toml files & dep
# does not parse the Godeps.json file to determine revisions to use.
[[override]]
branch = "master"
name = "k8s.io/gengo"
revision = "b6c426f7730e6d66e6e476a85d1c3eb7633880e0"

[[constraint]]
name = "github.com/robfig/cron"
Expand Down
14 changes: 7 additions & 7 deletions cmd/mysql-agent/app/mysql_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ func Run(opts *options.MySQLAgentOpts) error {

backupController := backupcontroller.NewAgentController(
kubeclient,
mysqlopClient.MysqlV1alpha1(),
sharedInformerFactory.Mysql().V1alpha1().MySQLBackups(),
sharedInformerFactory.Mysql().V1alpha1().MySQLClusters(),
mysqlopClient.MySQLV1alpha1(),
sharedInformerFactory.MySQL().V1alpha1().Backups(),
sharedInformerFactory.MySQL().V1alpha1().Clusters(),
kubeInformerFactory.Core().V1().Pods(),
opts.Hostname,
)
Expand All @@ -130,10 +130,10 @@ func Run(opts *options.MySQLAgentOpts) error {

restoreController := restorecontroller.NewAgentController(
kubeclient,
mysqlopClient.MysqlV1alpha1(),
sharedInformerFactory.Mysql().V1alpha1().MySQLRestores(),
sharedInformerFactory.Mysql().V1alpha1().MySQLClusters(),
sharedInformerFactory.Mysql().V1alpha1().MySQLBackups(),
mysqlopClient.MySQLV1alpha1(),
sharedInformerFactory.MySQL().V1alpha1().Restores(),
sharedInformerFactory.MySQL().V1alpha1().Clusters(),
sharedInformerFactory.MySQL().V1alpha1().Backups(),
kubeInformerFactory.Core().V1().Pods(),
opts.Hostname,
)
Expand Down
26 changes: 13 additions & 13 deletions cmd/mysql-agent/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ type MySQLAgentOpts struct {
Address string

// Namespace is the namespace in which the backup controller (and is
// associated MySQLCluster) are running.
// associated Cluster) are running.
Namespace string
// MySQLClusterName is the name of the MySQLCluster the backup controller
// ClusterName is the name of the Cluster the backup controller
// is responsible for.
MySQLClusterName string
ClusterName string
// Hostname of the pod the backup operator is running in.
Hostname string

Expand All @@ -66,12 +66,12 @@ func NewMySQLAgentOpts() *MySQLAgentOpts {
namespace := os.Getenv("POD_NAMESPACE")
clusterName := os.Getenv("MYSQL_CLUSTER_NAME")
return &MySQLAgentOpts{
HealthcheckPort: DefaultMySQLAgentHeathcheckPort,
Address: "0.0.0.0",
Namespace: namespace,
MySQLClusterName: clusterName,
Hostname: hostname,
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
HealthcheckPort: DefaultMySQLAgentHeathcheckPort,
Address: "0.0.0.0",
Namespace: namespace,
ClusterName: clusterName,
Hostname: hostname,
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
}
}

Expand All @@ -81,7 +81,7 @@ func (s *MySQLAgentOpts) AddFlags(fs *pflag.FlagSet) *pflag.FlagSet {
fs.StringVar(&s.Address, "address", s.Address, "The IP address to serve the mysql-agent's http service on (set to 0.0.0.0 for all interfaces).")

fs.StringVar(&s.Namespace, "namespace", s.Namespace, "The namespace to run in. Must be the same namespace as the associated MySQL cluster.")
fs.StringVar(&s.MySQLClusterName, "mysql-cluster-name", s.MySQLClusterName, "The name of the MySQL cluster the mysql-agent is responsible for.")
fs.StringVar(&s.ClusterName, "cluster-name", s.ClusterName, "The name of the MySQL cluster the mysql-agent is responsible for.")
fs.StringVar(&s.Hostname, "hostname", s.Hostname, "The hostname of the pod the mysql-agent is running in.")
fs.DurationVar(&s.MinResyncPeriod.Duration, "min-resync-period", s.MinResyncPeriod.Duration, "The resync period in reflectors will be random between MinResyncPeriod and 2*MinResyncPeriod.")

Expand All @@ -93,10 +93,10 @@ func (s *MySQLAgentOpts) Validate() error {
if len(s.Namespace) == 0 {
return fmt.Errorf("must set --namespace or $POD_NAMESPACE")
}
if len(s.MySQLClusterName) == 0 {
return fmt.Errorf("must set --mysql-cluster-name or $MYSQL_CLUSTER_NAME")
if len(s.ClusterName) == 0 {
return fmt.Errorf("must set --cluster-name or $MYSQL_CLUSTER_NAME")
}
if len(s.MySQLClusterName) == 0 {
if len(s.ClusterName) == 0 {
return fmt.Errorf("failed to detect hostname. Set --hostname")
}
return nil
Expand Down
18 changes: 9 additions & 9 deletions cmd/mysql-operator/app/mysql_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func Run(s *options.MySQLOperatorServer) error {
*s,
mysqlopClient,
kubeClient,
operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(),
operatorInformerFactory.MySQL().V1alpha1().Clusters(),
kubeInformerFactory.Apps().V1beta1().StatefulSets(),
kubeInformerFactory.Core().V1().Pods(),
kubeInformerFactory.Core().V1().Services(),
Expand All @@ -98,9 +98,9 @@ func Run(s *options.MySQLOperatorServer) error {

backupController := backupcontroller.NewOperatorController(
kubeClient,
mysqlopClient.MysqlV1alpha1(),
operatorInformerFactory.Mysql().V1alpha1().MySQLBackups(),
operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(),
mysqlopClient.MySQLV1alpha1(),
operatorInformerFactory.MySQL().V1alpha1().Backups(),
operatorInformerFactory.MySQL().V1alpha1().Clusters(),
kubeInformerFactory.Core().V1().Pods(),
)
wg.Add(1)
Expand All @@ -111,10 +111,10 @@ func Run(s *options.MySQLOperatorServer) error {

restoreController := restorecontroller.NewOperatorController(
kubeClient,
mysqlopClient.MysqlV1alpha1(),
operatorInformerFactory.Mysql().V1alpha1().MySQLRestores(),
operatorInformerFactory.Mysql().V1alpha1().MySQLClusters(),
operatorInformerFactory.Mysql().V1alpha1().MySQLBackups(),
mysqlopClient.MySQLV1alpha1(),
operatorInformerFactory.MySQL().V1alpha1().Restores(),
operatorInformerFactory.MySQL().V1alpha1().Clusters(),
operatorInformerFactory.MySQL().V1alpha1().Backups(),
kubeInformerFactory.Core().V1().Pods(),
)
wg.Add(1)
Expand All @@ -126,7 +126,7 @@ func Run(s *options.MySQLOperatorServer) error {
backupScheduleController := backupschedule.NewController(
mysqlopClient,
kubeClient,
operatorInformerFactory.Mysql().V1alpha1().MySQLBackupSchedules(),
operatorInformerFactory.MySQL().V1alpha1().BackupSchedules(),
30*time.Second,
s.Namespace,
)
Expand Down
Loading