diff --git a/internal/cmd/operator-sdk/generate/internal/genutil.go b/internal/cmd/operator-sdk/generate/internal/genutil.go index 887a613417..3b64c5a432 100644 --- a/internal/cmd/operator-sdk/generate/internal/genutil.go +++ b/internal/cmd/operator-sdk/generate/internal/genutil.go @@ -28,7 +28,6 @@ import ( apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" - cfgv3 "sigs.k8s.io/kubebuilder/v4/pkg/config/v3" "sigs.k8s.io/yaml" ) @@ -182,18 +181,9 @@ func GetPackageNameAndLayout(defaultPackageName string) (packageName string, lay return "", "", err } if packageName == "" { - switch { - case cfg.GetVersion().Compare(cfgv3.Version) == 0: - wd, err := os.Getwd() - if err != nil { - return "", "", err - } - packageName = strings.ToLower(filepath.Base(wd)) - default: - packageName = cfg.GetProjectName() - if packageName == "" { - return "", "", errors.New("--package must be set if \"projectName\" is not set in the PROJECT config file") - } + packageName = cfg.GetProjectName() + if packageName == "" { + return "", "", errors.New("--package must be set if \"projectName\" is not set in the PROJECT config file") } } layout = projutil.GetProjectLayout(cfg) diff --git a/internal/cmd/operator-sdk/generate/kustomize/manifests.go b/internal/cmd/operator-sdk/generate/kustomize/manifests.go index 7fa4eaceed..0c45dc08ca 100644 --- a/internal/cmd/operator-sdk/generate/kustomize/manifests.go +++ b/internal/cmd/operator-sdk/generate/kustomize/manifests.go @@ -30,7 +30,6 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation" "sigs.k8s.io/kubebuilder/v4/pkg/config" - cfgv3 "sigs.k8s.io/kubebuilder/v4/pkg/config/v3" "sigs.k8s.io/kubebuilder/v4/pkg/machinery" "sigs.k8s.io/yaml" @@ -257,11 +256,6 @@ func getGVKs(cfg config.Config) ([]schema.GroupVersionKind, error) { } gvks := make([]schema.GroupVersionKind, len(resources)) for i, gvk := range resources { - // check if the resource has an specific domain - // otherwise use the config.Domain. - if cfg.GetVersion().Compare(cfgv3.Version) == 0 { - gvk.Domain = cfg.GetDomain() - } gvks[i].Group = gvk.QualifiedGroup() gvks[i].Version = gvk.Version gvks[i].Kind = gvk.Kind