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

Remove unused variable tknVersion #2200

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions pkg/reconciler/openshift/tektonaddon/consolecli.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,14 @@ func getRouteHost(manifest *mf.Manifest) (string, error) {
}

func consoleCLITransform(ctx context.Context, manifest *mf.Manifest, baseURL string) error {
tknVersion := "0.33.0"

if baseURL == "" {
return fmt.Errorf("route url should not be empty")
}
logger := logging.FromContext(ctx)
logger.Debug("Transforming manifest")

transformers := []mf.Transformer{
replaceURLCCD(baseURL, tknVersion),
replaceURLCCD(baseURL),
}

transformManifest, err := manifest.Transform(transformers...)
Expand Down
6 changes: 3 additions & 3 deletions pkg/reconciler/openshift/tektonaddon/transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func itemInSlice(item string, items []string) bool {
return false
}

func getlinks(baseURL, tknVersion string) []console.CLIDownloadLink {
func getlinks(baseURL string) []console.CLIDownloadLink {
platformURLs := []struct {
platform string
tknURL string
Expand Down Expand Up @@ -107,7 +107,7 @@ func getURL(baseURL string, path string) string {
return fmt.Sprintf("https://%s/%s", baseURL, path)
}

func replaceURLCCD(baseURL, tknVersion string) mf.Transformer {
func replaceURLCCD(baseURL string) mf.Transformer {
return func(u *unstructured.Unstructured) error {
if u.GetKind() != "ConsoleCLIDownload" {
return nil
Expand All @@ -117,7 +117,7 @@ func replaceURLCCD(baseURL, tknVersion string) mf.Transformer {
if err != nil {
return err
}
ccd.Spec.Links = getlinks(baseURL, tknVersion)
ccd.Spec.Links = getlinks(baseURL)
unstrObj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(ccd)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/openshift/tektonaddon/transformer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestUpdateConsoleCLIDownload(t *testing.T) {
expectedManifest, err := mf.ManifestFrom(mf.Recursive(testData))
assert.NilError(t, err)

newManifest, err := manifest.Transform(replaceURLCCD("testserver.com", "1.2.3"))
newManifest, err := manifest.Transform(replaceURLCCD("testserver.com"))
assert.NilError(t, err)

got := &console.ConsoleCLIDownload{}
Expand Down