Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Istio API Feature Status using proto annotations #2013

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
517 changes: 517 additions & 0 deletions common-protos/istio.io/extensions/istio_feature.pb.go

Large diffs are not rendered by default.

83 changes: 83 additions & 0 deletions common-protos/istio.io/extensions/istio_feature.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions common-protos/istio.io/extensions/istio_feature.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// Copyright 2019 Istio Authors
zhlsunshine marked this conversation as resolved.
Show resolved Hide resolved
//
// 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.

syntax = "proto3";

package istio.extensions;

option go_package="istio.io/api/istio.io/extensions";

import "google/protobuf/descriptor.proto";

// Values applied at the field level
extend google.protobuf.FieldOptions {
IstioFeature feature = 1300;
zhlsunshine marked this conversation as resolved.
Show resolved Hide resolved
}

enum FeatureStatus {
ALPHA = 0;
zhlsunshine marked this conversation as resolved.
Show resolved Hide resolved
BETA = 1;
STABLE = 2;
EXPERIMENTAL = 3;
}

// These options should be used during schema definition, applying them to some of the fields in protobuf
// Below are 1 related repo and 1 PR for this repo:
// Repo: https://github.com/istio/enhancements
// Repo PR: https://github.com/istio/enhancements/pull/88
message IstioFeature {
// label the feature's status, available status values may be alpha, beta and stable
// there would be experimental in future.
optional FeatureStatus status = 1;
zhlsunshine marked this conversation as resolved.
Show resolved Hide resolved
// id means the feature id which can be mapped here: https://github.com/istio/enhancements/blob/master/features.yaml
// it should be contained in id section of features under this yaml file.
optional string id = 2;
zhlsunshine marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given John's comment below I think this would be best suited as repeated string id = 2;. A repeated item that's empty is essentially optional.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacob-delgado okay, I will add repeated for field id. BTW, I think field status should be necessary to add repeated as well.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}
37 changes: 37 additions & 0 deletions common-protos/istio.io/extensions/istio_feature_deepcopy.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions common-protos/istio.io/extensions/istio_feature_json.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ buf generate --template buf.gen-noncrd.yaml \
buf generate --template buf.gen-golang.yaml \
--path envoy

# Add field option extension for istio feature label
buf generate --path istio.io/extensions/istio_feature.proto

# Custom hacks to post-process some outputs
go run ./operator/fixup_structs/main.go -f operator/v1alpha1/operator.pb.go
go run ./operator/fixup_structs/main.go -f mesh/v1alpha1/config.pb.go
Expand Down
Loading