Commit f300b027 authored by Yann Garcia's avatar Yann Garcia
Browse files

Merge branch 'STF_685' into 'STF_707_TASK3'

From STF_685 into STF_707_TASK3

See merge request !23
parents 29624c22 7ab81ce4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ def verify_gitlab_oauth(client_id: str, client_secret: str, gitlab_url: str = No
        return False, "GitLab Client ID or Client Secret is empty"

    if not gitlab_url:
        gitlab_url = os.environ.get("GITLAB_URL", "https://forge.etsi.org/rep")
        gitlab_url = os.environ.get("GITLAB_URL", "https://labs.etsi.org/rep")

    url = f"{gitlab_url.rstrip('/')}/oauth/token"
    payload = {
+22 −0
Original line number Diff line number Diff line
@@ -40,9 +40,31 @@ files.replace(
    text=r'sandbox_image = "registry.k8s.io/pause:3.8',
    replace='sandbox_image = "registry.k8s.io/pause:3.10',
    _sudo=True
)

# Enable certs.d config_path
files.replace(
    name="Enable certs.d config_path for registry mirrors",
    path=containerd_config_path,
    text=r'config_path = ""',
    replace='config_path = "/etc/containerd/certs.d"',
    _sudo=True
)

files.directory(
    name="Create containerd certs.d directory for registry.k8s.io",
    path="/etc/containerd/certs.d/registry.k8s.io",
    _sudo=True,
)

files.template(
    name="Configure explicit IPv4 mirror for registry.k8s.io",
    src="templates/registry.k8s.io.hosts.toml.j2",
    dest="/etc/containerd/certs.d/registry.k8s.io/hosts.toml",
    _sudo=True,
)


# Restart containerd
systemd.service(
    name="Restart containerd",
+0 −23
Original line number Diff line number Diff line
@@ -68,26 +68,3 @@ systemd.daemon_reload(
    name="Reload systemd",
    _sudo=True
)

# Disable IPv6 at the kernel level via GRUB.
# files.replace uses sed (not Python regex), so the pattern must be BRE/ERE:
# no lookaheads. Skip when the file is missing or already has ipv6.disable=1.
grub_cmdline = host.get_fact(
    Command,
    "grep -E '^GRUB_CMDLINE_LINUX=' /etc/default/grub 2>/dev/null || true",
)

if grub_cmdline and "ipv6.disable=1" not in grub_cmdline:
    files.replace(
        name="Disable IPv6 in GRUB",
        path="/etc/default/grub",
        text=r'^GRUB_CMDLINE_LINUX="(.*)"$',
        replace=r'GRUB_CMDLINE_LINUX="\1 ipv6.disable=1"',
        extended_regex=True,
        _sudo=True,
    )
    server.shell(
        name="Update GRUB",
        commands=["update-grub"],
        _sudo=True,
    )
+5 −0
Original line number Diff line number Diff line
server = "https://registry.k8s.io"

[host."http://34.96.108.209"]
  capabilities = ["pull", "resolve"]
  skip_verify = true
+4 −4
Original line number Diff line number Diff line
@@ -1253,9 +1253,9 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) {

	var key string
	if appId == "" {
		key = baseKeyAnyMep + "app:*:svc:*"
		key = baseKey + "app:*:svc:*"
	} else {
		key = baseKeyAnyMep + "app:" + appId + ":svc:*"
		key = baseKey + "app:" + appId + ":svc:*"
	}

	err = rc.ForEachJSONEntry(key, populateServiceInfoList, sInfoList)
@@ -1290,9 +1290,9 @@ func getService(w http.ResponseWriter, r *http.Request, appId string, serviceId

	var key string
	if appId == "" {
		key = baseKeyAnyMep + "app:*:svc:" + serviceId
		key = baseKey + "app:*:svc:" + serviceId
	} else {
		key = baseKeyAnyMep + "app:" + appId + ":svc:" + serviceId
		key = baseKey + "app:" + appId + ":svc:" + serviceId
	}

	err := rc.ForEachJSONEntry(key, populateServiceInfoList, &sInfoList)
Loading