Skip to content

Commit 0b7661b

Browse files
committed
Add experimental note and fix subcmds flags naming
Signed-off-by: Marcin Franczyk <[email protected]>
1 parent 5b57312 commit 0b7661b

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

api/nfd/v1alpha1/types.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ limitations under the License.
1717
package v1alpha1
1818

1919
import (
20-
"fmt"
21-
2220
corev1 "k8s.io/api/core/v1"
2321
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2422
)
@@ -300,13 +298,6 @@ type MatchExpression struct {
300298
Value MatchValue `json:"value,omitempty"`
301299
}
302300

303-
func (m MatchExpression) String() string {
304-
if len(m.Value) < 1 {
305-
return fmt.Sprintf("{op: %q}", m.Op)
306-
}
307-
return fmt.Sprintf("{op: %q, value: %q}", m.Op, m.Value)
308-
}
309-
310301
// MatchOp is the match operator that is applied on values when evaluating a
311302
// MatchExpression.
312303
// +kubebuilder:validation:Enum="In";"NotIn";"InRegexp";"Exists";"DoesNotExist";"Gt";"Lt";"GtLt";"IsTrue";"IsFalse"

api/nfd/v1alpha1/utils.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
Copyright 2024 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1alpha1
18+
19+
import (
20+
"fmt"
21+
)
22+
23+
// String represents the match expression as a string type.
24+
func (m MatchExpression) String() string {
25+
if len(m.Value) < 1 {
26+
return fmt.Sprintf("{op: %q}", m.Op)
27+
}
28+
return fmt.Sprintf("{op: %q, value: %q}", m.Op, m.Value)
29+
}

cmd/nfd/subcmd/compat/validate-node.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var validateNodeCmd = &cobra.Command{
6262
}
6363

6464
if readAccessToken && readPassword {
65-
return fmt.Errorf("cannot use --read-access-token and --read-password at the same time")
65+
return fmt.Errorf("cannot use --registry-token-stdin and --registry-password-stdin at the same time")
6666
} else if readAccessToken {
6767
accessToken, err = readStdin()
6868
if err != nil {
@@ -214,9 +214,9 @@ func init() {
214214
validateNodeCmd.Flags().StringVar(&platform.PlatformStr, "platform", "", "the artifact platform in the format os[/arch][/variant][:os_version]")
215215
validateNodeCmd.Flags().BoolVar(&plainHTTP, "plain-http", false, "use of HTTP protocol for all registry communications")
216216
validateNodeCmd.Flags().BoolVar(&outputJSON, "output-json", false, "print a JSON object")
217-
validateNodeCmd.Flags().StringVar(&username, "reg-username", "", "registry username")
218-
validateNodeCmd.Flags().BoolVar(&readPassword, "reg-password-stdin", false, "read registry password from stdin")
219-
validateNodeCmd.Flags().BoolVar(&readAccessToken, "reg-token-stdin", false, "read registry access token from stdin")
217+
validateNodeCmd.Flags().StringVar(&username, "registry-username", "", "registry username")
218+
validateNodeCmd.Flags().BoolVar(&readPassword, "registry-password-stdin", false, "read registry password from stdin")
219+
validateNodeCmd.Flags().BoolVar(&readAccessToken, "registry-token-stdin", false, "read registry access token from stdin")
220220

221221
if err := validateNodeCmd.MarkFlagRequired("image"); err != nil {
222222
panic(err)

docs/reference/node-feature-client-reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ sort: 9
1414
{:toc}
1515

1616
---
17+
**The client is in the experimental `v1alpha1` version.**
1718

1819
To quickly view available command line flags execute `nfd --help`.
1920

docs/usage/image-compatibility.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ sort: 11
1515

1616
---
1717

18-
## Image Compatibility (experimental: v1alpha1 version)
18+
## Image Compatibility
19+
20+
**Image Compatibility is in the experimental `v1alpha1` version.**
1921

2022
Image compatibility metadata enables container image authors to define their
2123
image requirements using [Node Feature Rules](./custom-resources.md#nodefeaturerule).

0 commit comments

Comments
 (0)