Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Let agent-install.sh automatically substitute in the cluster architecture if IMAGE_ON_EDGE_CLUSTER_REGISTRY is specified #4126

Open
dlarson04 opened this issue Jul 31, 2024 · 1 comment
Assignees

Comments

@dlarson04
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Currently a user sets

IMAGE_ON_EDGE_CLUSTER_REGISTRY=icr.io/my-repo/amd64_anax_k8s

before running agent-install.sh for a cluster.. But if the target cluster is not amd64, this part of agent-install.sh won't work

        # REMOTE_IMAGE_REGISTRY_PATH is parts before /{arch}_anax_k8s, for example if using quay.io, this value will be quay.io/<username>
        local image_arch=$(get_cluster_image_arch)
        REMOTE_IMAGE_REGISTRY_PATH="${IMAGE_ON_EDGE_CLUSTER_REGISTRY%%/${image_arch}*}"
        log_info "REMOTE_IMAGE_REGISTRY_PATH: $REMOTE_IMAGE_REGISTRY_PATH"
        sed -i -e "s#__ImagePath__#${IMAGE_FULL_PATH_ON_EDGE_CLUSTER_REGISTRY}#g" deployment.yml
        sed -i -e "s#__ImageRegistryHost__#${REMOTE_IMAGE_REGISTRY_PATH}#g" deployment.yml

agent-install.sh should intelligently build the path with the correct cluster architecture

Describe the solution you'd like.

No response

Describe alternatives you've considered

No response

Additional context.

No response

@dlarson04
Copy link
Contributor Author

We do some validation now but we can change this

            # need to validate image arch in IMAGE_ON_EDGE_CLUSTER_REGISTRY
            if [[ -z $IMAGE_ON_EDGE_CLUSTER_REGISTRY ]]; then
                log_fatal 1 "A value for \$IMAGE_ON_EDGE_CLUSTER_REGISTRY must be specified"
            fi
            lastpart=$(echo $IMAGE_ON_EDGE_CLUSTER_REGISTRY | cut -d "/" -f 3) # <arch>_anax_k8s
            image_arch_in_param=$(echo $lastpart | cut -d "_" -f 1)
            if [[ "$image_arch" != "$image_arch_in_param" ]]; then
                log_fatal 1 "Cannot use agent image with $image_arch_in_param arch to install on $image_arch cluster, please use agent image with '$image_arch'"
            fi

LiilyZhang added a commit to LiilyZhang/anax that referenced this issue Aug 8, 2024
…atically substitute in the cluster architecture if IMAGE_ON_EDGE_CLUSTER_REGISTRY is specified

Signed-off-by: Le Zhang <zhangl@us.ibm.com>
LiilyZhang added a commit to LiilyZhang/anax that referenced this issue Aug 8, 2024
…atically substitute in the cluster architecture if IMAGE_ON_EDGE_CLUSTER_REGISTRY is specified

Signed-off-by: Le Zhang <zhangl@us.ibm.com>
LiilyZhang added a commit to LiilyZhang/anax that referenced this issue Aug 8, 2024
…atically substitute in the cluster architecture if IMAGE_ON_EDGE_CLUSTER_REGISTRY is specified

Signed-off-by: Le Zhang <zhangl@us.ibm.com>
LiilyZhang added a commit to LiilyZhang/anax that referenced this issue Aug 8, 2024
…atically substitute in the cluster architecture if IMAGE_ON_EDGE_CLUSTER_REGISTRY is specified

Signed-off-by: Le Zhang <zhangl@us.ibm.com>
LiilyZhang added a commit to LiilyZhang/anax that referenced this issue Aug 8, 2024
…atically substitute in the cluster architecture if IMAGE_ON_EDGE_CLUSTER_REGISTRY is specified

Signed-off-by: Le Zhang <zhangl@us.ibm.com>
LiilyZhang added a commit that referenced this issue Aug 12, 2024
Issue #4126 - Feature Request: Let agent-install.sh autom…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants