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

Commit

Permalink
Merge pull request #93 from nre-learning/merge-stage-option
Browse files Browse the repository at this point in the history
Provide more flexibility for initial device configuration
  • Loading branch information
Mierdin authored Mar 24, 2019
2 parents da4a81b + c24c81c commit b394dd7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Added validation for making sure configs are present for each stage and device [#89](https://github.com/nre-learning/syringe/pull/89)
- Add version to build info, share with syrctl [#90](https://github.com/nre-learning/syringe/pull/90)
- Setting proper permissions on copied lesson dir, using config'd location [#92](https://github.com/nre-learning/syringe/pull/92)
- Provide greater device configuration flexibility [#93](https://github.com/nre-learning/syringe/pull/93)

## v0.3.0 - February 11, 2019

Expand Down
21 changes: 10 additions & 11 deletions scheduler/jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ func (ls *LessonScheduler) configureDevice(ep *pb.LiveEndpoint, req *LessonSched

volumes, volumeMounts, initContainers := ls.getVolumesConfiguration()

configFile := fmt.Sprintf("%s/lessons/lesson-%d/stage%d/configs/%s.txt", ls.SyringeConfig.LessonRepoDir, req.LessonDef.LessonId, req.Stage, ep.Name)

configJob := &batchv1.Job{
ObjectMeta: metav1.ObjectMeta{
Name: jobName,
Expand Down Expand Up @@ -125,19 +127,16 @@ func (ls *LessonScheduler) configureDevice(ep *pb.LiveEndpoint, req *LessonSched
InitContainers: initContainers,
Containers: []corev1.Container{
{
Name: "napalm",
Image: "antidotelabs/napalm",
Name: "configurator",
Image: "antidotelabs/configurator",
Command: []string{
"napalm",
"--user=antidote",
"--password=antidotepassword",
"--vendor=junos",
fmt.Sprintf("--optional_args=port=%d", ep.Port),
"/configure.py",
"antidote",
"antidotepassword",
"junos",
strconv.Itoa(int(ep.Port)),
ep.Host,
"configure",
// req.LessonDef.Stages[req.Stage].Configs[ep.Name],
fmt.Sprintf("/antidote/lessons/lesson-%d/stage%d/configs/%s.txt", req.LessonDef.LessonId, req.Stage, ep.Name),
"--strategy=replace", // To preserve atomicity between stages. All stages must provide full configurations.
configFile,
},

// TODO(mierdin): ONLY for test/dev. Should re-evaluate for prod
Expand Down

0 comments on commit b394dd7

Please # to comment.