Skip to content

Commit

Permalink
Merge pull request #105 from Juniper/ijohnson_switch_to_cas
Browse files Browse the repository at this point in the history
Command backend is switched to command-app-server
  • Loading branch information
mfigurski authored Apr 17, 2020
2 parents 2945330 + 3ae350c commit 4a25487
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions pkg/controller/command/command_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type commandConf struct {
func (c *commandConf) FillConfigMap(cm *core.ConfigMap) {
cm.Data["bootstrap.sh"] = c.executeTemplate(commandInitBootstrapScript)
cm.Data["init_cluster.yml"] = c.executeTemplate(commandInitCluster)
cm.Data["contrail.yml"] = c.executeTemplate(commandConfig)
cm.Data["command-app-server.yml"] = c.executeTemplate(commandConfig)
cm.Data["entrypoint.sh"] = c.executeTemplate(commandEntrypoint)
}

Expand All @@ -45,7 +45,7 @@ var commandEntrypoint = template.Must(template.New("").Parse(`
#!/bin/bash
cp {{ .CAFilePath }} /etc/pki/ca-trust/source/anchors/
update-ca-trust
/bin/contrailgo -c /etc/contrail/contrail.yml run
/bin/commandappserver -c /etc/contrail/command-app-server.yml run
`))

var commandInitBootstrapScript = template.Must(template.New("").Parse(`
Expand All @@ -64,8 +64,8 @@ fi
set -e
psql -w -h ${MY_POD_IP} -U root -d contrail_test -f /usr/share/contrail/gen_init_psql.sql
psql -w -h ${MY_POD_IP} -U {{ .PostgresUser }} -d {{ .PostgresDBName }} -f /usr/share/contrail/init_psql.sql
contrailutil convert --intype yaml --in /usr/share/contrail/init_data.yaml --outtype rdbms -c /etc/contrail/contrail.yml
contrailutil convert --intype yaml --in /etc/contrail/init_cluster.yml --outtype rdbms -c /etc/contrail/contrail.yml
commandutil convert --intype yaml --in /usr/share/contrail/init_data.yaml --outtype rdbms -c /etc/contrail/command-app-server.yml
commandutil convert --intype yaml --in /etc/contrail/init_cluster.yml --outtype rdbms -c /etc/contrail/command-app-server.yml
`))

var funcMap = template.FuncMap{
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/command/command_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (r *ReconcileCommand) Reconcile(request reconcile.Request) (reconcile.Resul
Items: []core.KeyToPath{
{Key: "bootstrap.sh", Path: "bootstrap.sh", Mode: &executableMode},
{Key: "entrypoint.sh", Path: "entrypoint.sh", Mode: &executableMode},
{Key: "contrail.yml", Path: "contrail.yml"},
{Key: "command-app-server.yml", Path: "command-app-server.yml"},
{Key: "init_cluster.yml", Path: "init_cluster.yml"},
},
},
Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/command/command_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ func newDeployment(s apps.DeploymentStatus) *apps.Deployment {
Items: []core.KeyToPath{
{Key: "bootstrap.sh", Path: "bootstrap.sh", Mode: &executableMode},
{Key: "entrypoint.sh", Path: "entrypoint.sh", Mode: &executableMode},
{Key: "contrail.yml", Path: "contrail.yml"},
{Key: "command-app-server.yml", Path: "command-app-server.yml"},
{Key: "init_cluster.yml", Path: "init_cluster.yml"},
},
},
Expand Down Expand Up @@ -705,7 +705,7 @@ func assertConfigMap(t *testing.T, actual *core.ConfigMap) {
},
}, actual.ObjectMeta)

assert.Equal(t, expectedCommandConfig, actual.Data["contrail.yml"])
assert.Equal(t, expectedCommandConfig, actual.Data["command-app-server.yml"])
assert.Equal(t, expectedBootstrapScript, actual.Data["bootstrap.sh"])
assert.Equal(t, expectedCommandInitCluster, actual.Data["init_cluster.yml"])
}
Expand Down Expand Up @@ -870,8 +870,8 @@ fi
set -e
psql -w -h ${MY_POD_IP} -U root -d contrail_test -f /usr/share/contrail/gen_init_psql.sql
psql -w -h ${MY_POD_IP} -U root -d contrail_test -f /usr/share/contrail/init_psql.sql
contrailutil convert --intype yaml --in /usr/share/contrail/init_data.yaml --outtype rdbms -c /etc/contrail/contrail.yml
contrailutil convert --intype yaml --in /etc/contrail/init_cluster.yml --outtype rdbms -c /etc/contrail/contrail.yml
commandutil convert --intype yaml --in /usr/share/contrail/init_data.yaml --outtype rdbms -c /etc/contrail/command-app-server.yml
commandutil convert --intype yaml --in /etc/contrail/init_cluster.yml --outtype rdbms -c /etc/contrail/command-app-server.yml
`

const expectedCommandInitCluster = `
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ func TestCommandServices(t *testing.T) {
KeystoneInstance: "commandtest-keystone",
SwiftInstance: "commandtest-swift",
Containers: map[string]*contrail.Container{
"init": {Image: "registry:5000/contrail-command:master.1115"},
"api": {Image: "registry:5000/contrail-command:master.1115"},
"init": {Image: "registry:5000/contrail-command:master.1175"},
"api": {Image: "registry:5000/contrail-command:master.1175"},
"wait-for-ready-conf": {Image: "registry:5000/busybox"},
},
},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "time"

var (
retryInterval = time.Second * 5
waitTimeout = time.Second * 180
waitTimeout = time.Second * 240
cleanupRetryInterval = time.Second * 1
cleanupTimeout = time.Second * 5
)
4 changes: 2 additions & 2 deletions test/env/deploy/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ spec:
keystoneInstance: keystone
containers:
api:
image: registry:5000/contrail-command:master.1115
image: registry:5000/contrail-command:master.1175
init:
image: registry:5000/contrail-command:master.1115
image: registry:5000/contrail-command:master.1175
wait-for-ready-conf:
image: registry:5000/busybox
keystone:
Expand Down
2 changes: 1 addition & 1 deletion test/env/update_local_registry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ contrail-statusmonitor:master-180ab9
contrail-provisioner:master.1175
EOF

pull_image hub.juniper.net/contrail-nightly contrail-command:master.1115
pull_image hub.juniper.net/contrail-nightly contrail-command:master.1175
pull_image hub.juniper.net/contrail-nightly contrail-controller-config-dnsmasq:master.1175

0 comments on commit 4a25487

Please sign in to comment.