Skip to content

Commit 891a88b

Browse files
added warning message for deprecated flag (#193)
* added warning message for deprecated flag * updated markdeprecated
1 parent 98def35 commit 891a88b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

pkg/plugins/helm/v1/api.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func (p *createAPISubcommand) BindFlags(fs *pflag.FlagSet) {
119119
fs.StringVar(&p.options.chartOptions.Version, helmChartVersionFlag, "", "helm chart version (default: latest)")
120120

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

124125
func (p *createAPISubcommand) InjectConfig(c config.Config) error {

pkg/plugins/util/message.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2020 The Operator-SDK Authors
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package util
16+
17+
const WarnMessageRemovalV1beta1 = "The v1beta1 API version for CRDs and Webhooks is deprecated and is no longer offered since " +
18+
"Kubernetes 1.22. This flag will be removed in a future release. We " +
19+
"recommend that you no longer use the v1beta1 API version" +
20+
"More info: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-22"

0 commit comments

Comments
 (0)