Refactor packr box usage into new assets library. Add faster DEV_IMAGE build (#1073)

This commit is contained in:
Jesse Suen 2019-02-01 13:12:52 -08:00 committed by GitHub
parent d6c88cd77a
commit 297a91fde4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
33 changed files with 278 additions and 263 deletions

View file

@ -1,4 +1,12 @@
# Prevent vendor directory from being copied to ensure we are not not pulling unexpected cruft from
# a user's workspace, and are only building off of what is locked by dep.
vendor
dist
.vscode/
.idea/
.DS_Store
vendor/
dist/
*.iml
# delve debug binaries
cmd/**/debug
debug.test
coverage.out

View file

@ -73,6 +73,33 @@ RUN curl -L -o /usr/local/bin/aws-iam-authenticator https://github.com/kubernete
chmod +x /usr/local/bin/aws-iam-authenticator
####################################################################################################
# Argo CD Base - used as the base for both the release and dev argocd images
####################################################################################################
FROM debian:9.5-slim as argocd-base
RUN groupadd -g 999 argocd && \
useradd -r -u 999 -g argocd argocd && \
mkdir -p /home/argocd && \
chown argocd:argocd /home/argocd && \
apt-get update && \
apt-get install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=builder /usr/local/bin/ks /usr/local/bin/ks
COPY --from=builder /usr/local/bin/helm /usr/local/bin/helm
COPY --from=builder /usr/local/bin/kubectl /usr/local/bin/kubectl
COPY --from=builder /usr/local/bin/kustomize /usr/local/bin/kustomize
COPY --from=builder /usr/local/bin/aws-iam-authenticator /usr/local/bin/aws-iam-authenticator
# workaround ksonnet issue https://github.com/ksonnet/ksonnet/issues/298
ENV USER=argocd
USER argocd
WORKDIR /home/argocd
####################################################################################################
# Argo CD Build stage which performs the actual build of Argo CD binaries
####################################################################################################
@ -101,28 +128,5 @@ RUN make cli server controller repo-server argocd-util && \
####################################################################################################
# Final image
####################################################################################################
FROM debian:9.5-slim
RUN groupadd -g 999 argocd && \
useradd -r -u 999 -g argocd argocd && \
mkdir -p /home/argocd && \
chown argocd:argocd /home/argocd && \
apt-get update && \
apt-get install -y git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=builder /usr/local/bin/ks /usr/local/bin/ks
COPY --from=builder /usr/local/bin/helm /usr/local/bin/helm
COPY --from=builder /usr/local/bin/kubectl /usr/local/bin/kubectl
COPY --from=builder /usr/local/bin/kustomize /usr/local/bin/kustomize
COPY --from=builder /usr/local/bin/aws-iam-authenticator /usr/local/bin/aws-iam-authenticator
# workaround ksonnet issue https://github.com/ksonnet/ksonnet/issues/298
ENV USER=argocd
COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/* /usr/local/bin/
USER argocd
WORKDIR /home/argocd
FROM argocd-base
COPY --from=argocd-build /go/src/github.com/argoproj/argo-cd/dist/argocd* /usr/local/bin/

5
Dockerfile.dev Normal file
View file

@ -0,0 +1,5 @@
####################################################################################################
# argocd-dev
####################################################################################################
FROM argocd-base
COPY argocd* /usr/local/bin/

View file

@ -10,15 +10,24 @@ GIT_TAG=$(shell if [ -z "`git status --porcelain`" ]; then git describe --exact-
GIT_TREE_STATE=$(shell if [ -z "`git status --porcelain`" ]; then echo "clean" ; else echo "dirty"; fi)
PACKR_CMD=$(shell if [ "`which packr`" ]; then echo "packr"; else echo "go run vendor/github.com/gobuffalo/packr/packr/main.go"; fi)
# docker image publishing options
DOCKER_PUSH=false
IMAGE_TAG=latest
# perform static compilation
STATIC_BUILD=true
# build development images
DEV_IMAGE=false
override LDFLAGS += \
-X ${PACKAGE}.version=${VERSION} \
-X ${PACKAGE}.buildDate=${BUILD_DATE} \
-X ${PACKAGE}.gitCommit=${GIT_COMMIT} \
-X ${PACKAGE}.gitTreeState=${GIT_TREE_STATE}
# docker image publishing options
DOCKER_PUSH=false
IMAGE_TAG=latest
ifeq (${STATIC_BUILD}, true)
override LDFLAGS += -extldflags "-static"
endif
ifneq (${GIT_TAG},)
IMAGE_TAG=${GIT_TAG}
LDFLAGS += -X ${PACKAGE}.gitTag=${GIT_TAG}
@ -50,7 +59,7 @@ codegen: protogen clientgen
.PHONY: cli
cli: clean-debug
${PACKR_CMD} build -v -i -ldflags '${LDFLAGS} -extldflags "-static"' -o ${DIST_DIR}/${CLI_NAME} ./cmd/argocd
CGO_ENABLED=0 ${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${CLI_NAME} ./cmd/argocd
.PHONY: release-cli
release-cli: clean-debug image
@ -62,7 +71,7 @@ release-cli: clean-debug image
.PHONY: argocd-util
argocd-util: clean-debug
# Build argocd-util as a statically linked binary, so it could run within the alpine-based dex container (argoproj/argo-cd#844)
CGO_ENABLED=0 go build -v -i -ldflags '${LDFLAGS} -extldflags "-static"' -o ${DIST_DIR}/argocd-util ./cmd/argocd-util
CGO_ENABLED=0 go build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-util ./cmd/argocd-util
.PHONY: manifests
manifests:
@ -82,9 +91,29 @@ repo-server:
controller:
${PACKR_CMD} build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-application-controller ./cmd/argocd-application-controller
.PHONY: packr
packr:
go build -o ${DIST_DIR}/packr ./vendor/github.com/gobuffalo/packr/packr/
.PHONY: image
ifeq ($(DEV_IMAGE), true)
# The "dev" image builds the binaries from the users desktop environment (instead of in Docker)
# which speeds up builds. Dockerfile.dev needs to be copied into dist to perform the build, since
# the dist directory is under .dockerignore.
image: packr
docker build -t argocd-base --target argocd-base .
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-server ./cmd/argocd-server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-application-controller ./cmd/argocd-application-controller
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-repo-server ./cmd/argocd-repo-server
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-util ./cmd/argocd-util
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd ./cmd/argocd
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 dist/packr build -v -i -ldflags '${LDFLAGS}' -o ${DIST_DIR}/argocd-darwin-amd64 ./cmd/argocd
cp Dockerfile.dev dist
docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) -f dist/Dockerfile.dev dist
else
image:
docker build -t $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) .
endif
@if [ "$(DOCKER_PUSH)" = "true" ] ; then docker push $(IMAGE_PREFIX)argocd:$(IMAGE_TAG) ; fi
.PHONY: builder-image

View file

@ -35,7 +35,7 @@ func (m *ResourcesQuery) Reset() { *m = ResourcesQuery{} }
func (m *ResourcesQuery) String() string { return proto.CompactTextString(m) }
func (*ResourcesQuery) ProtoMessage() {}
func (*ResourcesQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_application_9e06f70e07dd0483, []int{0}
return fileDescriptor_application_22f1e591d294b941, []int{0}
}
func (m *ResourcesQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -82,7 +82,7 @@ func (m *ResourceTreeResponse) Reset() { *m = ResourceTreeResponse{} }
func (m *ResourceTreeResponse) String() string { return proto.CompactTextString(m) }
func (*ResourceTreeResponse) ProtoMessage() {}
func (*ResourceTreeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_application_9e06f70e07dd0483, []int{1}
return fileDescriptor_application_22f1e591d294b941, []int{1}
}
func (m *ResourceTreeResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -129,7 +129,7 @@ func (m *ManagedResourcesResponse) Reset() { *m = ManagedResourcesRespon
func (m *ManagedResourcesResponse) String() string { return proto.CompactTextString(m) }
func (*ManagedResourcesResponse) ProtoMessage() {}
func (*ManagedResourcesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_application_9e06f70e07dd0483, []int{2}
return fileDescriptor_application_22f1e591d294b941, []int{2}
}
func (m *ManagedResourcesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -784,10 +784,10 @@ var (
)
func init() {
proto.RegisterFile("controller/services/application.proto", fileDescriptor_application_9e06f70e07dd0483)
proto.RegisterFile("controller/services/application.proto", fileDescriptor_application_22f1e591d294b941)
}
var fileDescriptor_application_9e06f70e07dd0483 = []byte{
var fileDescriptor_application_22f1e591d294b941 = []byte{
// 337 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x4a, 0x33, 0x31,
0x14, 0x6d, 0xbe, 0x0f, 0x05, 0xa3, 0xa8, 0x04, 0x17, 0xa5, 0x8b, 0x52, 0x06, 0x84, 0x6e, 0x4c,

View file

@ -12,7 +12,7 @@ configured, additional RBAC roles can be defined, and SSO groups can man be mapp
RBAC configuration allows defining roles and groups. Argo CD has two pre-defined roles:
* `role:readonly` - read-only access to all resources
* `role:admin` - unrestricted access to all resources
These role definitions can be seen in [builtin-policy.csv](../util/rbac/builtin-policy.csv)
These role definitions can be seen in [builtin-policy.csv](../assets/builtin-policy.csv)
Additional roles and groups can be configured in `argocd-rbac-cm` ConfigMap. The example below
configures a custom role, named `org-admin`. The role is assigned to any user which belongs to

View file

@ -87,7 +87,7 @@ done
collect_swagger() {
SWAGGER_ROOT="$1"
EXPECTED_COLLISIONS="$2"
SWAGGER_OUT="${SWAGGER_ROOT}/swagger.json"
SWAGGER_OUT="${PROJECT_ROOT}/assets/swagger.json"
PRIMARY_SWAGGER=`mktemp`
COMBINED_SWAGGER=`mktemp`

View file

@ -30,7 +30,7 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
func (m *AWSAuthConfig) Reset() { *m = AWSAuthConfig{} }
func (*AWSAuthConfig) ProtoMessage() {}
func (*AWSAuthConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{0}
return fileDescriptor_generated_40749977ef70bf25, []int{0}
}
func (m *AWSAuthConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -58,7 +58,7 @@ var xxx_messageInfo_AWSAuthConfig proto.InternalMessageInfo
func (m *AppProject) Reset() { *m = AppProject{} }
func (*AppProject) ProtoMessage() {}
func (*AppProject) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{1}
return fileDescriptor_generated_40749977ef70bf25, []int{1}
}
func (m *AppProject) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -86,7 +86,7 @@ var xxx_messageInfo_AppProject proto.InternalMessageInfo
func (m *AppProjectList) Reset() { *m = AppProjectList{} }
func (*AppProjectList) ProtoMessage() {}
func (*AppProjectList) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{2}
return fileDescriptor_generated_40749977ef70bf25, []int{2}
}
func (m *AppProjectList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -114,7 +114,7 @@ var xxx_messageInfo_AppProjectList proto.InternalMessageInfo
func (m *AppProjectSpec) Reset() { *m = AppProjectSpec{} }
func (*AppProjectSpec) ProtoMessage() {}
func (*AppProjectSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{3}
return fileDescriptor_generated_40749977ef70bf25, []int{3}
}
func (m *AppProjectSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -142,7 +142,7 @@ var xxx_messageInfo_AppProjectSpec proto.InternalMessageInfo
func (m *Application) Reset() { *m = Application{} }
func (*Application) ProtoMessage() {}
func (*Application) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{4}
return fileDescriptor_generated_40749977ef70bf25, []int{4}
}
func (m *Application) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -170,7 +170,7 @@ var xxx_messageInfo_Application proto.InternalMessageInfo
func (m *ApplicationCondition) Reset() { *m = ApplicationCondition{} }
func (*ApplicationCondition) ProtoMessage() {}
func (*ApplicationCondition) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{5}
return fileDescriptor_generated_40749977ef70bf25, []int{5}
}
func (m *ApplicationCondition) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -198,7 +198,7 @@ var xxx_messageInfo_ApplicationCondition proto.InternalMessageInfo
func (m *ApplicationDestination) Reset() { *m = ApplicationDestination{} }
func (*ApplicationDestination) ProtoMessage() {}
func (*ApplicationDestination) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{6}
return fileDescriptor_generated_40749977ef70bf25, []int{6}
}
func (m *ApplicationDestination) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -226,7 +226,7 @@ var xxx_messageInfo_ApplicationDestination proto.InternalMessageInfo
func (m *ApplicationList) Reset() { *m = ApplicationList{} }
func (*ApplicationList) ProtoMessage() {}
func (*ApplicationList) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{7}
return fileDescriptor_generated_40749977ef70bf25, []int{7}
}
func (m *ApplicationList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -254,7 +254,7 @@ var xxx_messageInfo_ApplicationList proto.InternalMessageInfo
func (m *ApplicationSource) Reset() { *m = ApplicationSource{} }
func (*ApplicationSource) ProtoMessage() {}
func (*ApplicationSource) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{8}
return fileDescriptor_generated_40749977ef70bf25, []int{8}
}
func (m *ApplicationSource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -282,7 +282,7 @@ var xxx_messageInfo_ApplicationSource proto.InternalMessageInfo
func (m *ApplicationSourceHelm) Reset() { *m = ApplicationSourceHelm{} }
func (*ApplicationSourceHelm) ProtoMessage() {}
func (*ApplicationSourceHelm) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{9}
return fileDescriptor_generated_40749977ef70bf25, []int{9}
}
func (m *ApplicationSourceHelm) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -310,7 +310,7 @@ var xxx_messageInfo_ApplicationSourceHelm proto.InternalMessageInfo
func (m *ApplicationSourceKsonnet) Reset() { *m = ApplicationSourceKsonnet{} }
func (*ApplicationSourceKsonnet) ProtoMessage() {}
func (*ApplicationSourceKsonnet) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{10}
return fileDescriptor_generated_40749977ef70bf25, []int{10}
}
func (m *ApplicationSourceKsonnet) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -338,7 +338,7 @@ var xxx_messageInfo_ApplicationSourceKsonnet proto.InternalMessageInfo
func (m *ApplicationSourceKustomize) Reset() { *m = ApplicationSourceKustomize{} }
func (*ApplicationSourceKustomize) ProtoMessage() {}
func (*ApplicationSourceKustomize) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{11}
return fileDescriptor_generated_40749977ef70bf25, []int{11}
}
func (m *ApplicationSourceKustomize) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -366,7 +366,7 @@ var xxx_messageInfo_ApplicationSourceKustomize proto.InternalMessageInfo
func (m *ApplicationSpec) Reset() { *m = ApplicationSpec{} }
func (*ApplicationSpec) ProtoMessage() {}
func (*ApplicationSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{12}
return fileDescriptor_generated_40749977ef70bf25, []int{12}
}
func (m *ApplicationSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -394,7 +394,7 @@ var xxx_messageInfo_ApplicationSpec proto.InternalMessageInfo
func (m *ApplicationStatus) Reset() { *m = ApplicationStatus{} }
func (*ApplicationStatus) ProtoMessage() {}
func (*ApplicationStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{13}
return fileDescriptor_generated_40749977ef70bf25, []int{13}
}
func (m *ApplicationStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -422,7 +422,7 @@ var xxx_messageInfo_ApplicationStatus proto.InternalMessageInfo
func (m *ApplicationWatchEvent) Reset() { *m = ApplicationWatchEvent{} }
func (*ApplicationWatchEvent) ProtoMessage() {}
func (*ApplicationWatchEvent) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{14}
return fileDescriptor_generated_40749977ef70bf25, []int{14}
}
func (m *ApplicationWatchEvent) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -450,7 +450,7 @@ var xxx_messageInfo_ApplicationWatchEvent proto.InternalMessageInfo
func (m *Cluster) Reset() { *m = Cluster{} }
func (*Cluster) ProtoMessage() {}
func (*Cluster) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{15}
return fileDescriptor_generated_40749977ef70bf25, []int{15}
}
func (m *Cluster) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -478,7 +478,7 @@ var xxx_messageInfo_Cluster proto.InternalMessageInfo
func (m *ClusterConfig) Reset() { *m = ClusterConfig{} }
func (*ClusterConfig) ProtoMessage() {}
func (*ClusterConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{16}
return fileDescriptor_generated_40749977ef70bf25, []int{16}
}
func (m *ClusterConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -506,7 +506,7 @@ var xxx_messageInfo_ClusterConfig proto.InternalMessageInfo
func (m *ClusterList) Reset() { *m = ClusterList{} }
func (*ClusterList) ProtoMessage() {}
func (*ClusterList) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{17}
return fileDescriptor_generated_40749977ef70bf25, []int{17}
}
func (m *ClusterList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -534,7 +534,7 @@ var xxx_messageInfo_ClusterList proto.InternalMessageInfo
func (m *ComparedTo) Reset() { *m = ComparedTo{} }
func (*ComparedTo) ProtoMessage() {}
func (*ComparedTo) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{18}
return fileDescriptor_generated_40749977ef70bf25, []int{18}
}
func (m *ComparedTo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -562,7 +562,7 @@ var xxx_messageInfo_ComparedTo proto.InternalMessageInfo
func (m *ComponentParameter) Reset() { *m = ComponentParameter{} }
func (*ComponentParameter) ProtoMessage() {}
func (*ComponentParameter) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{19}
return fileDescriptor_generated_40749977ef70bf25, []int{19}
}
func (m *ComponentParameter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -590,7 +590,7 @@ var xxx_messageInfo_ComponentParameter proto.InternalMessageInfo
func (m *ConnectionState) Reset() { *m = ConnectionState{} }
func (*ConnectionState) ProtoMessage() {}
func (*ConnectionState) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{20}
return fileDescriptor_generated_40749977ef70bf25, []int{20}
}
func (m *ConnectionState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -618,7 +618,7 @@ var xxx_messageInfo_ConnectionState proto.InternalMessageInfo
func (m *HealthStatus) Reset() { *m = HealthStatus{} }
func (*HealthStatus) ProtoMessage() {}
func (*HealthStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{21}
return fileDescriptor_generated_40749977ef70bf25, []int{21}
}
func (m *HealthStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -646,7 +646,7 @@ var xxx_messageInfo_HealthStatus proto.InternalMessageInfo
func (m *HelmRepository) Reset() { *m = HelmRepository{} }
func (*HelmRepository) ProtoMessage() {}
func (*HelmRepository) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{22}
return fileDescriptor_generated_40749977ef70bf25, []int{22}
}
func (m *HelmRepository) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -674,7 +674,7 @@ var xxx_messageInfo_HelmRepository proto.InternalMessageInfo
func (m *InfoItem) Reset() { *m = InfoItem{} }
func (*InfoItem) ProtoMessage() {}
func (*InfoItem) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{23}
return fileDescriptor_generated_40749977ef70bf25, []int{23}
}
func (m *InfoItem) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -702,7 +702,7 @@ var xxx_messageInfo_InfoItem proto.InternalMessageInfo
func (m *JWTToken) Reset() { *m = JWTToken{} }
func (*JWTToken) ProtoMessage() {}
func (*JWTToken) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{24}
return fileDescriptor_generated_40749977ef70bf25, []int{24}
}
func (m *JWTToken) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -730,7 +730,7 @@ var xxx_messageInfo_JWTToken proto.InternalMessageInfo
func (m *Operation) Reset() { *m = Operation{} }
func (*Operation) ProtoMessage() {}
func (*Operation) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{25}
return fileDescriptor_generated_40749977ef70bf25, []int{25}
}
func (m *Operation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -758,7 +758,7 @@ var xxx_messageInfo_Operation proto.InternalMessageInfo
func (m *OperationState) Reset() { *m = OperationState{} }
func (*OperationState) ProtoMessage() {}
func (*OperationState) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{26}
return fileDescriptor_generated_40749977ef70bf25, []int{26}
}
func (m *OperationState) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -786,7 +786,7 @@ var xxx_messageInfo_OperationState proto.InternalMessageInfo
func (m *ParameterOverrides) Reset() { *m = ParameterOverrides{} }
func (*ParameterOverrides) ProtoMessage() {}
func (*ParameterOverrides) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{27}
return fileDescriptor_generated_40749977ef70bf25, []int{27}
}
func (m *ParameterOverrides) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -814,7 +814,7 @@ var xxx_messageInfo_ParameterOverrides proto.InternalMessageInfo
func (m *ProjectRole) Reset() { *m = ProjectRole{} }
func (*ProjectRole) ProtoMessage() {}
func (*ProjectRole) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{28}
return fileDescriptor_generated_40749977ef70bf25, []int{28}
}
func (m *ProjectRole) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -842,7 +842,7 @@ var xxx_messageInfo_ProjectRole proto.InternalMessageInfo
func (m *Repository) Reset() { *m = Repository{} }
func (*Repository) ProtoMessage() {}
func (*Repository) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{29}
return fileDescriptor_generated_40749977ef70bf25, []int{29}
}
func (m *Repository) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -870,7 +870,7 @@ var xxx_messageInfo_Repository proto.InternalMessageInfo
func (m *RepositoryList) Reset() { *m = RepositoryList{} }
func (*RepositoryList) ProtoMessage() {}
func (*RepositoryList) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{30}
return fileDescriptor_generated_40749977ef70bf25, []int{30}
}
func (m *RepositoryList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -898,7 +898,7 @@ var xxx_messageInfo_RepositoryList proto.InternalMessageInfo
func (m *ResourceDiff) Reset() { *m = ResourceDiff{} }
func (*ResourceDiff) ProtoMessage() {}
func (*ResourceDiff) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{31}
return fileDescriptor_generated_40749977ef70bf25, []int{31}
}
func (m *ResourceDiff) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -926,7 +926,7 @@ var xxx_messageInfo_ResourceDiff proto.InternalMessageInfo
func (m *ResourceNode) Reset() { *m = ResourceNode{} }
func (*ResourceNode) ProtoMessage() {}
func (*ResourceNode) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{32}
return fileDescriptor_generated_40749977ef70bf25, []int{32}
}
func (m *ResourceNode) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -954,7 +954,7 @@ var xxx_messageInfo_ResourceNode proto.InternalMessageInfo
func (m *ResourceResult) Reset() { *m = ResourceResult{} }
func (*ResourceResult) ProtoMessage() {}
func (*ResourceResult) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{33}
return fileDescriptor_generated_40749977ef70bf25, []int{33}
}
func (m *ResourceResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -982,7 +982,7 @@ var xxx_messageInfo_ResourceResult proto.InternalMessageInfo
func (m *ResourceStatus) Reset() { *m = ResourceStatus{} }
func (*ResourceStatus) ProtoMessage() {}
func (*ResourceStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{34}
return fileDescriptor_generated_40749977ef70bf25, []int{34}
}
func (m *ResourceStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1010,7 +1010,7 @@ var xxx_messageInfo_ResourceStatus proto.InternalMessageInfo
func (m *RevisionHistory) Reset() { *m = RevisionHistory{} }
func (*RevisionHistory) ProtoMessage() {}
func (*RevisionHistory) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{35}
return fileDescriptor_generated_40749977ef70bf25, []int{35}
}
func (m *RevisionHistory) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1038,7 +1038,7 @@ var xxx_messageInfo_RevisionHistory proto.InternalMessageInfo
func (m *SyncOperation) Reset() { *m = SyncOperation{} }
func (*SyncOperation) ProtoMessage() {}
func (*SyncOperation) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{36}
return fileDescriptor_generated_40749977ef70bf25, []int{36}
}
func (m *SyncOperation) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1066,7 +1066,7 @@ var xxx_messageInfo_SyncOperation proto.InternalMessageInfo
func (m *SyncOperationResource) Reset() { *m = SyncOperationResource{} }
func (*SyncOperationResource) ProtoMessage() {}
func (*SyncOperationResource) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{37}
return fileDescriptor_generated_40749977ef70bf25, []int{37}
}
func (m *SyncOperationResource) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1094,7 +1094,7 @@ var xxx_messageInfo_SyncOperationResource proto.InternalMessageInfo
func (m *SyncOperationResult) Reset() { *m = SyncOperationResult{} }
func (*SyncOperationResult) ProtoMessage() {}
func (*SyncOperationResult) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{38}
return fileDescriptor_generated_40749977ef70bf25, []int{38}
}
func (m *SyncOperationResult) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1122,7 +1122,7 @@ var xxx_messageInfo_SyncOperationResult proto.InternalMessageInfo
func (m *SyncPolicy) Reset() { *m = SyncPolicy{} }
func (*SyncPolicy) ProtoMessage() {}
func (*SyncPolicy) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{39}
return fileDescriptor_generated_40749977ef70bf25, []int{39}
}
func (m *SyncPolicy) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1150,7 +1150,7 @@ var xxx_messageInfo_SyncPolicy proto.InternalMessageInfo
func (m *SyncPolicyAutomated) Reset() { *m = SyncPolicyAutomated{} }
func (*SyncPolicyAutomated) ProtoMessage() {}
func (*SyncPolicyAutomated) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{40}
return fileDescriptor_generated_40749977ef70bf25, []int{40}
}
func (m *SyncPolicyAutomated) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1178,7 +1178,7 @@ var xxx_messageInfo_SyncPolicyAutomated proto.InternalMessageInfo
func (m *SyncStatus) Reset() { *m = SyncStatus{} }
func (*SyncStatus) ProtoMessage() {}
func (*SyncStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{41}
return fileDescriptor_generated_40749977ef70bf25, []int{41}
}
func (m *SyncStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1206,7 +1206,7 @@ var xxx_messageInfo_SyncStatus proto.InternalMessageInfo
func (m *SyncStrategy) Reset() { *m = SyncStrategy{} }
func (*SyncStrategy) ProtoMessage() {}
func (*SyncStrategy) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{42}
return fileDescriptor_generated_40749977ef70bf25, []int{42}
}
func (m *SyncStrategy) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1234,7 +1234,7 @@ var xxx_messageInfo_SyncStrategy proto.InternalMessageInfo
func (m *SyncStrategyApply) Reset() { *m = SyncStrategyApply{} }
func (*SyncStrategyApply) ProtoMessage() {}
func (*SyncStrategyApply) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{43}
return fileDescriptor_generated_40749977ef70bf25, []int{43}
}
func (m *SyncStrategyApply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1262,7 +1262,7 @@ var xxx_messageInfo_SyncStrategyApply proto.InternalMessageInfo
func (m *SyncStrategyHook) Reset() { *m = SyncStrategyHook{} }
func (*SyncStrategyHook) ProtoMessage() {}
func (*SyncStrategyHook) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{44}
return fileDescriptor_generated_40749977ef70bf25, []int{44}
}
func (m *SyncStrategyHook) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1290,7 +1290,7 @@ var xxx_messageInfo_SyncStrategyHook proto.InternalMessageInfo
func (m *TLSClientConfig) Reset() { *m = TLSClientConfig{} }
func (*TLSClientConfig) ProtoMessage() {}
func (*TLSClientConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_generated_a74dce00e6839738, []int{45}
return fileDescriptor_generated_40749977ef70bf25, []int{45}
}
func (m *TLSClientConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -11699,10 +11699,10 @@ var (
)
func init() {
proto.RegisterFile("github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto", fileDescriptor_generated_a74dce00e6839738)
proto.RegisterFile("github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1/generated.proto", fileDescriptor_generated_40749977ef70bf25)
}
var fileDescriptor_generated_a74dce00e6839738 = []byte{
var fileDescriptor_generated_40749977ef70bf25 = []byte{
// 3013 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x3a, 0x5d, 0x8c, 0x1b, 0x57,
0xd5, 0x3b, 0xfe, 0xd9, 0xb5, 0x8f, 0x77, 0x37, 0xcd, 0xed, 0xcf, 0xe7, 0x6f, 0x0b, 0xbb, 0xab,

View file

@ -47,7 +47,7 @@ func (m *ManifestRequest) Reset() { *m = ManifestRequest{} }
func (m *ManifestRequest) String() string { return proto.CompactTextString(m) }
func (*ManifestRequest) ProtoMessage() {}
func (*ManifestRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_663ec589c162558e, []int{0}
return fileDescriptor_repository_d96dec39a34a8c7f, []int{0}
}
func (m *ManifestRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -154,7 +154,7 @@ func (m *ManifestResponse) Reset() { *m = ManifestResponse{} }
func (m *ManifestResponse) String() string { return proto.CompactTextString(m) }
func (*ManifestResponse) ProtoMessage() {}
func (*ManifestResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_663ec589c162558e, []int{1}
return fileDescriptor_repository_d96dec39a34a8c7f, []int{1}
}
func (m *ManifestResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -232,7 +232,7 @@ func (m *ListDirRequest) Reset() { *m = ListDirRequest{} }
func (m *ListDirRequest) String() string { return proto.CompactTextString(m) }
func (*ListDirRequest) ProtoMessage() {}
func (*ListDirRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_663ec589c162558e, []int{2}
return fileDescriptor_repository_d96dec39a34a8c7f, []int{2}
}
func (m *ListDirRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -294,7 +294,7 @@ func (m *FileList) Reset() { *m = FileList{} }
func (m *FileList) String() string { return proto.CompactTextString(m) }
func (*FileList) ProtoMessage() {}
func (*FileList) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_663ec589c162558e, []int{3}
return fileDescriptor_repository_d96dec39a34a8c7f, []int{3}
}
func (m *FileList) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -344,7 +344,7 @@ func (m *GetFileRequest) Reset() { *m = GetFileRequest{} }
func (m *GetFileRequest) String() string { return proto.CompactTextString(m) }
func (*GetFileRequest) ProtoMessage() {}
func (*GetFileRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_663ec589c162558e, []int{4}
return fileDescriptor_repository_d96dec39a34a8c7f, []int{4}
}
func (m *GetFileRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -406,7 +406,7 @@ func (m *GetFileResponse) Reset() { *m = GetFileResponse{} }
func (m *GetFileResponse) String() string { return proto.CompactTextString(m) }
func (*GetFileResponse) ProtoMessage() {}
func (*GetFileResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_663ec589c162558e, []int{5}
return fileDescriptor_repository_d96dec39a34a8c7f, []int{5}
}
func (m *GetFileResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -2147,10 +2147,10 @@ var (
)
func init() {
proto.RegisterFile("reposerver/repository/repository.proto", fileDescriptor_repository_663ec589c162558e)
proto.RegisterFile("reposerver/repository/repository.proto", fileDescriptor_repository_d96dec39a34a8c7f)
}
var fileDescriptor_repository_663ec589c162558e = []byte{
var fileDescriptor_repository_d96dec39a34a8c7f = []byte{
// 636 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xdf, 0x4e, 0xd4, 0x4e,
0x14, 0xa6, 0xb0, 0x2c, 0xbb, 0x67, 0x7f, 0x3f, 0x81, 0x09, 0x31, 0x93, 0x42, 0x48, 0xd3, 0xa8,

View file

@ -37,7 +37,7 @@ func (m *UpdatePasswordRequest) Reset() { *m = UpdatePasswordRequest{} }
func (m *UpdatePasswordRequest) String() string { return proto.CompactTextString(m) }
func (*UpdatePasswordRequest) ProtoMessage() {}
func (*UpdatePasswordRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_account_3e64cf795478a98b, []int{0}
return fileDescriptor_account_c12a236fbb4926f3, []int{0}
}
func (m *UpdatePasswordRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -90,7 +90,7 @@ func (m *UpdatePasswordResponse) Reset() { *m = UpdatePasswordResponse{}
func (m *UpdatePasswordResponse) String() string { return proto.CompactTextString(m) }
func (*UpdatePasswordResponse) ProtoMessage() {}
func (*UpdatePasswordResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_account_3e64cf795478a98b, []int{1}
return fileDescriptor_account_c12a236fbb4926f3, []int{1}
}
func (m *UpdatePasswordResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -566,10 +566,10 @@ var (
)
func init() {
proto.RegisterFile("server/account/account.proto", fileDescriptor_account_3e64cf795478a98b)
proto.RegisterFile("server/account/account.proto", fileDescriptor_account_c12a236fbb4926f3)
}
var fileDescriptor_account_3e64cf795478a98b = []byte{
var fileDescriptor_account_c12a236fbb4926f3 = []byte{
// 268 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0x4e, 0x2d, 0x2a,
0x4b, 0x2d, 0xd2, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x81, 0xd1, 0x7a, 0x05, 0x45, 0xf9,

View file

@ -52,7 +52,7 @@ func (m *ApplicationQuery) Reset() { *m = ApplicationQuery{} }
func (m *ApplicationQuery) String() string { return proto.CompactTextString(m) }
func (*ApplicationQuery) ProtoMessage() {}
func (*ApplicationQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{0}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{0}
}
func (m *ApplicationQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -117,7 +117,7 @@ func (m *ApplicationResourceEventsQuery) Reset() { *m = ApplicationResou
func (m *ApplicationResourceEventsQuery) String() string { return proto.CompactTextString(m) }
func (*ApplicationResourceEventsQuery) ProtoMessage() {}
func (*ApplicationResourceEventsQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{1}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{1}
}
func (m *ApplicationResourceEventsQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -187,7 +187,7 @@ func (m *ApplicationManifestQuery) Reset() { *m = ApplicationManifestQue
func (m *ApplicationManifestQuery) String() string { return proto.CompactTextString(m) }
func (*ApplicationManifestQuery) ProtoMessage() {}
func (*ApplicationManifestQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{2}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{2}
}
func (m *ApplicationManifestQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -240,7 +240,7 @@ func (m *ApplicationResponse) Reset() { *m = ApplicationResponse{} }
func (m *ApplicationResponse) String() string { return proto.CompactTextString(m) }
func (*ApplicationResponse) ProtoMessage() {}
func (*ApplicationResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{3}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{3}
}
func (m *ApplicationResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -281,7 +281,7 @@ func (m *ApplicationCreateRequest) Reset() { *m = ApplicationCreateReque
func (m *ApplicationCreateRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationCreateRequest) ProtoMessage() {}
func (*ApplicationCreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{4}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{4}
}
func (m *ApplicationCreateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -335,7 +335,7 @@ func (m *ApplicationUpdateRequest) Reset() { *m = ApplicationUpdateReque
func (m *ApplicationUpdateRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationUpdateRequest) ProtoMessage() {}
func (*ApplicationUpdateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{5}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{5}
}
func (m *ApplicationUpdateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -383,7 +383,7 @@ func (m *ApplicationDeleteRequest) Reset() { *m = ApplicationDeleteReque
func (m *ApplicationDeleteRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationDeleteRequest) ProtoMessage() {}
func (*ApplicationDeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{6}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{6}
}
func (m *ApplicationDeleteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -444,7 +444,7 @@ func (m *ApplicationSyncRequest) Reset() { *m = ApplicationSyncRequest{}
func (m *ApplicationSyncRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationSyncRequest) ProtoMessage() {}
func (*ApplicationSyncRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{7}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{7}
}
func (m *ApplicationSyncRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -535,7 +535,7 @@ func (m *ParameterOverrides) Reset() { *m = ParameterOverrides{} }
func (m *ParameterOverrides) String() string { return proto.CompactTextString(m) }
func (*ParameterOverrides) ProtoMessage() {}
func (*ParameterOverrides) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{8}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{8}
}
func (m *ParameterOverrides) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -584,7 +584,7 @@ func (m *Parameter) Reset() { *m = Parameter{} }
func (m *Parameter) String() string { return proto.CompactTextString(m) }
func (*Parameter) ProtoMessage() {}
func (*Parameter) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{9}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{9}
}
func (m *Parameter) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -647,7 +647,7 @@ func (m *ApplicationUpdateSpecRequest) Reset() { *m = ApplicationUpdateS
func (m *ApplicationUpdateSpecRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationUpdateSpecRequest) ProtoMessage() {}
func (*ApplicationUpdateSpecRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{10}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{10}
}
func (m *ApplicationUpdateSpecRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -704,7 +704,7 @@ func (m *ApplicationRollbackRequest) Reset() { *m = ApplicationRollbackR
func (m *ApplicationRollbackRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationRollbackRequest) ProtoMessage() {}
func (*ApplicationRollbackRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{11}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{11}
}
func (m *ApplicationRollbackRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -777,7 +777,7 @@ func (m *ApplicationResourceRequest) Reset() { *m = ApplicationResourceR
func (m *ApplicationResourceRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationResourceRequest) ProtoMessage() {}
func (*ApplicationResourceRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{12}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{12}
}
func (m *ApplicationResourceRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -866,7 +866,7 @@ func (m *ApplicationResourcePatchRequest) Reset() { *m = ApplicationReso
func (m *ApplicationResourcePatchRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationResourcePatchRequest) ProtoMessage() {}
func (*ApplicationResourcePatchRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{13}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{13}
}
func (m *ApplicationResourcePatchRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -968,7 +968,7 @@ func (m *ApplicationResourceDeleteRequest) Reset() { *m = ApplicationRes
func (m *ApplicationResourceDeleteRequest) String() string { return proto.CompactTextString(m) }
func (*ApplicationResourceDeleteRequest) ProtoMessage() {}
func (*ApplicationResourceDeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{14}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{14}
}
func (m *ApplicationResourceDeleteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1057,7 +1057,7 @@ func (m *ApplicationResourceResponse) Reset() { *m = ApplicationResource
func (m *ApplicationResourceResponse) String() string { return proto.CompactTextString(m) }
func (*ApplicationResourceResponse) ProtoMessage() {}
func (*ApplicationResourceResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{15}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{15}
}
func (m *ApplicationResourceResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1111,7 +1111,7 @@ func (m *ApplicationPodLogsQuery) Reset() { *m = ApplicationPodLogsQuery
func (m *ApplicationPodLogsQuery) String() string { return proto.CompactTextString(m) }
func (*ApplicationPodLogsQuery) ProtoMessage() {}
func (*ApplicationPodLogsQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{16}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{16}
}
func (m *ApplicationPodLogsQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1208,7 +1208,7 @@ func (m *LogEntry) Reset() { *m = LogEntry{} }
func (m *LogEntry) String() string { return proto.CompactTextString(m) }
func (*LogEntry) ProtoMessage() {}
func (*LogEntry) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{17}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{17}
}
func (m *LogEntry) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1262,7 +1262,7 @@ func (m *OperationTerminateRequest) Reset() { *m = OperationTerminateReq
func (m *OperationTerminateRequest) String() string { return proto.CompactTextString(m) }
func (*OperationTerminateRequest) ProtoMessage() {}
func (*OperationTerminateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{18}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{18}
}
func (m *OperationTerminateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1308,7 +1308,7 @@ func (m *OperationTerminateResponse) Reset() { *m = OperationTerminateRe
func (m *OperationTerminateResponse) String() string { return proto.CompactTextString(m) }
func (*OperationTerminateResponse) ProtoMessage() {}
func (*OperationTerminateResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_application_438a7f90c220f2b0, []int{19}
return fileDescriptor_application_1fbe4ee110fd4fa6, []int{19}
}
func (m *OperationTerminateResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -6397,10 +6397,10 @@ var (
)
func init() {
proto.RegisterFile("server/application/application.proto", fileDescriptor_application_438a7f90c220f2b0)
proto.RegisterFile("server/application/application.proto", fileDescriptor_application_1fbe4ee110fd4fa6)
}
var fileDescriptor_application_438a7f90c220f2b0 = []byte{
var fileDescriptor_application_1fbe4ee110fd4fa6 = []byte{
// 1688 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcf, 0x6f, 0x14, 0xc9,
0x15, 0x4e, 0xcd, 0xd8, 0x1e, 0xcf, 0xb3, 0x13, 0x91, 0x0a, 0x38, 0x9d, 0xc6, 0xd8, 0xa3, 0xc2,

View file

@ -26,6 +26,7 @@ import (
"github.com/argoproj/argo-cd/server/rbacpolicy"
"github.com/argoproj/argo-cd/test"
"github.com/argoproj/argo-cd/util"
"github.com/argoproj/argo-cd/util/assets"
"github.com/argoproj/argo-cd/util/db"
"github.com/argoproj/argo-cd/util/grpc"
"github.com/argoproj/argo-cd/util/kube"
@ -134,7 +135,7 @@ func newTestAppServer(objects ...runtime.Object) *Server {
fakeProjLister := factory.Argoproj().V1alpha1().AppProjects().Lister().AppProjects(testNamespace)
enforcer := rbac.NewEnforcer(kubeclientset, testNamespace, common.ArgoCDRBACConfigMapName, nil)
enforcer.SetBuiltinPolicy(test.BuiltinPolicy)
enforcer.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
enforcer.SetDefaultRole("role:admin")
enforcer.SetClaimsEnforcerFunc(rbacpolicy.NewRBACPolicyEnforcer(enforcer, fakeProjLister).EnforceClaims)

View file

@ -45,7 +45,7 @@ func (m *ClusterQuery) Reset() { *m = ClusterQuery{} }
func (m *ClusterQuery) String() string { return proto.CompactTextString(m) }
func (*ClusterQuery) ProtoMessage() {}
func (*ClusterQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_cluster_bf8d7367dfc95a3e, []int{0}
return fileDescriptor_cluster_0875510a34378ea0, []int{0}
}
func (m *ClusterQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -91,7 +91,7 @@ func (m *ClusterResponse) Reset() { *m = ClusterResponse{} }
func (m *ClusterResponse) String() string { return proto.CompactTextString(m) }
func (*ClusterResponse) ProtoMessage() {}
func (*ClusterResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_cluster_bf8d7367dfc95a3e, []int{1}
return fileDescriptor_cluster_0875510a34378ea0, []int{1}
}
func (m *ClusterResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -132,7 +132,7 @@ func (m *ClusterCreateRequest) Reset() { *m = ClusterCreateRequest{} }
func (m *ClusterCreateRequest) String() string { return proto.CompactTextString(m) }
func (*ClusterCreateRequest) ProtoMessage() {}
func (*ClusterCreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cluster_bf8d7367dfc95a3e, []int{2}
return fileDescriptor_cluster_0875510a34378ea0, []int{2}
}
func (m *ClusterCreateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -189,7 +189,7 @@ func (m *ClusterCreateFromKubeConfigRequest) Reset() { *m = ClusterCreat
func (m *ClusterCreateFromKubeConfigRequest) String() string { return proto.CompactTextString(m) }
func (*ClusterCreateFromKubeConfigRequest) ProtoMessage() {}
func (*ClusterCreateFromKubeConfigRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cluster_bf8d7367dfc95a3e, []int{3}
return fileDescriptor_cluster_0875510a34378ea0, []int{3}
}
func (m *ClusterCreateFromKubeConfigRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -257,7 +257,7 @@ func (m *ClusterUpdateRequest) Reset() { *m = ClusterUpdateRequest{} }
func (m *ClusterUpdateRequest) String() string { return proto.CompactTextString(m) }
func (*ClusterUpdateRequest) ProtoMessage() {}
func (*ClusterUpdateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_cluster_bf8d7367dfc95a3e, []int{4}
return fileDescriptor_cluster_0875510a34378ea0, []int{4}
}
func (m *ClusterUpdateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1393,10 +1393,10 @@ var (
)
func init() {
proto.RegisterFile("server/cluster/cluster.proto", fileDescriptor_cluster_bf8d7367dfc95a3e)
proto.RegisterFile("server/cluster/cluster.proto", fileDescriptor_cluster_0875510a34378ea0)
}
var fileDescriptor_cluster_bf8d7367dfc95a3e = []byte{
var fileDescriptor_cluster_0875510a34378ea0 = []byte{
// 564 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x95, 0xcd, 0x6e, 0x13, 0x31,
0x10, 0xc7, 0xe5, 0xb6, 0xda, 0x12, 0x83, 0xf8, 0xb0, 0x0a, 0x5a, 0xd2, 0x10, 0xa5, 0x3e, 0x54,

View file

@ -46,7 +46,7 @@ func (m *ProjectCreateRequest) Reset() { *m = ProjectCreateRequest{} }
func (m *ProjectCreateRequest) String() string { return proto.CompactTextString(m) }
func (*ProjectCreateRequest) ProtoMessage() {}
func (*ProjectCreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{0}
return fileDescriptor_project_082822b5d17b8c4e, []int{0}
}
func (m *ProjectCreateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -96,7 +96,7 @@ func (m *ProjectTokenDeleteRequest) Reset() { *m = ProjectTokenDeleteReq
func (m *ProjectTokenDeleteRequest) String() string { return proto.CompactTextString(m) }
func (*ProjectTokenDeleteRequest) ProtoMessage() {}
func (*ProjectTokenDeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{1}
return fileDescriptor_project_082822b5d17b8c4e, []int{1}
}
func (m *ProjectTokenDeleteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -162,7 +162,7 @@ func (m *ProjectTokenCreateRequest) Reset() { *m = ProjectTokenCreateReq
func (m *ProjectTokenCreateRequest) String() string { return proto.CompactTextString(m) }
func (*ProjectTokenCreateRequest) ProtoMessage() {}
func (*ProjectTokenCreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{2}
return fileDescriptor_project_082822b5d17b8c4e, []int{2}
}
func (m *ProjectTokenCreateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -231,7 +231,7 @@ func (m *ProjectTokenResponse) Reset() { *m = ProjectTokenResponse{} }
func (m *ProjectTokenResponse) String() string { return proto.CompactTextString(m) }
func (*ProjectTokenResponse) ProtoMessage() {}
func (*ProjectTokenResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{3}
return fileDescriptor_project_082822b5d17b8c4e, []int{3}
}
func (m *ProjectTokenResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -279,7 +279,7 @@ func (m *ProjectQuery) Reset() { *m = ProjectQuery{} }
func (m *ProjectQuery) String() string { return proto.CompactTextString(m) }
func (*ProjectQuery) ProtoMessage() {}
func (*ProjectQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{4}
return fileDescriptor_project_082822b5d17b8c4e, []int{4}
}
func (m *ProjectQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -326,7 +326,7 @@ func (m *ProjectUpdateRequest) Reset() { *m = ProjectUpdateRequest{} }
func (m *ProjectUpdateRequest) String() string { return proto.CompactTextString(m) }
func (*ProjectUpdateRequest) ProtoMessage() {}
func (*ProjectUpdateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{5}
return fileDescriptor_project_082822b5d17b8c4e, []int{5}
}
func (m *ProjectUpdateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -372,7 +372,7 @@ func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
func (*EmptyResponse) ProtoMessage() {}
func (*EmptyResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_project_8d94583ca767d5b3, []int{6}
return fileDescriptor_project_082822b5d17b8c4e, []int{6}
}
func (m *EmptyResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1846,10 +1846,10 @@ var (
)
func init() {
proto.RegisterFile("server/project/project.proto", fileDescriptor_project_8d94583ca767d5b3)
proto.RegisterFile("server/project/project.proto", fileDescriptor_project_082822b5d17b8c4e)
}
var fileDescriptor_project_8d94583ca767d5b3 = []byte{
var fileDescriptor_project_082822b5d17b8c4e = []byte{
// 697 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x5d, 0x6b, 0x13, 0x4d,
0x14, 0x66, 0x9a, 0xbe, 0x79, 0xdf, 0x4e, 0x5e, 0xb5, 0x0c, 0xad, 0xa6, 0xb1, 0x8d, 0x61, 0x2e,

View file

@ -17,8 +17,8 @@ import (
"github.com/argoproj/argo-cd/common"
"github.com/argoproj/argo-cd/pkg/apis/application/v1alpha1"
apps "github.com/argoproj/argo-cd/pkg/client/clientset/versioned/fake"
"github.com/argoproj/argo-cd/test"
"github.com/argoproj/argo-cd/util"
"github.com/argoproj/argo-cd/util/assets"
jwtutil "github.com/argoproj/argo-cd/util/jwt"
"github.com/argoproj/argo-cd/util/rbac"
"github.com/argoproj/argo-cd/util/session"
@ -42,7 +42,7 @@ func TestProjectServer(t *testing.T) {
})
settingsMgr := settings.NewSettingsManager(context.Background(), kubeclientset, testNamespace)
enforcer := rbac.NewEnforcer(kubeclientset, testNamespace, common.ArgoCDRBACConfigMapName, nil)
enforcer.SetBuiltinPolicy(test.BuiltinPolicy)
enforcer.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
enforcer.SetDefaultRole("role:admin")
enforcer.SetClaimsEnforcerFunc(func(claims jwt.Claims, rvals ...interface{}) bool {
return true

View file

@ -1,7 +1,6 @@
package rbacpolicy
import (
"io/ioutil"
"testing"
jwt "github.com/dgrijalva/jwt-go"
@ -15,16 +14,6 @@ import (
"github.com/argoproj/argo-cd/util/rbac"
)
var builtinPolicy string
func init() {
policyBytes, err := ioutil.ReadFile("../../util/rbac/builtin-policy.csv")
if err != nil {
panic(err)
}
builtinPolicy = string(policyBytes)
}
func newFakeProj() *argoappv1.AppProject {
return &argoappv1.AppProject{
ObjectMeta: metav1.ObjectMeta{

View file

@ -46,7 +46,7 @@ func (m *RepoAppsQuery) Reset() { *m = RepoAppsQuery{} }
func (m *RepoAppsQuery) String() string { return proto.CompactTextString(m) }
func (*RepoAppsQuery) ProtoMessage() {}
func (*RepoAppsQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{0}
return fileDescriptor_repository_324bad698d34f88e, []int{0}
}
func (m *RepoAppsQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -102,7 +102,7 @@ func (m *AppInfo) Reset() { *m = AppInfo{} }
func (m *AppInfo) String() string { return proto.CompactTextString(m) }
func (*AppInfo) ProtoMessage() {}
func (*AppInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{1}
return fileDescriptor_repository_324bad698d34f88e, []int{1}
}
func (m *AppInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -159,7 +159,7 @@ func (m *RepoAppDetailsQuery) Reset() { *m = RepoAppDetailsQuery{} }
func (m *RepoAppDetailsQuery) String() string { return proto.CompactTextString(m) }
func (*RepoAppDetailsQuery) ProtoMessage() {}
func (*RepoAppDetailsQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{2}
return fileDescriptor_repository_324bad698d34f88e, []int{2}
}
func (m *RepoAppDetailsQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -224,7 +224,7 @@ func (m *RepoAppDetailsResponse) Reset() { *m = RepoAppDetailsResponse{}
func (m *RepoAppDetailsResponse) String() string { return proto.CompactTextString(m) }
func (*RepoAppDetailsResponse) ProtoMessage() {}
func (*RepoAppDetailsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{3}
return fileDescriptor_repository_324bad698d34f88e, []int{3}
}
func (m *RepoAppDetailsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -293,7 +293,7 @@ func (m *RepoAppsResponse) Reset() { *m = RepoAppsResponse{} }
func (m *RepoAppsResponse) String() string { return proto.CompactTextString(m) }
func (*RepoAppsResponse) ProtoMessage() {}
func (*RepoAppsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{4}
return fileDescriptor_repository_324bad698d34f88e, []int{4}
}
func (m *RepoAppsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -344,7 +344,7 @@ func (m *KsonnetAppSpec) Reset() { *m = KsonnetAppSpec{} }
func (m *KsonnetAppSpec) String() string { return proto.CompactTextString(m) }
func (*KsonnetAppSpec) ProtoMessage() {}
func (*KsonnetAppSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{5}
return fileDescriptor_repository_324bad698d34f88e, []int{5}
}
func (m *KsonnetAppSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -408,7 +408,7 @@ func (m *HelmAppSpec) Reset() { *m = HelmAppSpec{} }
func (m *HelmAppSpec) String() string { return proto.CompactTextString(m) }
func (*HelmAppSpec) ProtoMessage() {}
func (*HelmAppSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{6}
return fileDescriptor_repository_324bad698d34f88e, []int{6}
}
func (m *HelmAppSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -470,7 +470,7 @@ func (m *KustomizeAppSpec) Reset() { *m = KustomizeAppSpec{} }
func (m *KustomizeAppSpec) String() string { return proto.CompactTextString(m) }
func (*KustomizeAppSpec) ProtoMessage() {}
func (*KustomizeAppSpec) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{7}
return fileDescriptor_repository_324bad698d34f88e, []int{7}
}
func (m *KustomizeAppSpec) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -524,7 +524,7 @@ func (m *KsonnetEnvironment) Reset() { *m = KsonnetEnvironment{} }
func (m *KsonnetEnvironment) String() string { return proto.CompactTextString(m) }
func (*KsonnetEnvironment) ProtoMessage() {}
func (*KsonnetEnvironment) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{8}
return fileDescriptor_repository_324bad698d34f88e, []int{8}
}
func (m *KsonnetEnvironment) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -595,7 +595,7 @@ func (m *KsonnetEnvironmentDestination) Reset() { *m = KsonnetEnvironmen
func (m *KsonnetEnvironmentDestination) String() string { return proto.CompactTextString(m) }
func (*KsonnetEnvironmentDestination) ProtoMessage() {}
func (*KsonnetEnvironmentDestination) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{9}
return fileDescriptor_repository_324bad698d34f88e, []int{9}
}
func (m *KsonnetEnvironmentDestination) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -650,7 +650,7 @@ func (m *RepoQuery) Reset() { *m = RepoQuery{} }
func (m *RepoQuery) String() string { return proto.CompactTextString(m) }
func (*RepoQuery) ProtoMessage() {}
func (*RepoQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{10}
return fileDescriptor_repository_324bad698d34f88e, []int{10}
}
func (m *RepoQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -696,7 +696,7 @@ func (m *RepoResponse) Reset() { *m = RepoResponse{} }
func (m *RepoResponse) String() string { return proto.CompactTextString(m) }
func (*RepoResponse) ProtoMessage() {}
func (*RepoResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{11}
return fileDescriptor_repository_324bad698d34f88e, []int{11}
}
func (m *RepoResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -737,7 +737,7 @@ func (m *RepoCreateRequest) Reset() { *m = RepoCreateRequest{} }
func (m *RepoCreateRequest) String() string { return proto.CompactTextString(m) }
func (*RepoCreateRequest) ProtoMessage() {}
func (*RepoCreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{12}
return fileDescriptor_repository_324bad698d34f88e, []int{12}
}
func (m *RepoCreateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -791,7 +791,7 @@ func (m *RepoUpdateRequest) Reset() { *m = RepoUpdateRequest{} }
func (m *RepoUpdateRequest) String() string { return proto.CompactTextString(m) }
func (*RepoUpdateRequest) ProtoMessage() {}
func (*RepoUpdateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_repository_3c54adc3c349824a, []int{13}
return fileDescriptor_repository_324bad698d34f88e, []int{13}
}
func (m *RepoUpdateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -3675,10 +3675,10 @@ var (
)
func init() {
proto.RegisterFile("server/repository/repository.proto", fileDescriptor_repository_3c54adc3c349824a)
proto.RegisterFile("server/repository/repository.proto", fileDescriptor_repository_324bad698d34f88e)
}
var fileDescriptor_repository_3c54adc3c349824a = []byte{
var fileDescriptor_repository_324bad698d34f88e = []byte{
// 893 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x5f, 0x6f, 0x1b, 0x45,
0x10, 0xd7, 0x25, 0xa9, 0x1b, 0x8f, 0xdb, 0x2a, 0xdd, 0x96, 0x60, 0x0e, 0xc7, 0x8d, 0x16, 0x09,

View file

@ -15,7 +15,6 @@ import (
"strings"
"time"
"github.com/gobuffalo/packr"
golang_proto "github.com/golang/protobuf/proto"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
@ -57,6 +56,7 @@ import (
"github.com/argoproj/argo-cd/server/settings"
"github.com/argoproj/argo-cd/server/version"
"github.com/argoproj/argo-cd/util"
"github.com/argoproj/argo-cd/util/assets"
argocache "github.com/argoproj/argo-cd/util/cache"
"github.com/argoproj/argo-cd/util/db"
"github.com/argoproj/argo-cd/util/dex"
@ -102,18 +102,10 @@ var backoff = wait.Backoff{
}
var (
box = packr.NewBox("../util/rbac")
builtinPolicy string
clientConstraint = fmt.Sprintf(">= %s", minClientVersion)
baseHRefRegex = regexp.MustCompile(`<base href="(.*)">`)
)
func init() {
var err error
builtinPolicy, err = box.MustString("builtin-policy.csv")
errors.CheckError(err)
}
// ArgoCDServer is the API server for Argo CD
type ArgoCDServer struct {
ArgoCDServerOpts
@ -181,7 +173,7 @@ func NewServer(ctx context.Context, opts ArgoCDServerOpts) *ArgoCDServer {
enf := rbac.NewEnforcer(opts.KubeClientset, opts.Namespace, common.ArgoCDRBACConfigMapName, nil)
enf.EnableEnforce(!opts.DisableAuth)
err = enf.SetBuiltinPolicy(builtinPolicy)
err = enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
errors.CheckError(err)
enf.EnableLog(os.Getenv(common.EnvVarRBACDebug) == "1")
@ -506,7 +498,7 @@ func (a *ArgoCDServer) newHTTPServer(ctx context.Context, port int) *http.Server
mustRegisterGWHandler(project.RegisterProjectServiceHandlerFromEndpoint, ctx, gwmux, endpoint, dOpts)
// Swagger UI
swagger.ServeSwaggerUI(mux, packr.NewBox("."), "/swagger-ui")
swagger.ServeSwaggerUI(mux, assets.SwaggerJSON, "/swagger-ui")
healthz.ServeHealthCheck(mux, func() error {
_, err := a.KubeClientset.(*kubernetes.Clientset).ServerVersion()
return err

View file

@ -21,13 +21,10 @@ import (
"github.com/argoproj/argo-cd/server/application"
"github.com/argoproj/argo-cd/server/rbacpolicy"
"github.com/argoproj/argo-cd/test"
"github.com/argoproj/argo-cd/util/assets"
"github.com/argoproj/argo-cd/util/rbac"
)
const (
builtinPolicyFile = "builtin-policy.csv"
)
func fakeServer() *ArgoCDServer {
cm := test.NewFakeConfigMap()
secret := test.NewFakeSecret()
@ -129,7 +126,7 @@ func TestEnforceProjectToken(t *testing.T) {
func TestEnforceClaims(t *testing.T) {
kubeclientset := fake.NewSimpleClientset(test.NewFakeConfigMap())
enf := rbac.NewEnforcer(kubeclientset, test.FakeArgoCDNamespace, common.ArgoCDConfigMapName, nil)
enf.SetBuiltinPolicy(box.String(builtinPolicyFile))
enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
rbacEnf := rbacpolicy.NewRBACPolicyEnforcer(enf, test.NewFakeProjLister())
enf.SetClaimsEnforcerFunc(rbacEnf.EnforceClaims)
policy := `
@ -161,7 +158,7 @@ g, bob, role:admin
func TestDefaultRoleWithClaims(t *testing.T) {
kubeclientset := fake.NewSimpleClientset()
enf := rbac.NewEnforcer(kubeclientset, test.FakeArgoCDNamespace, common.ArgoCDConfigMapName, nil)
enf.SetBuiltinPolicy(box.String(builtinPolicyFile))
enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
rbacEnf := rbacpolicy.NewRBACPolicyEnforcer(enf, test.NewFakeProjLister())
enf.SetClaimsEnforcerFunc(rbacEnf.EnforceClaims)
claims := jwt.MapClaims{"groups": []string{"org1:team1", "org2:team2"}}
@ -175,7 +172,7 @@ func TestDefaultRoleWithClaims(t *testing.T) {
func TestEnforceNilClaims(t *testing.T) {
kubeclientset := fake.NewSimpleClientset(test.NewFakeConfigMap())
enf := rbac.NewEnforcer(kubeclientset, test.FakeArgoCDNamespace, common.ArgoCDConfigMapName, nil)
enf.SetBuiltinPolicy(box.String(builtinPolicyFile))
enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
rbacEnf := rbacpolicy.NewRBACPolicyEnforcer(enf, test.NewFakeProjLister())
enf.SetClaimsEnforcerFunc(rbacEnf.EnforceClaims)
assert.False(t, enf.Enforce(nil, "applications", "get", "foo/obj"))

View file

@ -47,7 +47,7 @@ func (m *SessionCreateRequest) Reset() { *m = SessionCreateRequest{} }
func (m *SessionCreateRequest) String() string { return proto.CompactTextString(m) }
func (*SessionCreateRequest) ProtoMessage() {}
func (*SessionCreateRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_session_217b926c109d1cc2, []int{0}
return fileDescriptor_session_8e535ce77fc5e082, []int{0}
}
func (m *SessionCreateRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -108,7 +108,7 @@ func (m *SessionDeleteRequest) Reset() { *m = SessionDeleteRequest{} }
func (m *SessionDeleteRequest) String() string { return proto.CompactTextString(m) }
func (*SessionDeleteRequest) ProtoMessage() {}
func (*SessionDeleteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_session_217b926c109d1cc2, []int{1}
return fileDescriptor_session_8e535ce77fc5e082, []int{1}
}
func (m *SessionDeleteRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -149,7 +149,7 @@ func (m *SessionResponse) Reset() { *m = SessionResponse{} }
func (m *SessionResponse) String() string { return proto.CompactTextString(m) }
func (*SessionResponse) ProtoMessage() {}
func (*SessionResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_session_217b926c109d1cc2, []int{2}
return fileDescriptor_session_8e535ce77fc5e082, []int{2}
}
func (m *SessionResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -827,10 +827,10 @@ var (
)
func init() {
proto.RegisterFile("server/session/session.proto", fileDescriptor_session_217b926c109d1cc2)
proto.RegisterFile("server/session/session.proto", fileDescriptor_session_8e535ce77fc5e082)
}
var fileDescriptor_session_217b926c109d1cc2 = []byte{
var fileDescriptor_session_8e535ce77fc5e082 = []byte{
// 356 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xb1, 0x4e, 0xeb, 0x30,
0x14, 0x86, 0xe5, 0x5e, 0xdd, 0xde, 0x7b, 0x3d, 0xdc, 0x8a, 0x28, 0x82, 0x28, 0x2a, 0x15, 0xca,

View file

@ -42,7 +42,7 @@ func (m *SettingsQuery) Reset() { *m = SettingsQuery{} }
func (m *SettingsQuery) String() string { return proto.CompactTextString(m) }
func (*SettingsQuery) ProtoMessage() {}
func (*SettingsQuery) Descriptor() ([]byte, []int) {
return fileDescriptor_settings_90d4947f5a5e2583, []int{0}
return fileDescriptor_settings_902e174a76eb35c2, []int{0}
}
func (m *SettingsQuery) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -84,7 +84,7 @@ func (m *Settings) Reset() { *m = Settings{} }
func (m *Settings) String() string { return proto.CompactTextString(m) }
func (*Settings) ProtoMessage() {}
func (*Settings) Descriptor() ([]byte, []int) {
return fileDescriptor_settings_90d4947f5a5e2583, []int{1}
return fileDescriptor_settings_902e174a76eb35c2, []int{1}
}
func (m *Settings) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -145,7 +145,7 @@ func (m *DexConfig) Reset() { *m = DexConfig{} }
func (m *DexConfig) String() string { return proto.CompactTextString(m) }
func (*DexConfig) ProtoMessage() {}
func (*DexConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_settings_90d4947f5a5e2583, []int{2}
return fileDescriptor_settings_902e174a76eb35c2, []int{2}
}
func (m *DexConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -193,7 +193,7 @@ func (m *Connector) Reset() { *m = Connector{} }
func (m *Connector) String() string { return proto.CompactTextString(m) }
func (*Connector) ProtoMessage() {}
func (*Connector) Descriptor() ([]byte, []int) {
return fileDescriptor_settings_90d4947f5a5e2583, []int{3}
return fileDescriptor_settings_902e174a76eb35c2, []int{3}
}
func (m *Connector) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -249,7 +249,7 @@ func (m *OIDCConfig) Reset() { *m = OIDCConfig{} }
func (m *OIDCConfig) String() string { return proto.CompactTextString(m) }
func (*OIDCConfig) ProtoMessage() {}
func (*OIDCConfig) Descriptor() ([]byte, []int) {
return fileDescriptor_settings_90d4947f5a5e2583, []int{4}
return fileDescriptor_settings_902e174a76eb35c2, []int{4}
}
func (m *OIDCConfig) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1291,10 +1291,10 @@ var (
)
func init() {
proto.RegisterFile("server/settings/settings.proto", fileDescriptor_settings_90d4947f5a5e2583)
proto.RegisterFile("server/settings/settings.proto", fileDescriptor_settings_902e174a76eb35c2)
}
var fileDescriptor_settings_90d4947f5a5e2583 = []byte{
var fileDescriptor_settings_902e174a76eb35c2 = []byte{
// 397 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x52, 0xcd, 0x8a, 0xdb, 0x30,
0x18, 0x44, 0x71, 0x49, 0xe2, 0xaf, 0x3f, 0x69, 0xd5, 0x12, 0xdc, 0x50, 0x9c, 0xe0, 0x53, 0xa0,

View file

@ -51,7 +51,7 @@ func (m *VersionMessage) Reset() { *m = VersionMessage{} }
func (m *VersionMessage) String() string { return proto.CompactTextString(m) }
func (*VersionMessage) ProtoMessage() {}
func (*VersionMessage) Descriptor() ([]byte, []int) {
return fileDescriptor_version_301443c925f6e1d7, []int{0}
return fileDescriptor_version_9a67e1897074bbcc, []int{0}
}
func (m *VersionMessage) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -781,10 +781,10 @@ var (
)
func init() {
proto.RegisterFile("server/version/version.proto", fileDescriptor_version_301443c925f6e1d7)
proto.RegisterFile("server/version/version.proto", fileDescriptor_version_9a67e1897074bbcc)
}
var fileDescriptor_version_301443c925f6e1d7 = []byte{
var fileDescriptor_version_9a67e1897074bbcc = []byte{
// 343 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x92, 0xcf, 0x4a, 0xc3, 0x40,
0x10, 0xc6, 0x49, 0xd5, 0xfe, 0x59, 0x4a, 0x0f, 0x8b, 0xd4, 0x25, 0x96, 0x22, 0x3d, 0x88, 0x08,

View file

@ -15,7 +15,7 @@ import (
"testing"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
@ -38,6 +38,7 @@ import (
"github.com/argoproj/argo-cd/server/cluster"
"github.com/argoproj/argo-cd/test"
"github.com/argoproj/argo-cd/util"
"github.com/argoproj/argo-cd/util/assets"
"github.com/argoproj/argo-cd/util/cache"
"github.com/argoproj/argo-cd/util/db"
"github.com/argoproj/argo-cd/util/git"
@ -285,7 +286,7 @@ func NewFixture() (*Fixture, error) {
settingsMgr := settings.NewSettingsManager(context.Background(), kubeClient, namespace)
db := db.NewDB(namespace, settingsMgr, kubeClient)
enforcer := rbac.NewEnforcer(kubeClient, namespace, common.ArgoCDRBACConfigMapName, nil)
err = enforcer.SetBuiltinPolicy(test.BuiltinPolicy)
err = enforcer.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
if err != nil {
return nil, err
}

View file

@ -3,7 +3,6 @@ package test
import (
"encoding/json"
"github.com/gobuffalo/packr"
appsv1 "k8s.io/api/apps/v1"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@ -11,7 +10,6 @@ import (
"k8s.io/apimachinery/pkg/runtime"
"github.com/argoproj/argo-cd/common"
"github.com/argoproj/argo-cd/errors"
apps "github.com/argoproj/argo-cd/pkg/client/clientset/versioned/fake"
appinformer "github.com/argoproj/argo-cd/pkg/client/informers/externalversions"
applister "github.com/argoproj/argo-cd/pkg/client/listers/application/v1alpha1"
@ -23,17 +21,6 @@ const (
FakeClusterURL = "https://fake-cluster:443"
)
var (
box = packr.NewBox("../util/rbac")
BuiltinPolicy string
)
func init() {
var err error
BuiltinPolicy, err = box.MustString("builtin-policy.csv")
errors.CheckError(err)
}
var PodManifest = []byte(`
{
"apiVersion": "v1",

28
util/assets/assets.go Normal file
View file

@ -0,0 +1,28 @@
package assets
import (
"github.com/gobuffalo/packr"
)
var (
BuiltinPolicyCSV string
ModelConf string
SwaggerJSON string
)
func init() {
var err error
box := packr.NewBox("../../assets")
BuiltinPolicyCSV, err = box.MustString("builtin-policy.csv")
if err != nil {
panic(err)
}
ModelConf, err = box.MustString("model.conf")
if err != nil {
panic(err)
}
SwaggerJSON, err = box.MustString("swagger.json")
if err != nil {
panic(err)
}
}

View file

@ -7,11 +7,12 @@ import (
"strings"
"time"
"github.com/argoproj/argo-cd/util/assets"
"github.com/casbin/casbin"
"github.com/casbin/casbin/model"
"github.com/casbin/casbin/persist"
jwt "github.com/dgrijalva/jwt-go"
"github.com/gobuffalo/packr"
log "github.com/sirupsen/logrus"
apiv1 "k8s.io/api/core/v1"
apierr "k8s.io/apimachinery/pkg/api/errors"
@ -26,7 +27,6 @@ const (
ConfigMapPolicyCSVKey = "policy.csv"
ConfigMapPolicyDefaultKey = "policy.default"
builtinModelFile = "model.conf"
defaultRBACSyncPeriod = 10 * time.Minute
)
@ -50,15 +50,6 @@ type Enforcer struct {
// ClaimsEnforcerFunc is func template to enforce a JWT claims. The subject is replaced
type ClaimsEnforcerFunc func(claims jwt.Claims, rvals ...interface{}) bool
var (
modelConf string
)
func init() {
box := packr.NewBox(".")
modelConf = box.String(builtinModelFile)
}
func NewEnforcer(clientset kubernetes.Interface, namespace, configmap string, claimsEnforcer ClaimsEnforcerFunc) *Enforcer {
adapter := newAdapter("", "", "")
builtInModel := newBuiltInModel()
@ -232,7 +223,7 @@ func ValidatePolicy(policy string) error {
// This is needed because it is not safe to re-use the same casbin Model when instantiating new
// casbin enforcers.
func newBuiltInModel() model.Model {
return casbin.NewModel(modelConf)
return casbin.NewModel(assets.ModelConf)
}
// Casbin adapter which satisfies persist.Adapter interface

View file

@ -6,26 +6,20 @@ import (
"time"
jwt "github.com/dgrijalva/jwt-go"
"github.com/gobuffalo/packr"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes/fake"
"github.com/argoproj/argo-cd/util/assets"
)
const (
fakeConfgMapName = "fake-cm"
fakeNamespace = "fake-ns"
builtinPolicyFile = "builtin-policy.csv"
fakeConfgMapName = "fake-cm"
fakeNamespace = "fake-ns"
)
var box packr.Box
func init() {
box = packr.NewBox(".")
}
func fakeConfigMap(policy ...string) *apiv1.ConfigMap {
cm := apiv1.ConfigMap{
TypeMeta: metav1.TypeMeta{
@ -55,7 +49,7 @@ func TestBuiltinPolicyEnforcer(t *testing.T) {
assert.False(t, enf.Enforce("admin", "applications", "get", "foo/bar"))
// now set builtin policy
enf.SetBuiltinPolicy(box.String(builtinPolicyFile))
enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
allowed := [][]interface{}{
{"admin", "applications", "get", "foo/bar"},
@ -215,7 +209,7 @@ func TestDefaultRole(t *testing.T) {
enf := NewEnforcer(kubeclientset, fakeNamespace, fakeConfgMapName, nil)
err := enf.syncUpdate(fakeConfigMap())
assert.Nil(t, err)
enf.SetBuiltinPolicy(box.String(builtinPolicyFile))
enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
assert.False(t, enf.Enforce("bob", "applications", "get", "foo/bar"))
// after setting the default role to be the read-only role, this should now pass
@ -329,7 +323,7 @@ func TestDefaultRoleWithRuntimePolicy(t *testing.T) {
enf := NewEnforcer(kubeclientset, fakeNamespace, fakeConfgMapName, nil)
err := enf.syncUpdate(fakeConfigMap())
assert.Nil(t, err)
runtimePolicy := box.String(builtinPolicyFile)
runtimePolicy := assets.BuiltinPolicyCSV
assert.False(t, enf.EnforceRuntimePolicy(runtimePolicy, "bob", "applications", "get", "foo/bar"))
enf.SetDefaultRole("role:readonly")
assert.True(t, enf.EnforceRuntimePolicy(runtimePolicy, "bob", "applications", "get", "foo/bar"))
@ -342,7 +336,7 @@ func TestClaimsEnforcerFuncWithRuntimePolicy(t *testing.T) {
enf := NewEnforcer(kubeclientset, fakeNamespace, fakeConfgMapName, nil)
err := enf.syncUpdate(fakeConfigMap())
assert.Nil(t, err)
runtimePolicy := box.String(builtinPolicyFile)
runtimePolicy := assets.BuiltinPolicyCSV
claims := jwt.StandardClaims{
Subject: "foo",
}
@ -360,7 +354,7 @@ func TestInvalidRuntimePolicy(t *testing.T) {
enf := NewEnforcer(kubeclientset, fakeNamespace, fakeConfgMapName, nil)
err := enf.syncUpdate(fakeConfigMap())
assert.Nil(t, err)
enf.SetBuiltinPolicy(box.String(builtinPolicyFile))
enf.SetBuiltinPolicy(assets.BuiltinPolicyCSV)
assert.True(t, enf.EnforceRuntimePolicy("", "admin", "applications", "update", "foo/bar"))
assert.False(t, enf.EnforceRuntimePolicy("", "role:readonly", "applications", "update", "foo/bar"))
badPolicy := "this, is, not, a, good, policy"

View file

@ -2,24 +2,17 @@ package swagger
import (
"fmt"
"log"
"net/http"
"path"
"github.com/go-openapi/runtime/middleware"
"github.com/gobuffalo/packr"
)
// ServeSwaggerUI serves the Swagger UI and JSON spec.
func ServeSwaggerUI(mux *http.ServeMux, box packr.Box, uiPath string) {
func ServeSwaggerUI(mux *http.ServeMux, swaggerJSON string, uiPath string) {
prefix := path.Dir(uiPath)
specURL := path.Join(prefix, "swagger.json")
swaggerJSON, err := box.MustString("swagger.json")
if err != nil {
log.Fatal(err)
}
mux.HandleFunc(specURL, func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, swaggerJSON)
})

View file

@ -7,7 +7,8 @@ import (
"testing"
"github.com/go-openapi/loads"
"github.com/gobuffalo/packr"
"github.com/argoproj/argo-cd/util/assets"
)
func TestSwaggerUI(t *testing.T) {
@ -32,7 +33,7 @@ func TestSwaggerUI(t *testing.T) {
c <- listener.Addr().String()
mux := http.NewServeMux()
ServeSwaggerUI(mux, packr.NewBox("../../server"), "/swagger-ui")
ServeSwaggerUI(mux, assets.SwaggerJSON, "/swagger-ui")
panic(http.Serve(listener, mux))
}

View file

@ -9,18 +9,9 @@ import (
appclientset "github.com/argoproj/argo-cd/pkg/client/clientset/versioned/fake"
"github.com/argoproj/argo-cd/util/settings"
"github.com/gobuffalo/packr"
"github.com/stretchr/testify/assert"
)
var (
box packr.Box
)
func init() {
box = packr.NewBox(".")
}
func NewMockHandler() *ArgoCDWebhookHandler {
appClientset := appclientset.NewSimpleClientset()
return NewHandler("", appClientset, &settings.ArgoCDSettings{})
@ -29,7 +20,9 @@ func TestGitHubCommitEvent(t *testing.T) {
h := NewMockHandler()
req := httptest.NewRequest("POST", "/api/webhook", nil)
req.Header.Set("X-GitHub-Event", "push")
req.Body = ioutil.NopCloser(bytes.NewReader(box.Bytes("github-commit-event.json")))
eventJSON, err := ioutil.ReadFile("github-commit-event.json")
assert.NoError(t, err)
req.Body = ioutil.NopCloser(bytes.NewReader(eventJSON))
w := httptest.NewRecorder()
h.Handler(w, req)
assert.Equal(t, w.Code, http.StatusOK)
@ -39,7 +32,9 @@ func TestGitHubTagEvent(t *testing.T) {
h := NewMockHandler()
req := httptest.NewRequest("POST", "/api/webhook", nil)
req.Header.Set("X-GitHub-Event", "push")
req.Body = ioutil.NopCloser(bytes.NewReader(box.Bytes("github-tag-event.json")))
eventJSON, err := ioutil.ReadFile("github-tag-event.json")
assert.NoError(t, err)
req.Body = ioutil.NopCloser(bytes.NewReader(eventJSON))
w := httptest.NewRecorder()
h.Handler(w, req)
assert.Equal(t, w.Code, http.StatusOK)