Skip to content
Merged
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
20 changes: 20 additions & 0 deletions crd/clustersubnetstate/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.DEFAULT_GOAL = all

REPO_ROOT = $(shell git rev-parse --show-toplevel)
TOOLS_DIR = $(REPO_ROOT)/build/tools
TOOLS_BIN_DIR = $(REPO_ROOT)/build/tools/bin
CONTROLLER_GEN = $(TOOLS_BIN_DIR)/controller-gen

.PHONY: generate manifests

all: generate manifests

generate: $(CONTROLLER_GEN)
$(CONTROLLER_GEN) object paths="./..."

manifests: $(CONTROLLER_GEN)
mkdir -p manifests
$(CONTROLLER_GEN) crd paths="./..." output:crd:artifacts:config=manifests/

$(CONTROLLER_GEN):
@make -C $(REPO_ROOT) $(CONTROLLER_GEN)
49 changes: 49 additions & 0 deletions crd/clustersubnetstate/api/v1alpha1/clustersubnetstate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// Important: Run "make" to regenerate code after modifying this file

// +kubebuilder:object:root=true

// ClusterSubnetState is the Schema for the ClusterSubnetState API
// +kubebuilder:object:root=true
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Timestamp",type=string,JSONPath=`.status.exhausted`
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.spec.timestamp`
type ClusterSubnetState struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

Spec ClusterSubnetStateSpec `json:"spec,omitempty"`
Status ClusterSubnetStateStatus `json:"status,omitempty"`
}

// ClusterSubnetStateSpec defines the desired state of ClusterSubnetState
type ClusterSubnetStateSpec struct {
Timestamp string `json:"Timestamp"`
}

// ClusterSubnetStateStatus defines the observed state of ClusterSubnetState
type ClusterSubnetStateStatus struct {
Exhausted bool `json:"Exhausted"`
}

// +kubebuilder:object:root=true

// ClusterSubnetStateList contains a list of ClusterSubnetState
type ClusterSubnetStateList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterSubnetState `json:"items"`
}

func init() {
SchemeBuilder.Register(&ClusterSubnetState{}, &ClusterSubnetStateList{})
}
23 changes: 23 additions & 0 deletions crd/clustersubnetstate/api/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//go:build !ignore_uncovered
// +build !ignore_uncovered

// Package v1alpha contains API Schema definitions for the acn v1alpha API group
// +kubebuilder:object:generate=true
// +groupName=acn.azure.com
package v1alpha1

import (
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
// GroupVersion is group version used to register these objects
GroupVersion = schema.GroupVersion{Group: "acn.azure.com", Version: "v1alpha1"}

// SchemeBuilder is used to add go types to the GroupVersionKind scheme
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

// AddToScheme adds the types in this group-version to the given scheme.
AddToScheme = SchemeBuilder.AddToScheme
)
99 changes: 99 additions & 0 deletions crd/clustersubnetstate/api/v1alpha1/zz_generated.deepcopy.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
@@ -0,0 +1,62 @@
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.9.0
creationTimestamp: null
name: clustersubnetstates.acn.azure.com
spec:
group: acn.azure.com
names:
kind: ClusterSubnetState
listKind: ClusterSubnetStateList
plural: clustersubnetstates
singular: clustersubnetstate
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.exhausted
name: Timestamp
type: string
- jsonPath: .spec.timestamp
name: Status
type: string
name: v1alpha1
schema:
openAPIV3Schema:
description: ClusterSubnetState is the Schema for the ClusterSubnetState API
properties:
apiVersion:
description: 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
type: string
kind:
description: 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
type: string
metadata:
type: object
spec:
description: ClusterSubnetStateSpec defines the desired state of ClusterSubnetState
properties:
Timestamp:
type: string
required:
- Timestamp
type: object
status:
description: ClusterSubnetStateStatus defines the observed state of ClusterSubnetState
properties:
Exhausted:
type: boolean
required:
- Exhausted
type: object
type: object
served: true
storage: true
subresources:
status: {}