diff --git a/release/Makefile b/release/Makefile index fb1932a5a8f..43d7103d0ae 100644 --- a/release/Makefile +++ b/release/Makefile @@ -4,18 +4,12 @@ PACKAGE_NAME = github.com/projectcalico/calico/release include ../lib.Makefile -# The name of the product. -# Either "Calico" or "Calico Enterprise" -PRODUCT_NAME=Calico - export ORGANIZATION export GIT_REPO export GIT_REPO_SLUG export DEV_REGISTRIES export OPERATOR_BRANCH -LDFLAGS= -X $(PACKAGE_NAME)/pkg/buildinfo.ProductName='$(PRODUCT_NAME)' - .PHONY: build build: bin/release diff --git a/release/cmd/main.go b/release/cmd/main.go index a4cba6a9f35..b68382c42ea 100644 --- a/release/cmd/main.go +++ b/release/cmd/main.go @@ -24,7 +24,6 @@ import ( "github.com/projectcalico/calico/release/internal/command" "github.com/projectcalico/calico/release/internal/utils" - "github.com/projectcalico/calico/release/pkg/buildinfo" "github.com/projectcalico/calico/release/pkg/tasks" ) @@ -70,7 +69,7 @@ func main() { app := &cli.App{ Name: "release", - Usage: fmt.Sprintf("release tool for %s", buildinfo.ProductName), + Usage: fmt.Sprintf("release tool for %s", utils.ProductName), Flags: globalFlags, Commands: Commands(cfg), EnableBashCompletion: true, diff --git a/release/internal/outputs/releasenotes.go b/release/internal/outputs/releasenotes.go index 40e48c3dec1..d44cbfa57aa 100644 --- a/release/internal/outputs/releasenotes.go +++ b/release/internal/outputs/releasenotes.go @@ -31,7 +31,6 @@ import ( "github.com/projectcalico/calico/release/internal/utils" "github.com/projectcalico/calico/release/internal/version" - "github.com/projectcalico/calico/release/pkg/buildinfo" ) const ( @@ -198,7 +197,7 @@ func ReleaseNotes(owner, githubToken, repoRootDir, outputDir string, ver version outputDir = "." } logrus.Infof("Generating release notes for %s", ver.FormattedString()) - milestone := ver.Milestone(buildinfo.ProductName) + milestone := ver.Milestone(utils.ProductName) githubClient := github.NewTokenClient(context.Background(), githubToken) releaseNoteDataList := []*ReleaseNoteIssueData{} opts := &github.MilestoneListOptions{ diff --git a/release/internal/utils/utils.go b/release/internal/utils/utils.go index 799cd6290f7..cbfb7d1039b 100644 --- a/release/internal/utils/utils.go +++ b/release/internal/utils/utils.go @@ -14,11 +14,10 @@ package utils -import "github.com/projectcalico/calico/release/pkg/buildinfo" - -var ProductName = buildinfo.ProductName - const ( + // ProductName is used in the release process to identify the product. + ProductName = CalicoProductName + // Calico is the product name for projectcalico. Calico = "calico" @@ -31,6 +30,9 @@ const ( // CalicoProductCode is the code for projectcalico. CalicoProductCode = "os" + // CalicoProductName is the name of the projectcalico product. + CalicoProductName = "Calico" + // ProjectCalicoOrg is the name of the Project Calico organization. ProjectCalicoOrg = "projectcalico" diff --git a/release/internal/version/version.go b/release/internal/version/version.go index 66f58b201b8..c2087093f09 100644 --- a/release/internal/version/version.go +++ b/release/internal/version/version.go @@ -25,7 +25,6 @@ import ( "github.com/projectcalico/calico/release/internal/command" "github.com/projectcalico/calico/release/internal/utils" - "github.com/projectcalico/calico/release/pkg/buildinfo" ) // Data is the interface that provides version data for a release. @@ -98,7 +97,7 @@ func (v *Version) FormattedString() string { // Milestone returns the GitHub milestone name which corresponds with this version. func (v *Version) Milestone(prefix string) string { if prefix == "" { - prefix = buildinfo.ProductName + prefix = utils.ProductName } ver := semver.MustParse(string(*v)) return fmt.Sprintf("%s v%d.%d.%d", prefix, ver.Major(), ver.Minor(), ver.Patch()) diff --git a/release/pkg/buildinfo/buildinfo.go b/release/pkg/buildinfo/buildinfo.go deleted file mode 100644 index a51fe8d0311..00000000000 --- a/release/pkg/buildinfo/buildinfo.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2024 Tigera, Inc. All rights reserved. - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// 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. - -package buildinfo - -// ProductName is the name of the product. -// Filled in by the build process. -var ProductName string diff --git a/release/pkg/tasks/notification.go b/release/pkg/tasks/notification.go index 1cdd1ef9770..ea6113a3117 100644 --- a/release/pkg/tasks/notification.go +++ b/release/pkg/tasks/notification.go @@ -23,11 +23,10 @@ import ( "github.com/projectcalico/calico/release/internal/slack" "github.com/projectcalico/calico/release/internal/utils" "github.com/projectcalico/calico/release/internal/version" - "github.com/projectcalico/calico/release/pkg/buildinfo" errr "github.com/projectcalico/calico/release/pkg/errors" ) -var product = buildinfo.ProductName +var product = utils.ProductName // SendErrorNotification sends a slack notification for a given error. // The error type determines the message to send.