Skip to content

Commit

Permalink
ci(main): fix gen version package (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: cuisongliu <cuisongliu@qq.com>
  • Loading branch information
cuisongliu committed Oct 4, 2024
1 parent ed87c8f commit 63aa395
Show file tree
Hide file tree
Showing 20 changed files with 1,188 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
sudo sealos version
- name: build
run: |
go run gen/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
cd deploy
IMAGE_NAME="ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:latest"
sudo sealos build -t "${IMAGE_NAME}"-amd64 --platform linux/amd64 . && sudo rm -rf registry
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@ jobs:
sudo sealos version
- name: build
run: |
go run gen/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:latest && make info
cd deploy
sudo sealos build -t ghcr.io/${{ github.repository_owner }}/automq-operator-sealos:latest .
2 changes: 1 addition & 1 deletion .github/workflows/update_version_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
vPrefix = true
releaseBranch = main
versionFile = .tagpr
command = go run gen/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:${{ github.event.inputs.version }} && make info
command = go run gen/version/gen.go ghcr.io/${{ github.repository_owner }}/automq-operator:${{ github.event.inputs.version }} && make info
release = false
changelog = true
EOF
Expand Down
2 changes: 1 addition & 1 deletion .tagpr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
vPrefix = true
releaseBranch = main
versionFile = .tagpr
command = go run gen/gen.go ghcr.io/cuisongliu/automq-operator:v0.0.4 && make info
command = go run gen/version/gen.go ghcr.io/cuisongliu/automq-operator:v0.0.4 && make info
release = false
changelog = true
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,7 @@ info:
.PHONY: e2e
e2e: fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./e2e/... --ginkgo.v -v --ginkgo.trace


bindata:
go run gen/bindata/main.go
7 changes: 2 additions & 5 deletions api/v1beta1/automq_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ const (
AutoMQError AutoMQPhase = "Error"
AutoMQReady AutoMQPhase = "Ready"
AutoMQInProcess AutoMQPhase = "InProcess"
AutoMQUnknown AutoMQPhase = "Unknown"
AutoMQDefaultMessage string = "success"
)

Expand All @@ -165,23 +166,19 @@ type AutoMQStatus struct {
Phase AutoMQPhase `json:"phase,omitempty"`
// Conditions contains the different condition statuses for this automq.
// +optional
Conditions []StatusCondition `json:"conditions"`
Conditions []metav1.Condition `json:"conditions"`
// ReadyPods is the number of ready pods for the AutoMQ
// +optional
// +kubebuilder:validation:Minimum=0
// +kubebuilder:default=0
ReadyPods int32 `json:"readyPods"`
// ShortMessage is a human-readable string indicating details about why the AutoMQ is in this condition.
// +optional
ShortMessage string `json:"shortMessage,omitempty"`
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status
// +kubebuilder:resource:scope=Namespaced
// +kubebuilder:printcolumn:name="Ready Pods",type=string,JSONPath=`.status.readyPods`
// +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`
// +kubebuilder:printcolumn:name="Message",type=string,JSONPath=`.status.shortMessage`
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

// AutoMQ is the Schema for the automqs API
Expand Down
78 changes: 0 additions & 78 deletions api/v1beta1/status.go

This file was deleted.

21 changes: 3 additions & 18 deletions api/v1beta1/zz_generated.deepcopy.go

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

53 changes: 37 additions & 16 deletions config/crd/bases/infra.cuisongliu.github.com_automqs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .status.shortMessage
name: Message
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down Expand Up @@ -605,28 +602,56 @@ spec:
description: Conditions contains the different condition statuses
for this automq.
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: LastTransitionTime is the last time the condition
changed from one status to another.
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: Message is a human-readable message indicating
details about the last status change.
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: Reason is a (brief) reason for the condition's
last status change.
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: Status is the status of the condition. One of True,
False, Unknown.
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: Type is the type of the condition.
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
Expand All @@ -641,10 +666,6 @@ spec:
format: int32
minimum: 0
type: integer
shortMessage:
description: ShortMessage is a human-readable string indicating details
about why the AutoMQ is in this condition.
type: string
type: object
type: object
served: true
Expand Down
Loading

0 comments on commit 63aa395

Please sign in to comment.