karmada icon indicating copy to clipboard operation
karmada copied to clipboard

karmadactl init image default tag use latest

Open helen-frank opened this issue 1 year ago • 16 comments

Task description: Optimize the debug karmadactl process

Solution: https://github.com/karmada-io/karmada/blob/6687479543631e781f2e58371cb09c42aab70753/pkg/version/release.go#L40-L46 Revised

// PatchRelease returns the stable version with format "vx.y.z".
func (r *ReleaseVersion) PatchRelease() string {
	if r.Version == nil {
		return "latest"
	}

	return fmt.Sprintf("v%d.%d.%d", r.Version.Major(), r.Version.Minor(), r.Version.Patch())
}

Who can join or take the task:

The good first issue is intended for first-time contributors to get started on his/her contributor journey.

After a contributor has successfully completed 1-2 good first issue's, they should be ready to move on to help wanted items, saving the remaining good first issue for other new contributors.

How to join or take the task:

Just reply on the issue with the message /assign in a separate line.

Then, the issue will be assigned to you.

How to ask for help:

If you need help or have questions, please feel free to ask on this issue. The issue author or other members of the community will guide you through the contribution process.

helen-frank avatar Apr 17 '23 13:04 helen-frank

@RainbowMango Can such changes be made?

helen-frank avatar Apr 17 '23 13:04 helen-frank

/assign

MukulKolpe avatar Apr 17 '23 17:04 MukulKolpe

@RainbowMango Can such changes be made?

Why? And, what's the benefit?

RainbowMango avatar Apr 18 '23 06:04 RainbowMango

@RainbowMango Can such changes be made?

Why? And, what's the benefit?

Versions are automatically injected when making a make, but not when debugging I'm currently using vscode launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "cmd/karmadactl",
            "args": [
                "init",
                "--kube-image-mirror-country=cn",
                "-p=32444",
                "--etcd-storage-mode=emptyDir",
                "--crds=https://github.com/karmada-io/karmada/releases/download/v1.5.0/crds.tar.gz",
                "--karmada-scheduler-image=docker.io/karmada/karmada-scheduler:v1.5.0",
                "--karmada-webhook-image=docker.io/karmada/karmada-webhook:v1.5.0"
            ]
        }
    ]
}

After optimization, I can pay more attention to the parts I want to debug. When debugging in a new environment, I do not need to configure the path of karmada related images, but use the latest image.

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Package",
            "type": "go",
            "request": "launch",
            "mode": "auto",
            "program": "cmd/karmadactl",
            "args": [
                "init",
                "--kube-image-mirror-country=cn",
                "-p=32444",
                "--etcd-storage-mode=emptyDir",
                "--crds=/root/karmada/crds.tar.gz",
            ]
        }
    ]
}

helen-frank avatar Apr 18 '23 06:04 helen-frank

I'm not familiar with the vscode launch.json, and don't get the pain point here.

But the version package provides common functionalities, I don't think it's a good idea to change the behavior here.

RainbowMango avatar Apr 18 '23 07:04 RainbowMango

-1 for this, Please just provide a stable version of karamda to the user by default.

liangyuanpeng avatar Apr 18 '23 08:04 liangyuanpeng

This is not true, latest will only be exported when debug, normal users are using make out karmadactl, there will be no latest @RainbowMango @liangyuanpeng

helen-frank avatar Apr 18 '23 08:04 helen-frank

Please just provide a stable version of karamda to the user by default.

I think i misunderstood, i got the nil version when i run command of make for karmada. Do you mean change to "latest".

@helen-frank

lan@lan:~/repo/git/karmada$ _output/bin/linux/amd64/karmadactl init -h
...
 --karmada-aggregated-apiserver-image='docker.io/karmada/karmada-aggregated-apiserver:<nil>':
        Karmada aggregated apiserver image
--crds='https://github.com/karmada-io/karmada/releases/download/<nil>/crds.tar.gz':
        Karmada crds resource.(local file e.g. --crds /root/crds.tar.gz)
...

liangyuanpeng avatar Apr 23 '23 02:04 liangyuanpeng

Please just provide a stable version of karamda to the user by default.

I think i misunderstood, i got the nil version when i run command of make for karmada. Do you mean change to "latest".

@helen-frank

lan@lan:~/repo/git/karmada$ _output/bin/linux/amd64/karmadactl init -h
...
 --karmada-aggregated-apiserver-image='docker.io/karmada/karmada-aggregated-apiserver:<nil>':
        Karmada aggregated apiserver image
--crds='https://github.com/karmada-io/karmada/releases/download/<nil>/crds.tar.gz':
        Karmada crds resource.(local file e.g. --crds /root/crds.tar.gz)
...

yes

helen-frank avatar Apr 23 '23 02:04 helen-frank

I'm following the karmadactl CI to run e2e at local,and just got the error :(

$:k describe po -n karmada-system karmada-aggregated-apiserver-78b74b56c4-dvrzf
...
Normal   Scheduled      73s               default-scheduler  Successfully assigned karmada-system/karmada-aggregated-apiserver-78b74b56c4-dvrzf to karmada-host-control-plane
  Warning  InspectFailed  4s (x7 over 72s)  kubelet            Failed to apply default image tag "docker.io/karmada/karmada-aggregated-apiserver:<nil>": couldn't parse image reference "docker.io/karmada/karmada-aggregated-apiserver:<nil>": invalid reference format
...

Easy to reproduce it:

  • git clone --depth 1 https://github.com/karmada-io/karmada.git
  • cd karmada
  • export CLUSTER_VERSION=kindest/node:v1.26.0
  • hack/cli-testing-environment.sh

But CI is working, I'm looking to see what the magic is. 🤔

Is it related with this issue? @helen-frank

liangyuanpeng avatar Apr 24 '23 03:04 liangyuanpeng

I'm following the karmadactl CI to run e2e at local,and just got the error :(

$:k describe po -n karmada-system karmada-aggregated-apiserver-78b74b56c4-dvrzf
...
Normal   Scheduled      73s               default-scheduler  Successfully assigned karmada-system/karmada-aggregated-apiserver-78b74b56c4-dvrzf to karmada-host-control-plane
  Warning  InspectFailed  4s (x7 over 72s)  kubelet            Failed to apply default image tag "docker.io/karmada/karmada-aggregated-apiserver:<nil>": couldn't parse image reference "docker.io/karmada/karmada-aggregated-apiserver:<nil>": invalid reference format
...

Easy to reproduce it:

  • git clone --depth 1 https://github.com/karmada-io/karmada.git
  • cd karmada
  • export CLUSTER_VERSION=kindest/node:v1.26.0
  • hack/cli-testing-environment.sh

But CI is working, I'm looking to see what the magic is. 🤔

Is it related with this issue? @helen-frank

It should not be, and I have tested it and can start normally. My change is applied to the debug phase. when version information is not injected, image gets nil, hack/cli-testing-environment.sh has make karmadactl in line 30, and version information has been injected here.

helen-frank avatar Apr 24 '23 05:04 helen-frank

hey , I am a beginner and new to this repo, can anyone tell is this project is enrolled in LFX mentorship 2024. I would be grateful if someone can point out to a resource to understand the karmada? I am a college student ,only know web devlopment and DSA but have a passion to contribute in open source.

CodexRaunak avatar May 10 '24 12:05 CodexRaunak

@CodexRaunak visit the Blogs and Documentation, Ask doubts on Slack if you further face any issues. The LFX part is uncertain

BHAVISHYA2005 avatar Jul 22 '24 16:07 BHAVISHYA2005

/assign

Ali-Alnosairi avatar Aug 02 '24 16:08 Ali-Alnosairi

Hi @helen-frank , @RainbowMango Is the issue fixed , cause I find a commit that edited the file. Please let me know if it is already fixed.

Ali-Alnosairi avatar Aug 02 '24 18:08 Ali-Alnosairi

Can I contribute to this issue?

Shubhf avatar Aug 08 '24 06:08 Shubhf