Skip to content
This repository was archived by the owner on Sep 16, 2023. It is now read-only.

Commit 4755125

Browse files
feat: Adds a pod_namespace field to pod events created by Continuous Validation, to distinguish pods with the same name that run in different namespaces (#227)
- [ ] Regenerate this pull request now. Committer: @tswift242 PiperOrigin-RevId: 455380856 Source-Link: googleapis/googleapis@1cbacff Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb47adfa214e798ee1cb736b52ad386101b096e0 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I0N2FkZmEyMTRlNzk4ZWUxY2I3MzZiNTJhZDM4NjEwMWIwOTZlMCJ9
1 parent d8fddd9 commit 4755125

File tree

87 files changed

+3949
-41
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3949
-41
lines changed

proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationEvent.java

+204
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,31 @@ public interface ContinuousValidationPodEventOrBuilder
163163
// @@protoc_insertion_point(interface_extends:google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent)
164164
com.google.protobuf.MessageOrBuilder {
165165

166+
/**
167+
*
168+
*
169+
* <pre>
170+
* The k8s namespace of the Pod.
171+
* </pre>
172+
*
173+
* <code>string pod_namespace = 7;</code>
174+
*
175+
* @return The podNamespace.
176+
*/
177+
java.lang.String getPodNamespace();
178+
/**
179+
*
180+
*
181+
* <pre>
182+
* The k8s namespace of the Pod.
183+
* </pre>
184+
*
185+
* <code>string pod_namespace = 7;</code>
186+
*
187+
* @return The bytes for podNamespace.
188+
*/
189+
com.google.protobuf.ByteString getPodNamespaceBytes();
190+
166191
/**
167192
*
168193
*
@@ -384,6 +409,7 @@ private ContinuousValidationPodEvent(
384409
}
385410

386411
private ContinuousValidationPodEvent() {
412+
podNamespace_ = "";
387413
pod_ = "";
388414
verdict_ = 0;
389415
images_ = java.util.Collections.emptyList();
@@ -479,6 +505,13 @@ private ContinuousValidationPodEvent(
479505
extensionRegistry));
480506
break;
481507
}
508+
case 58:
509+
{
510+
java.lang.String s = input.readStringRequireUtf8();
511+
512+
podNamespace_ = s;
513+
break;
514+
}
482515
default:
483516
{
484517
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
@@ -1977,6 +2010,55 @@ public com.google.protobuf.Parser<ImageDetails> getParserForType() {
19772010
}
19782011
}
19792012

2013+
public static final int POD_NAMESPACE_FIELD_NUMBER = 7;
2014+
private volatile java.lang.Object podNamespace_;
2015+
/**
2016+
*
2017+
*
2018+
* <pre>
2019+
* The k8s namespace of the Pod.
2020+
* </pre>
2021+
*
2022+
* <code>string pod_namespace = 7;</code>
2023+
*
2024+
* @return The podNamespace.
2025+
*/
2026+
@java.lang.Override
2027+
public java.lang.String getPodNamespace() {
2028+
java.lang.Object ref = podNamespace_;
2029+
if (ref instanceof java.lang.String) {
2030+
return (java.lang.String) ref;
2031+
} else {
2032+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2033+
java.lang.String s = bs.toStringUtf8();
2034+
podNamespace_ = s;
2035+
return s;
2036+
}
2037+
}
2038+
/**
2039+
*
2040+
*
2041+
* <pre>
2042+
* The k8s namespace of the Pod.
2043+
* </pre>
2044+
*
2045+
* <code>string pod_namespace = 7;</code>
2046+
*
2047+
* @return The bytes for podNamespace.
2048+
*/
2049+
@java.lang.Override
2050+
public com.google.protobuf.ByteString getPodNamespaceBytes() {
2051+
java.lang.Object ref = podNamespace_;
2052+
if (ref instanceof java.lang.String) {
2053+
com.google.protobuf.ByteString b =
2054+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2055+
podNamespace_ = b;
2056+
return b;
2057+
} else {
2058+
return (com.google.protobuf.ByteString) ref;
2059+
}
2060+
}
2061+
19802062
public static final int POD_FIELD_NUMBER = 1;
19812063
private volatile java.lang.Object pod_;
19822064
/**
@@ -2291,6 +2373,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io
22912373
for (int i = 0; i < images_.size(); i++) {
22922374
output.writeMessage(5, images_.get(i));
22932375
}
2376+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(podNamespace_)) {
2377+
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, podNamespace_);
2378+
}
22942379
unknownFields.writeTo(output);
22952380
}
22962381

@@ -2319,6 +2404,9 @@ public int getSerializedSize() {
23192404
for (int i = 0; i < images_.size(); i++) {
23202405
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, images_.get(i));
23212406
}
2407+
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(podNamespace_)) {
2408+
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, podNamespace_);
2409+
}
23222410
size += unknownFields.getSerializedSize();
23232411
memoizedSize = size;
23242412
return size;
@@ -2342,6 +2430,7 @@ public boolean equals(final java.lang.Object obj) {
23422430
.ContinuousValidationPodEvent)
23432431
obj;
23442432

2433+
if (!getPodNamespace().equals(other.getPodNamespace())) return false;
23452434
if (!getPod().equals(other.getPod())) return false;
23462435
if (hasDeployTime() != other.hasDeployTime()) return false;
23472436
if (hasDeployTime()) {
@@ -2364,6 +2453,8 @@ public int hashCode() {
23642453
}
23652454
int hash = 41;
23662455
hash = (19 * hash) + getDescriptor().hashCode();
2456+
hash = (37 * hash) + POD_NAMESPACE_FIELD_NUMBER;
2457+
hash = (53 * hash) + getPodNamespace().hashCode();
23672458
hash = (37 * hash) + POD_FIELD_NUMBER;
23682459
hash = (53 * hash) + getPod().hashCode();
23692460
if (hasDeployTime()) {
@@ -2555,6 +2646,8 @@ private void maybeForceBuilderInitialization() {
25552646
@java.lang.Override
25562647
public Builder clear() {
25572648
super.clear();
2649+
podNamespace_ = "";
2650+
25582651
pod_ = "";
25592652

25602653
if (deployTimeBuilder_ == null) {
@@ -2617,6 +2710,7 @@ public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
26172710
new com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent
26182711
.ContinuousValidationPodEvent(this);
26192712
int from_bitField0_ = bitField0_;
2713+
result.podNamespace_ = podNamespace_;
26202714
result.pod_ = pod_;
26212715
if (deployTimeBuilder_ == null) {
26222716
result.deployTime_ = deployTime_;
@@ -2700,6 +2794,10 @@ public Builder mergeFrom(
27002794
if (other
27012795
== com.google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent
27022796
.ContinuousValidationPodEvent.getDefaultInstance()) return this;
2797+
if (!other.getPodNamespace().isEmpty()) {
2798+
podNamespace_ = other.podNamespace_;
2799+
onChanged();
2800+
}
27032801
if (!other.getPod().isEmpty()) {
27042802
pod_ = other.pod_;
27052803
onChanged();
@@ -2776,6 +2874,112 @@ public Builder mergeFrom(
27762874

27772875
private int bitField0_;
27782876

2877+
private java.lang.Object podNamespace_ = "";
2878+
/**
2879+
*
2880+
*
2881+
* <pre>
2882+
* The k8s namespace of the Pod.
2883+
* </pre>
2884+
*
2885+
* <code>string pod_namespace = 7;</code>
2886+
*
2887+
* @return The podNamespace.
2888+
*/
2889+
public java.lang.String getPodNamespace() {
2890+
java.lang.Object ref = podNamespace_;
2891+
if (!(ref instanceof java.lang.String)) {
2892+
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
2893+
java.lang.String s = bs.toStringUtf8();
2894+
podNamespace_ = s;
2895+
return s;
2896+
} else {
2897+
return (java.lang.String) ref;
2898+
}
2899+
}
2900+
/**
2901+
*
2902+
*
2903+
* <pre>
2904+
* The k8s namespace of the Pod.
2905+
* </pre>
2906+
*
2907+
* <code>string pod_namespace = 7;</code>
2908+
*
2909+
* @return The bytes for podNamespace.
2910+
*/
2911+
public com.google.protobuf.ByteString getPodNamespaceBytes() {
2912+
java.lang.Object ref = podNamespace_;
2913+
if (ref instanceof String) {
2914+
com.google.protobuf.ByteString b =
2915+
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
2916+
podNamespace_ = b;
2917+
return b;
2918+
} else {
2919+
return (com.google.protobuf.ByteString) ref;
2920+
}
2921+
}
2922+
/**
2923+
*
2924+
*
2925+
* <pre>
2926+
* The k8s namespace of the Pod.
2927+
* </pre>
2928+
*
2929+
* <code>string pod_namespace = 7;</code>
2930+
*
2931+
* @param value The podNamespace to set.
2932+
* @return This builder for chaining.
2933+
*/
2934+
public Builder setPodNamespace(java.lang.String value) {
2935+
if (value == null) {
2936+
throw new NullPointerException();
2937+
}
2938+
2939+
podNamespace_ = value;
2940+
onChanged();
2941+
return this;
2942+
}
2943+
/**
2944+
*
2945+
*
2946+
* <pre>
2947+
* The k8s namespace of the Pod.
2948+
* </pre>
2949+
*
2950+
* <code>string pod_namespace = 7;</code>
2951+
*
2952+
* @return This builder for chaining.
2953+
*/
2954+
public Builder clearPodNamespace() {
2955+
2956+
podNamespace_ = getDefaultInstance().getPodNamespace();
2957+
onChanged();
2958+
return this;
2959+
}
2960+
/**
2961+
*
2962+
*
2963+
* <pre>
2964+
* The k8s namespace of the Pod.
2965+
* </pre>
2966+
*
2967+
* <code>string pod_namespace = 7;</code>
2968+
*
2969+
* @param value The bytes for podNamespace to set.
2970+
* @return This builder for chaining.
2971+
*/
2972+
public Builder setPodNamespaceBytes(com.google.protobuf.ByteString value) {
2973+
if (value == null) {
2974+
throw new NullPointerException();
2975+
}
2976+
checkByteStringIsUtf8(value);
2977+
2978+
podNamespace_ = value;
2979+
onChanged();
2980+
return this;
2981+
}
2982+
27792983
private java.lang.Object pod_ = "";
27802984
/**
27812985
*

proto-google-cloud-binary-authorization-v1beta1/src/main/java/com/google/cloud/binaryauthorization/v1beta1/ContinuousValidationLoggingProto.java

+32-32
Original file line numberDiff line numberDiff line change
@@ -55,43 +55,43 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
5555
"\nLgoogle/cloud/binaryauthorization/v1bet"
5656
+ "a1/continuous_validation_logging.proto\022("
5757
+ "google.cloud.binaryauthorization.v1beta1"
58-
+ "\032\037google/protobuf/timestamp.proto\"\310\010\n\031Co"
58+
+ "\032\037google/protobuf/timestamp.proto\"\337\010\n\031Co"
5959
+ "ntinuousValidationEvent\022u\n\tpod_event\030\001 \001"
6060
+ "(\0132`.google.cloud.binaryauthorization.v1"
6161
+ "beta1.ContinuousValidationEvent.Continuo"
6262
+ "usValidationPodEventH\000\022~\n\030unsupported_po"
6363
+ "licy_event\030\002 \001(\0132Z.google.cloud.binaryau"
6464
+ "thorization.v1beta1.ContinuousValidation"
65-
+ "Event.UnsupportedPolicyEventH\000\032\366\005\n\034Conti"
66-
+ "nuousValidationPodEvent\022\013\n\003pod\030\001 \001(\t\022/\n\013"
67-
+ "deploy_time\030\002 \001(\0132\032.google.protobuf.Time"
68-
+ "stamp\022,\n\010end_time\030\003 \001(\0132\032.google.protobu"
69-
+ "f.Timestamp\022\212\001\n\007verdict\030\004 \001(\0162y.google.c"
70-
+ "loud.binaryauthorization.v1beta1.Continu"
71-
+ "ousValidationEvent.ContinuousValidationP"
72-
+ "odEvent.PolicyConformanceVerdict\022}\n\006imag"
73-
+ "es\030\005 \003(\0132m.google.cloud.binaryauthorizat"
74-
+ "ion.v1beta1.ContinuousValidationEvent.Co"
75-
+ "ntinuousValidationPodEvent.ImageDetails\032"
76-
+ "\200\002\n\014ImageDetails\022\r\n\005image\030\001 \001(\t\022\211\001\n\006resu"
77-
+ "lt\030\002 \001(\0162y.google.cloud.binaryauthorizat"
78-
+ "ion.v1beta1.ContinuousValidationEvent.Co"
79-
+ "ntinuousValidationPodEvent.ImageDetails."
80-
+ "AuditResult\022\023\n\013description\030\003 \001(\t\"@\n\013Audi"
81-
+ "tResult\022\034\n\030AUDIT_RESULT_UNSPECIFIED\020\000\022\t\n"
82-
+ "\005ALLOW\020\001\022\010\n\004DENY\020\002\"[\n\030PolicyConformanceV"
83-
+ "erdict\022*\n&POLICY_CONFORMANCE_VERDICT_UNS"
84-
+ "PECIFIED\020\000\022\023\n\017VIOLATES_POLICY\020\001\032-\n\026Unsup"
85-
+ "portedPolicyEvent\022\023\n\013description\030\001 \001(\tB\014"
86-
+ "\n\nevent_typeB\266\002\n,com.google.cloud.binary"
87-
+ "authorization.v1beta1B ContinuousValidat"
88-
+ "ionLoggingProtoP\001Z[google.golang.org/gen"
89-
+ "proto/googleapis/cloud/binaryauthorizati"
90-
+ "on/v1beta1;binaryauthorization\370\001\001\252\002(Goog"
91-
+ "le.Cloud.BinaryAuthorization.V1Beta1\312\002(G"
92-
+ "oogle\\Cloud\\BinaryAuthorization\\V1beta1\352"
93-
+ "\002+Google::Cloud::BinaryAuthorization::V1"
94-
+ "beta1b\006proto3"
65+
+ "Event.UnsupportedPolicyEventH\000\032\215\006\n\034Conti"
66+
+ "nuousValidationPodEvent\022\025\n\rpod_namespace"
67+
+ "\030\007 \001(\t\022\013\n\003pod\030\001 \001(\t\022/\n\013deploy_time\030\002 \001(\013"
68+
+ "2\032.google.protobuf.Timestamp\022,\n\010end_time"
69+
+ "\030\003 \001(\0132\032.google.protobuf.Timestamp\022\212\001\n\007v"
70+
+ "erdict\030\004 \001(\0162y.google.cloud.binaryauthor"
71+
+ "ization.v1beta1.ContinuousValidationEven"
72+
+ "t.ContinuousValidationPodEvent.PolicyCon"
73+
+ "formanceVerdict\022}\n\006images\030\005 \003(\0132m.google"
74+
+ ".cloud.binaryauthorization.v1beta1.Conti"
75+
+ "nuousValidationEvent.ContinuousValidatio"
76+
+ "nPodEvent.ImageDetails\032\200\002\n\014ImageDetails\022"
77+
+ "\r\n\005image\030\001 \001(\t\022\211\001\n\006result\030\002 \001(\0162y.google"
78+
+ ".cloud.binaryauthorization.v1beta1.Conti"
79+
+ "nuousValidationEvent.ContinuousValidatio"
80+
+ "nPodEvent.ImageDetails.AuditResult\022\023\n\013de"
81+
+ "scription\030\003 \001(\t\"@\n\013AuditResult\022\034\n\030AUDIT_"
82+
+ "RESULT_UNSPECIFIED\020\000\022\t\n\005ALLOW\020\001\022\010\n\004DENY\020"
83+
+ "\002\"[\n\030PolicyConformanceVerdict\022*\n&POLICY_"
84+
+ "CONFORMANCE_VERDICT_UNSPECIFIED\020\000\022\023\n\017VIO"
85+
+ "LATES_POLICY\020\001\032-\n\026UnsupportedPolicyEvent"
86+
+ "\022\023\n\013description\030\001 \001(\tB\014\n\nevent_typeB\266\002\n,"
87+
+ "com.google.cloud.binaryauthorization.v1b"
88+
+ "eta1B ContinuousValidationLoggingProtoP\001"
89+
+ "Z[google.golang.org/genproto/googleapis/"
90+
+ "cloud/binaryauthorization/v1beta1;binary"
91+
+ "authorization\370\001\001\252\002(Google.Cloud.BinaryAu"
92+
+ "thorization.V1Beta1\312\002(Google\\Cloud\\Binar"
93+
+ "yAuthorization\\V1beta1\352\002+Google::Cloud::"
94+
+ "BinaryAuthorization::V1beta1b\006proto3"
9595
};
9696
descriptor =
9797
com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(
@@ -115,7 +115,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() {
115115
new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
116116
internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor,
117117
new java.lang.String[] {
118-
"Pod", "DeployTime", "EndTime", "Verdict", "Images",
118+
"PodNamespace", "Pod", "DeployTime", "EndTime", "Verdict", "Images",
119119
});
120120
internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_ImageDetails_descriptor =
121121
internal_static_google_cloud_binaryauthorization_v1beta1_ContinuousValidationEvent_ContinuousValidationPodEvent_descriptor

0 commit comments

Comments
 (0)