Skip to content

Commit

Permalink
Fix messages after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
ilia1243 committed Mar 6, 2024
1 parent 7e14b95 commit ac1658b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
3 changes: 2 additions & 1 deletion kubemarine/patches/disable_token_automount.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def redeploy_oob_plugins(cluster: KubernetesCluster, plugin_names: List[str]) ->
specific_plugins = {name: plugins[name] for name in plugin_names if name in plugins}
install(cluster, specific_plugins)
cluster.log.debug("As part of this patch, all the OOB plugins will be redeployed")
oob_plugins = ["calico", "nginx-ingress-controller", "kubernetes-dashboard", "local-path-provisioner" ] # List of plugins to install
# List of plugins to install
oob_plugins = ["calico", "nginx-ingress-controller", "kubernetes-dashboard", "local-path-provisioner" ]
redeploy_oob_plugins(cluster, oob_plugins)


Expand Down
9 changes: 6 additions & 3 deletions kubemarine/plugins/calico.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ def enrich_service_account_secret_calico_kube_controllers(self, manifest: Manife
new_yaml = yaml.safe_load(service_account_secret_calico_kube_controllers)

service_account_key = "ServiceAccount_calico-kube-controllers"
service_account_index = manifest.all_obj_keys().index(service_account_key) if service_account_key in manifest.all_obj_keys() else -1
service_account_index = manifest.all_obj_keys().index(service_account_key) \
if service_account_key in manifest.all_obj_keys() else -1

self.include(manifest, service_account_index + 1, new_yaml)

Expand Down Expand Up @@ -245,7 +246,8 @@ def enrich_service_account_secret_calico_node(self, manifest: Manifest) -> None:
new_yaml = yaml.safe_load(service_account_secret_calico_node)

service_account_key = "ServiceAccount_calico-node"
service_account_index = manifest.all_obj_keys().index(service_account_key) if service_account_key in manifest.all_obj_keys() else -1
service_account_index = manifest.all_obj_keys().index(service_account_key) \
if service_account_key in manifest.all_obj_keys() else -1

self.include(manifest, service_account_index + 1, new_yaml)

Expand Down Expand Up @@ -523,7 +525,8 @@ def enrich_service_account_secret_calico_apiserver(self, manifest: Manifest) ->
new_yaml = yaml.safe_load(service_account_secret_calico_apiserver)

service_account_key = "ServiceAccount_calico-apiserver"
service_account_index = manifest.all_obj_keys().index(service_account_key) if service_account_key in manifest.all_obj_keys() else -1
service_account_index = manifest.all_obj_keys().index(service_account_key) \
if service_account_key in manifest.all_obj_keys() else -1

self.include(manifest, service_account_index + 1, new_yaml)

Expand Down
5 changes: 3 additions & 2 deletions kubemarine/plugins/kubernetes_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from textwrap import dedent
from typing import List, Optional, Dict
import yaml
from textwrap import dedent

from kubemarine.core import summary, utils, log
from kubemarine.core.cluster import KubernetesCluster, EnrichmentStage, enrichment
Expand Down Expand Up @@ -84,7 +84,8 @@ def enrich_service_account_secret_kubernetes_dashboard(self, manifest: Manifest)
new_yaml = yaml.safe_load(service_account_secret_kubernetes_dashboard)

service_account_key = "ServiceAccount_kubernetes-dashboard"
service_account_index = manifest.all_obj_keys().index(service_account_key) if service_account_key in manifest.all_obj_keys() else -1
service_account_index = manifest.all_obj_keys().index(service_account_key) \
if service_account_key in manifest.all_obj_keys() else -1

self.include(manifest, service_account_index + 1, new_yaml)

Expand Down
3 changes: 2 additions & 1 deletion kubemarine/plugins/local_path_provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def enrich_service_account_secret(self, manifest: Manifest) -> None:
new_yaml = yaml.safe_load(service_account_secret)

service_account_key = "ServiceAccount_local-path-provisioner-service-account"
service_account_index = manifest.all_obj_keys().index(service_account_key) if service_account_key in manifest.all_obj_keys() else -1
service_account_index = manifest.all_obj_keys().index(service_account_key) \
if service_account_key in manifest.all_obj_keys() else -1

self.include(manifest, service_account_index + 1, new_yaml)

Expand Down
3 changes: 2 additions & 1 deletion kubemarine/plugins/nginx_ingress.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def enrich_service_account_secret(self, manifest: Manifest) -> None:
new_yaml = yaml.safe_load(service_account_secret)

service_account_key = "ServiceAccount_ingress-nginx"
service_account_index = manifest.all_obj_keys().index(service_account_key) if service_account_key in manifest.all_obj_keys() else -1
service_account_index = manifest.all_obj_keys().index(service_account_key) \
if service_account_key in manifest.all_obj_keys() else -1

self.include(manifest, service_account_index + 1, new_yaml)

Expand Down
2 changes: 2 additions & 0 deletions kubemarine/procedures/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def make_config() -> dict:


def print_config(cfg: dict, arguments: dict) -> None:
# pylint: disable=bad-builtin

format_ = arguments['output']
if format_ == 'yaml':
print(yaml.safe_dump(cfg, sort_keys=False), end='')
Expand Down
2 changes: 1 addition & 1 deletion test/unit/core/test_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def test_exclude_cumulative_point_scheduled(self):
test_func: ['overview']
}
tasks_copy = deepcopy(tasks)
tasks_copy['deploy']['loadbalancer']['haproxy'] = lambda cluster: flow.schedule_cumulative_point(cluster, test_func)
tasks_copy['deploy']['loadbalancer']['haproxy'] = lambda cluster: cluster.schedule_cumulative_point(test_func)
resources = demo.FakeResources(context, inventory, nodes_context=demo.generate_nodes_context(inventory))
flow.run_tasks(resources, tasks_copy, cumulative_points=cumulative_points)
self.assertEqual(num_tasks - 1, resources.cluster_if_initialized().context.get("test_info"),
Expand Down

0 comments on commit ac1658b

Please sign in to comment.