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

Commit 27db6bc

Browse files
committed
An outline plan
1 parent 07c8f1e commit 27db6bc

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

pkg/controllers/cassandra/nodepool/resource.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ func StatefulSetForCluster(
196196
Name: "HEAP_NEWSIZE",
197197
Value: "100M",
198198
},
199+
// XXX: Remove all these environment variables
200+
// They won't be necessary.
199201
// Deliberately set to a single space to force Cassandra to do a host name lookup.
200202
// See https://github.com/apache/cassandra/blob/cassandra-3.11.2/conf/cassandra.yaml#L592
201203
{

pkg/pilot/cassandra/v3/pilot.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NewPilot(opts *PilotOptions) (*Pilot, error) {
4343
nodeTool: opts.nodeTool,
4444
}
4545

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

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

7780
func (p *Pilot) CmdFunc(pilot *v1alpha1.Pilot) (*exec.Cmd, error) {
81+
// XXX: Change this to Command("cassandra", "-f")
7882
cmd := exec.Command("/docker-entrypoint.sh")
7983
cmd.Stdout = os.Stdout
8084
cmd.Stderr = os.Stderr
@@ -129,3 +133,14 @@ func (p *Pilot) LivenessCheck() error {
129133
_, err := p.nodeTool.Status()
130134
return err
131135
}
136+
137+
// XXX: Add a WriteConfig method which takes
138+
func (p *Pilot) WriteConfig() error {
139+
// Look for cassandra.yaml in directory given by $CASSANDRA_CONFIG environment variable.
140+
// Unmarshall it as an unstructured map of strings.
141+
// Remove keys
142+
// Set SeedProvider key
143+
// Write back out (backing up the original)
144+
// NB: Comments will be lost.
145+
// Write the properties file. (backing up the original (if present))
146+
}

0 commit comments

Comments
 (0)