Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
An outline plan
Browse files Browse the repository at this point in the history
  • Loading branch information
wallrj committed May 8, 2018
1 parent 07c8f1e commit 27db6bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controllers/cassandra/nodepool/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ func StatefulSetForCluster(
Name: "HEAP_NEWSIZE",
Value: "100M",
},
// XXX: Remove all these environment variables
// They won't be necessary.
// Deliberately set to a single space to force Cassandra to do a host name lookup.
// See https://github.com/apache/cassandra/blob/cassandra-3.11.2/conf/cassandra.yaml#L592
{
Expand Down
15 changes: 15 additions & 0 deletions pkg/pilot/cassandra/v3/pilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func NewPilot(opts *PilotOptions) (*Pilot, error) {
nodeTool: opts.nodeTool,
}

// XXX Remove all this
// hack to test the seedprovider, this should use whatever pattern is decided upon here:
// https://github.com/jetstack/navigator/issues/251
cfgPath := "/etc/cassandra/cassandra.yaml"
Expand Down Expand Up @@ -71,10 +72,13 @@ func (p *Pilot) WaitForCacheSync(stopCh <-chan struct{}) error {
}

func (p *Pilot) Hooks() *hook.Hooks {
// XXX: Add a hook here to merge our blob of essential configuration with
// the default configuration file found in the Docker image.
return &hook.Hooks{}
}

func (p *Pilot) CmdFunc(pilot *v1alpha1.Pilot) (*exec.Cmd, error) {
// XXX: Change this to Command("cassandra", "-f")
cmd := exec.Command("/docker-entrypoint.sh")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
Expand Down Expand Up @@ -129,3 +133,14 @@ func (p *Pilot) LivenessCheck() error {
_, err := p.nodeTool.Status()
return err
}

// XXX: Add a WriteConfig method which takes
func (p *Pilot) WriteConfig() error {
// Look for cassandra.yaml in directory given by $CASSANDRA_CONFIG environment variable.
// Unmarshall it as an unstructured map of strings.
// Remove keys
// Set SeedProvider key
// Write back out (backing up the original)
// NB: Comments will be lost.
// Write the properties file. (backing up the original (if present))
}

0 comments on commit 27db6bc

Please sign in to comment.