Skip to content

Commit 919989b

Browse files
fix: Resolved comments and CI test
Signed-off-by: Utkarsh Bhatt <utkarsh.bhatt@canonical.com>
1 parent 11d7995 commit 919989b

4 files changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,9 @@ jobs:
12351235
fetch-depth: 0
12361236

12371237
- name: Copy utils
1238-
run: cp tests/scripts/actionutils.sh $HOME
1238+
run: |
1239+
cp tests/scripts/actionutils.sh $HOME
1240+
cp tests/scripts/adoptutils.sh $HOME
12391241
12401242
- name: Clear FORWARD firewall rules
12411243
run: ~/actionutils.sh cleaript

microceph/cmd/microcephd/bootstrapper.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,13 @@ var GetBootstrapper = func(bd common.BootstrapConfig, state interfaces.StateInte
4040
return bootstrapper, nil
4141
}
4242

43-
// ##### Validation methods for various members of the bootstrap config structure #####
44-
4543
// PopulateDefaultNetworkParams provides missing network parameters with default values.
4644
func PopulateDefaultNetworkParams(state interfaces.StateInterface, monIP *string, publicNet *string, clusterNet *string) error {
4745
var err error
4846

49-
if len(*monIP) != 0 {
50-
logger.Debugf("mon ip provided as %s, will be used to deduce public network not provided", *monIP)
51-
} else { // Initialise mon-ip if not provided.
47+
logger.Debugf("Provided Bootstrap params: mon ip (%s), public net (%s), cluster net (%s)", *monIP, *publicNet, *clusterNet)
48+
49+
if len(*monIP) == 0 { // Initialise mon-ip if not provided.
5250
if len(*publicNet) == 0 {
5351
// Use default value if public address is also not provided.
5452
*monIP = state.ClusterState().Address().Hostname()
@@ -100,6 +98,8 @@ func StripV2OnlyMonIP(monIP string) string {
10098
return monIP
10199
}
102100

101+
// ##### Validation methods for various members of the bootstrap config structure #####
102+
103103
// ValidateNetworkParams validates network parameters for bootstrap and assign default values if needed.
104104
func ValidateNetworkParams(state interfaces.StateInterface, monIP *string, publicNet *string, clusterNet *string) error {
105105
var err error

microceph/cmd/microcephd/hooks.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212

1313
// PreInit is run before the daemon is initialized on bootstrap and join.
1414
func PreInit(ctx context.Context, s state.State, bootstrap bool, initConfig map[string]string) error {
15-
logger.Debugf("Executed Hook: PreInit (bootstrap=%v)", bootstrap)
15+
logger.Infof("Executed Hook: PreInit with %+v", initConfig)
1616
if bootstrap {
17-
logger.Debugf("PreInit for bootstrap: %v", initConfig)
17+
logger.Infof("PreInit for bootstrap: %v", initConfig)
1818
// Parse Bootstrap API parameters
1919
bd := common.BootstrapConfig{}
2020
common.DecodeBootstrapConfig(initConfig, &bd)
@@ -33,7 +33,7 @@ func PreInit(ctx context.Context, s state.State, bootstrap bool, initConfig map[
3333

3434
// PostBootstrap is run after the daemon is initialized and bootstrapped.
3535
func PostBootstrap(ctx context.Context, s state.State, initConfig map[string]string) error {
36-
logger.Debug("Executed Hook: PostBootstrap")
36+
logger.Infof("Executing Hook: PostBootstrap with %+v", initConfig)
3737
// Parse Bootstrap API parameters
3838
bd := common.BootstrapConfig{}
3939
common.DecodeBootstrapConfig(initConfig, &bd)
@@ -48,13 +48,13 @@ func PostBootstrap(ctx context.Context, s state.State, initConfig map[string]str
4848
}
4949

5050
func PostJoin(ctx context.Context, s state.State, initConfig map[string]string) error {
51-
logger.Debug("Executed Hook: PostJoin")
51+
logger.Infof("Executing Hook: PostJoin with %+v", initConfig)
5252
interf := interfaces.CephState{State: s}
5353
return ceph.Join(ctx, interf)
5454
}
5555

5656
func OnStart(ctx context.Context, s state.State) error {
57-
logger.Debug("Executed Hook: OnStart")
57+
logger.Info("Executing Hook: OnStart")
5858
interf := interfaces.CephState{State: s}
5959
return ceph.Start(ctx, interf)
6060
}

microceph/cmd/microcephd/simple_bootstrapper.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,16 @@ func (sb *SimpleBootstrapper) Prefill(bd common.BootstrapConfig, state interface
3838
}
3939

4040
PopulateV2OnlyMonIP(&sb.MonIP, sb.V2Only)
41+
42+
logger.Debugf("SB: Prefill finished with %+v", sb)
4143
return nil
4244
}
4345

4446
// Precheck verifies all provided values are correct before bootstrapping.
4547
func (sb *SimpleBootstrapper) Precheck(ctx context.Context, state interfaces.StateInterface) error {
4648
var err error
4749

48-
logger.Debugf("Initiating precheck for simple bootstrap: %v", sb)
50+
logger.Debugf("Initiating precheck for simple bootstrap: %+v", sb)
4951

5052
// drop v2 vectors before validation
5153
monIP := sb.MonIP

0 commit comments

Comments
 (0)