Skip to content

Commit

Permalink
added warning message for deprecated flag (#193)
Browse files Browse the repository at this point in the history
* added warning message for deprecated flag

* updated markdeprecated
  • Loading branch information
laxmikantbpandhare authored Aug 10, 2022
1 parent 98def35 commit 891a88b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/plugins/helm/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ func (p *createAPISubcommand) BindFlags(fs *pflag.FlagSet) {
fs.StringVar(&p.options.chartOptions.Version, helmChartVersionFlag, "", "helm chart version (default: latest)")

fs.StringVar(&p.options.CRDVersion, crdVersionFlag, defaultCrdVersion, "crd version to generate")
_ = fs.MarkDeprecated(crdVersionFlag, util.WarnMessageRemovalV1beta1)
}

func (p *createAPISubcommand) InjectConfig(c config.Config) error {
Expand Down
20 changes: 20 additions & 0 deletions pkg/plugins/util/message.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright 2020 The Operator-SDK Authors
//
// 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 util

const WarnMessageRemovalV1beta1 = "The v1beta1 API version for CRDs and Webhooks is deprecated and is no longer offered since " +
"Kubernetes 1.22. This flag will be removed in a future release. We " +
"recommend that you no longer use the v1beta1 API version" +
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22"

0 comments on commit 891a88b

Please sign in to comment.