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

try #52

Merged
merged 21 commits into from
Aug 21, 2024
Merged

try #52

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4fc3c69
try
randymgeorge Aug 21, 2024
fea7860
update tests
randymgeorge Aug 21, 2024
e7c3687
Update k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
976a00a
Update k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
0cb31df
Update k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
34ae42d
Update notificationsintegrations_test.go
randymgeorge Aug 21, 2024
46c7ac8
Update notifications_integration.pb.validate_test.go
randymgeorge Aug 21, 2024
5789274
Update api/kessel/inventory/v1beta1/k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
29203de
Update api/kessel/inventory/v1beta1/reporter_data.proto
randymgeorge Aug 21, 2024
329925b
Update api/kessel/inventory/v1beta1/k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
cee0014
Update api/kessel/inventory/v1beta1/k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
4636416
Update api/kessel/inventory/v1beta1/reporter_data.proto
randymgeorge Aug 21, 2024
239296a
Update reporter_data.pb.validate_test.go
randymgeorge Aug 21, 2024
7d3f3ab
Merge branch 'enum2' of https://github.com/project-kessel/inventory-a…
randymgeorge Aug 21, 2024
3664a41
Update reporter_data.proto
randymgeorge Aug 21, 2024
177d815
Update rhel_host.pb.validate_test.go
randymgeorge Aug 21, 2024
96b2f0c
updated description for local_resource_id
randymgeorge Aug 21, 2024
bea45e8
Update api/kessel/inventory/v1beta1/k8s_cluster_detail.proto
randymgeorge Aug 21, 2024
3a2707d
test data
randymgeorge Aug 21, 2024
772cad4
Merge branch 'enum2' of https://github.com/project-kessel/inventory-a…
randymgeorge Aug 21, 2024
b7c548a
update after build
randymgeorge Aug 21, 2024
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
2 changes: 2 additions & 0 deletions api/buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: buf.build/project-kessel/inventory-api
lint:
use:
- DEFAULT
except:
- ENUM_VALUE_PREFIX
breaking:
use:
- FILE
Expand Down
305 changes: 145 additions & 160 deletions api/kessel/inventory/v1beta1/k8s_cluster_detail.pb.go

Large diffs are not rendered by default.

63 changes: 33 additions & 30 deletions api/kessel/inventory/v1beta1/k8s_cluster_detail.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ syntax = "proto3";

package kessel.inventory.v1beta1;

import "validate/validate.proto";

import "kessel/inventory/v1beta1/k8s_cluster_detail_nodes_inner.proto";
import "validate/validate.proto";

option go_package = "github.com/project-kessel/inventory-api/api/kessel/inventory/v1beta1";
option java_multiple_files = true;
Expand All @@ -16,50 +15,54 @@ message K8sClusterDetail {
// the aggregate status of the cluster
enum ClusterStatus {
CLUSTER_STATUS_UNSPECIFIED = 0;
CLUSTER_STATUS_READY = 1;
CLUSTER_STATUS_FAILED = 2;
CLUSTER_STATUS_OFFLINE = 3;
CLUSTER_STATUS_OTHER = 1;
READY = 2;
FAILED = 3;
OFFLINE = 4;
}

// The kubernetes vendor
enum KubeVendor {
KUBE_VENDOR_UNSPECIFIED = 0;
KUBE_VENDOR_OTHER = 1;
KUBE_VENDOR_AKS = 2;
KUBE_VENDOR_EKS = 3;
KUBE_VENDOR_IKS = 4;
KUBE_VENDOR_OPENSHIFT = 5;
KUBE_VENDOR_GKE = 6;
AKS = 2;
EKS = 3;
IKS = 4;
OPENSHIFT = 5;
GKE = 6;
}

// The platform on which this cluster is hosted
enum CloudPlatform {
CLOUD_PLATFORM_UNSPECIFIED = 0;
CLOUD_PLATFORM_NONE_UPI = 1;
CLOUD_PLATFORM_BAREMETAL_IPI = 2;
CLOUD_PLATFORM_BAREMETAL_UPI = 3;
CLOUD_PLATFORM_AWS_IPI = 4;
CLOUD_PLATFORM_AWS_UPI = 5;
CLOUD_PLATFORM_AZURE_IPI = 6;
CLOUD_PLATFORM_AZURE_UPI = 7;
CLOUD_PLATFORM_IBMCLOUD_IPI = 8;
CLOUD_PLATFORM_IBMCLOUD_UPI = 9;
CLOUD_PLATFORM_KUBEVIRT_IPI = 10;
CLOUD_PLATFORM_OPENSTACK_IPI = 11;
CLOUD_PLATFORM_OPENSTACK_UPI = 12;
CLOUD_PLATFORM_GCP_IPI = 13;
CLOUD_PLATFORM_GCP_UPI = 14;
CLOUD_PLATFORM_NUTANIX_IPI = 15;
CLOUD_PLATFORM_NUTANIX_UPI = 16;
CLOUD_PLATFORM_VSPHERE_IPI = 17;
CLOUD_PLATFORM_VSPHERE_UPI = 18;
CLOUD_PLATFORM_OVIRT_IPI = 19;
CLOUD_PLATFORM_OTHER = 1;
NONE_UPI = 2;
BAREMETAL_IPI = 3;
BAREMETAL_UPI = 4;
AWS_IPI = 5;
AWS_UPI = 6;
AZURE_IPI = 7;
AZURE_UPI = 8;
IBMCLOUD_IPI = 9;
IBMCLOUD_UPI = 10;
KUBEVIRT_IPI = 11;
OPENSTACK_IPI = 12;
OPENSTACK_UPI = 13;
GCP_IPI = 14;
GCP_UPI = 15;
NUTANIX_IPI = 16;
NUTANIX_UPI = 17;
VSPHERE_IPI = 18;
VSPHERE_UPI = 19;
OVIRT_IPI = 20;


}

// The OCP cluster ID or ARN etc for *KS
string external_cluster_id = 219571597 [ (validate.rules).string.min_len = 1 ];

ClusterStatus cluster_status = 499346904 [ (validate.rules).enum = {not_in: [0], defined_only: true} ];
ClusterStatus cluster_status = 499346904 [ (validate.rules).enum = {not_in: [0], defined_only: true} ];

// The version of kubernetes
string kube_version = 395858490;
Expand Down
4 changes: 2 additions & 2 deletions api/kessel/inventory/v1beta1/k8s_clusters_service.pb.go

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

4 changes: 2 additions & 2 deletions api/kessel/inventory/v1beta1/k8s_clusters_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ message CreateK8sClusterResponse {}

message UpdateK8sClusterRequest {
// The {resource} format
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\".
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\".
string resource = 1;
// The k8s clsuter to update
K8sCluster k8s_cluster = 2;
Expand All @@ -29,7 +29,7 @@ message UpdateK8sClusterResponse {}

message DeleteK8sClusterRequest {
// The {resource} format
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\".
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\".
string resource = 1;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package v1beta1

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestNotificationIntegrationOptionalMetadata(t *testing.T) {
notifintegration := NotificationsIntegration{
ReporterData: &ReporterData{
ReporterType: ReporterData_REPORTER_TYPE_OCM,
ReporterType: ReporterData_OCM,
LocalResourceId: "foo",
},
}
Expand All @@ -20,7 +21,7 @@ func TestNotificationIntegrationOptionalMetadata(t *testing.T) {
func TestNotificationIntegrationMetadataIsValidatedIfFound(t *testing.T) {
notifintegration := NotificationsIntegration{
ReporterData: &ReporterData{
ReporterType: ReporterData_REPORTER_TYPE_OCM,
ReporterType: ReporterData_OCM,
LocalResourceId: "foo",
},
Metadata: &Metadata{
Expand Down

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

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message CreateNotificationsIntegrationResponse {

message UpdateNotificationsIntegrationRequest {
// A resource instance using the format:
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\"
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\"
string resource = 1;
// The NotificationsIntegration to update
NotificationsIntegration integration = 2;
Expand All @@ -32,7 +32,7 @@ message UpdateNotificationsIntegrationResponse {}

message DeleteNotificationsIntegrationRequest {
// A resource instance using the format:
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\"
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\"
string resource = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions api/kessel/inventory/v1beta1/policies_service.pb.go

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

4 changes: 2 additions & 2 deletions api/kessel/inventory/v1beta1/policies_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message CreatePolicyResponse {

message UpdatePolicyRequest {
// The {resource} format
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\".
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\".
string resource = 1;
// The Policy to update in Kessel Asset Inventory
Policy policy = 2;
Expand All @@ -32,7 +32,7 @@ message UpdatePolicyResponse {}

message DeletePolicyRequest {
// The {resource} format
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\".
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\".
string resource = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion api/kessel/inventory/v1beta1/relationships_service.pb.go

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

2 changes: 1 addition & 1 deletion api/kessel/inventory/v1beta1/relationships_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ message UpdateResourceRelationshipByUrnHsRequest {
// resource, object resource}. A relationship is between a Subject and an
// Object, e.g. a Policy (subject) has a propagated relationship to an k8s
// cluster (object).. The {resource} format
// \"<reporter_data.reporter_type>:<reporter_data.resourceId_alias>\".
// \"<reporter_data.reporter_type>:<reporter_data.local_resource_id>\".
PolicyRelationship policy_relationship = 2;
}

Expand Down
71 changes: 36 additions & 35 deletions api/kessel/inventory/v1beta1/reporter_data.pb.go

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

Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package v1beta1

import (
"github.com/stretchr/testify/assert"
"strconv"
"testing"

"github.com/stretchr/testify/assert"
)

func TestReporterDataValid(t *testing.T) {
reporter := ReporterData{
ReporterType: ReporterData_REPORTER_TYPE_OCM,
ReporterType: ReporterData_OCM,
LocalResourceId: "my-id",
}

Expand Down
Loading
Loading