Skip to content

Commit

Permalink
Merge branch 'openyurtio:master' into proposal4yurtappconfigurationre…
Browse files Browse the repository at this point in the history
…placement
  • Loading branch information
vie-serendipity authored Aug 19, 2023
2 parents 1d61fda + d15078f commit edbbea0
Show file tree
Hide file tree
Showing 312 changed files with 13,487 additions and 4,487 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ yurthub, node-servant, yurt-manager ]
target: [ yurthub, node-servant, yurt-manager, yurt-iot-dock ]
steps:
- uses: actions/checkout@v3
with:
Expand Down
22 changes: 18 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
KUBECTL_VERSION ?= v1.22.3
KUBECTL ?= $(LOCALBIN)/kubectl

YQ_VERSION := 4.13.2
YQ := $(shell command -v $(LOCALBIN)/yq 2> /dev/null)

.PHONY: clean all build test

all: test build
Expand All @@ -72,8 +75,8 @@ build:

# Run test
test:
go test -v -short ./pkg/... ./cmd/... -coverprofile cover.out
go test -v -coverpkg=./pkg/yurttunnel/... -coverprofile=yurttunnel-cover.out ./test/integration/yurttunnel_test.go
go test -v ./pkg/... ./cmd/... -coverprofile cover.out
go test -v -coverpkg=./pkg/yurttunnel/... -coverprofile=yurttunnel-cover.out ./test/integration/yurttunnel_test.go

clean:
-rm -Rf _output
Expand Down Expand Up @@ -171,12 +174,14 @@ docker-push-yurt-tunnel-server: docker-buildx-builder
docker-push-yurt-tunnel-agent: docker-buildx-builder
docker buildx build --no-cache --push ${DOCKER_BUILD_ARGS} --platform ${TARGET_PLATFORMS} -f hack/dockerfiles/release/Dockerfile.yurt-tunnel-agent . -t ${IMAGE_REPO}/yurt-tunnel-agent:${GIT_VERSION}

docker-push-yurt-iot-dock: docker-buildx-builder
docker buildx build --no-cache --push ${DOCKER_BUILD_ARGS} --platform ${TARGET_PLATFORMS} -f hack/dockerfiles/release/Dockerfile.yurt-iot-dock . -t ${IMAGE_REPO}/yurt-iot-dock:${GIT_VERSION}

generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
# hack/make-rule/generate_openapi.sh // TODO by kadisi
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./pkg/apis/..."

manifests: kustomize kubectl generate ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
manifests: kustomize kubectl yq generate ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
rm -rf $(BUILD_KUSTOMIZE)
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=role webhook paths="./pkg/..." output:crd:artifacts:config=$(BUILD_KUSTOMIZE)/auto_generate/crd output:rbac:artifacts:config=$(BUILD_KUSTOMIZE)/auto_generate/rbac output:webhook:artifacts:config=$(BUILD_KUSTOMIZE)/auto_generate/webhook
hack/make-rules/kustomize_to_chart.sh --crd $(BUILD_KUSTOMIZE)/auto_generate/crd --webhook $(BUILD_KUSTOMIZE)/auto_generate/webhook --rbac $(BUILD_KUSTOMIZE)/auto_generate/rbac --output $(BUILD_KUSTOMIZE)/kustomize --chartDir charts/yurt-manager
Expand Down Expand Up @@ -217,6 +222,16 @@ $(KUSTOMIZE): $(LOCALBIN)
fi
test -s $(LOCALBIN)/kustomize || { curl -Ss $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN); }

.PHONY: yq
yq:
ifndef YQ
@echo "Installing yq..."
test -s $(LOCALBIN)/yq || curl -k -L https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_$(shell go env GOOS)_$(shell go env GOARCH) -o $(LOCALBIN)/yq
chmod +x $(LOCALBIN)/yq
else
@echo "yq is already installed"
endif

# go-get-tool will 'go get' any package $2 and install it to $1.
PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))
define go-get-tool
Expand All @@ -231,7 +246,6 @@ rm -rf $$TMP_DIR ;\
}
endef


fmt:
go fmt ./...
find . -name '*.go' | grep -Ev 'vendor|thrift_gen' | xargs goimports -w
Expand Down
509 changes: 221 additions & 288 deletions charts/yurt-manager/crds/apps.openyurt.io_nodepools.yaml

Large diffs are not rendered by default.

172 changes: 172 additions & 0 deletions charts/yurt-manager/crds/iot.openyurt.io_deviceprofiles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: deviceprofiles.iot.openyurt.io
spec:
group: iot.openyurt.io
names:
kind: DeviceProfile
listKind: DeviceProfileList
plural: deviceprofiles
shortNames:
- dp
singular: deviceprofile
scope: Namespaced
versions:
- additionalPrinterColumns:
- description: The nodepool of deviceProfile
jsonPath: .spec.nodePool
name: NODEPOOL
type: string
- description: The synced status of deviceProfile
jsonPath: .status.synced
name: SYNCED
type: boolean
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: DeviceProfile represents the attributes and operational capabilities
of a device. It is a template for which there can be multiple matching devices
within a given system. NOTE This struct is derived from edgex/go-mod-core-contracts/models/deviceprofile.go
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: DeviceProfileSpec defines the desired state of DeviceProfile
properties:
description:
type: string
deviceCommands:
items:
properties:
isHidden:
type: boolean
name:
type: string
readWrite:
type: string
resourceOperations:
items:
properties:
defaultValue:
type: string
deviceResource:
type: string
mappings:
additionalProperties:
type: string
type: object
required:
- defaultValue
type: object
type: array
required:
- isHidden
- name
- readWrite
- resourceOperations
type: object
type: array
deviceResources:
items:
properties:
attributes:
additionalProperties:
type: string
type: object
description:
type: string
isHidden:
type: boolean
name:
type: string
properties:
properties:
assertion:
type: string
base:
type: string
defaultValue:
type: string
mask:
type: string
maximum:
type: string
mediaType:
type: string
minimum:
type: string
offset:
type: string
readWrite:
type: string
scale:
type: string
shift:
type: string
units:
type: string
valueType:
type: string
type: object
tag:
type: string
required:
- description
- isHidden
- name
- properties
type: object
type: array
labels:
description: Labels used to search for groups of profiles on EdgeX
Foundry
items:
type: string
type: array
manufacturer:
description: Manufacturer of the device
type: string
model:
description: Model of the device
type: string
nodePool:
description: NodePool specifies which nodePool the deviceProfile belongs
to
type: string
type: object
status:
description: DeviceProfileStatus defines the observed state of DeviceProfile
properties:
id:
type: string
synced:
type: boolean
type: object
type: object
served: true
storage: true
subresources:
status: {}
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
Loading

0 comments on commit edbbea0

Please sign in to comment.