Skip to content

Commit

Permalink
Updating litmus-clientset and k8s version to 1.21.2 (#34)
Browse files Browse the repository at this point in the history
Signed-off-by: Shubham Chaudhary <[email protected]>
  • Loading branch information
ispeakc0de authored Jul 14, 2022
1 parent d8d1656 commit d7513d6
Show file tree
Hide file tree
Showing 38 changed files with 1,059 additions and 1,342 deletions.
21 changes: 21 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,24 @@ push-amd64:
@echo "--> Push chaos-scheduler amd-64 docker image"
@echo "--------------------------------------------"
@sudo docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(DOCKER_TAG)

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
CONTROLLER_TOOLS_VERSION ?= v0.9.0

.PHONY: controller-gen
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary.
$(CONTROLLER_GEN): $(LOCALBIN)
GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION)


.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases

.PHONY: generate
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@
/*
Copyright 2019 LitmusChaos Authors
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.
*/

package v1alpha1

import (
operatorV1 "github.com/litmuschaos/chaos-operator/pkg/apis/litmuschaos/v1alpha1"
operatorV1 "github.com/litmuschaos/chaos-operator/api/litmuschaos/v1alpha1"
coreV1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.

// ChaosScheduleSpec describes a user-facing custom resource which is used by developers
// +k8s:openapi-gen=true
// to create a chaos profile
// ChaosScheduleSpec defines the desired state of ChaosSchedule
type ChaosScheduleSpec struct {
// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kube-builder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// ChaosServiceAccount is the SA specified for chaos runner pods
ChaosServiceAccount string `json:"chaosServiceAccount,omitempty"`
// Execution schedule of batch of chaos experiments
Schedule Schedule `json:"schedule,omitempty"`
// ScheduleState determines whether to "halt", "abort" or "active" the schedule
ScheduleState ScheduleState `json:"scheduleState,omitempty"`
// TODO
// ConcurrencyPolicy will state whether two engines from the same schedule
// can exist simultaneously or not
ConcurrencyPolicy ConcurrencyPolicy `json:"concurrencyPolicy,omitempty"`
Expand Down Expand Up @@ -90,12 +97,8 @@ type ScheduleStatus struct {
ExpectedNextRunTime *metav1.Time `json:"expectedNextRunTime,omitempty"`
}

// ChaosScheduleStatus derives information about status of individual experiments
// +k8s:openapi-gen=true
// ChaosScheduleStatus defines the observed state of ChaosSchedule
type ChaosScheduleStatus struct {
// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
// Add custom validation using kube-builder tags: https://book-v1.book.kubebuilder.io/beyond_basics/generating_crd.html
// Schedule depicts status of the schedule whether active, aborted or halted
Schedule ScheduleStatus `json:"schedule,omitempty"`
// LastScheduleTime states the last time an engine was created
Expand Down Expand Up @@ -177,11 +180,10 @@ type WorkDays struct {

// +genclient
// +resource:path=chaosschedule
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// ChaosSchedule is the Schema for the chaosschedules API
// +k8s:openapi-gen=true
// +kubebuilder:subresource:status
type ChaosSchedule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand All @@ -190,7 +192,7 @@ type ChaosSchedule struct {
Status ChaosScheduleStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
//+kubebuilder:object:root=true

// ChaosScheduleList contains a list of ChaosSchedule
type ChaosScheduleList struct {
Expand Down
36 changes: 36 additions & 0 deletions api/litmuschaos/v1alpha1/groupversion_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2019 LitmusChaos Authors
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.
*/

// Package v1alpha1 contains API Schema definitions for the litmuschaos.io v1alpha1 API group
//+kubebuilder:object:generate=true
//+groupName=litmuschaos.io
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: "litmuschaos.io", 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
)

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

2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) && \

RUN go env

RUN CGO_ENABLED=0 go build -o /output/chaos-scheduler -v ./cmd/manager/
RUN CGO_ENABLED=0 go build -o /output/chaos-scheduler -v ./main.go

# Packaging stage
# Image source: https://github.com/litmuschaos/test-tools/blob/master/custom/hardened-alpine/infra/Dockerfile
Expand Down
Loading

0 comments on commit d7513d6

Please sign in to comment.