diff --git a/CHANGELOG/release-notes-v1.2.0.md b/CHANGELOG/release-notes-v1.2.0.md new file mode 100644 index 0000000000..b70f56ff96 --- /dev/null +++ b/CHANGELOG/release-notes-v1.2.0.md @@ -0,0 +1,35 @@ +## v1.2.0 + + + +## Bugs +- fix: Application listing panic handling (#6199) +- fix: Copy image plugin panic handling (#6220) +- fix: Remove gaps between image scanning V1 & V2 (#6213) +- fix: Select Query errors in Postgres Pod Logs (#6238) +- fix: Graceful shutdown handling and logs flush (#6239) +- fix: Remove unused variable causing double register in prometheus (#6279) +## Enhancements +- feat: Ignore workflow cache config (#6218) +- feat: Build infra support (#6151) +- feat: Helm type pipeline app status (#6262) +- feat: Added labels to manual sync job (#6269) +## Others +- chore: Changes in CD trigger plugin condition v1.3.0 (#6233) +- misc: GetDockerRegistryIdForCiPipeline (#6231) +- chore: Merging user service with connection manager (#6225) +- chore: Argocd repository secret creation service refactoring (#6229) +- chore: Added sql migraiton for searchable key (#6252) +- misc: Adds the required env variables to set up devtron (#6254) +- misc: Added schme json for cronjobs (#6260) +- misc: Error handling when template is empty in ExtractVariables (#6261) +- misc: Nil check in envOverride.chart (#6263) +- misc: PG enable metrics (#6243) +- chore: Patch infra merge (#6274) +- chore: Argo common client (#6266) +- chore: Optimised Dockerfile by removing extra layers (#6293) +- chore: Updated ApplistingRestHandler oss/ent function (#6307) +- chore: Added env generator changes (#6302) +- chore: Deployment config methods add (#6297) +- misc: Deployment, reference and statefulset updated versions (#6284) +- chore: Scoped var oss/ent changes (#6319) diff --git a/CHANGELOG/release-notes-v1.2.1.md b/CHANGELOG/release-notes-v1.2.1.md new file mode 100644 index 0000000000..d6273a0ca9 --- /dev/null +++ b/CHANGELOG/release-notes-v1.2.1.md @@ -0,0 +1,6 @@ +## v1.2.1 + +## Bugs +- fix: Auto cd trigger even if pre-cd fails (#6338) + + diff --git a/charts/devtron/Chart.yaml b/charts/devtron/Chart.yaml index f26b344d5c..fd3d7ad51c 100644 --- a/charts/devtron/Chart.yaml +++ b/charts/devtron/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: devtron-operator -appVersion: 1.1.0 +appVersion: 1.2.1 description: Chart to configure and install Devtron. Devtron is a Kubernetes Orchestration system. keywords: - Devtron @@ -11,7 +11,7 @@ keywords: - argocd - Hyperion engine: gotpl -version: 0.22.79 +version: 0.22.81 sources: - https://github.com/devtron-labs/charts dependencies: diff --git a/charts/devtron/devtron-bom.yaml b/charts/devtron/devtron-bom.yaml index d9d71aaf67..1e29c921b5 100644 --- a/charts/devtron/devtron-bom.yaml +++ b/charts/devtron/devtron-bom.yaml @@ -10,7 +10,7 @@ global: containerRegistry: "quay.io/devtron" extraManifests: [] installer: - release: "v1.1.0" + release: "v1.2.1" registry: "" image: "inception" tag: "473deaa4-185-21582" @@ -34,17 +34,17 @@ components: FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE: "true" ENABLE_RESOURCE_SCAN: "true" registry: "" - image: "dashboard:a88790b2-690-27891" + image: "dashboard:4eb1a17a-690-28956" imagePullPolicy: IfNotPresent devtron: registry: "" - image: "hyperion:a109b8be-280-27896" - cicdImage: "devtron:a109b8be-434-27906" + image: "hyperion:69603019-280-29389" + cicdImage: "devtron:69603019-434-29388" imagePullPolicy: IfNotPresent customOverrides: {} ciRunner: registry: "" - image: "ci-runner:54595cec-138-27894" + image: "ci-runner:343b24f5-138-29387" argocdDexServer: registry: "" image: "dex:v2.30.2" @@ -53,7 +53,7 @@ components: authenticator: "authenticator:e414faff-393-13273" kubelink: registry: "" - image: "kubelink:6c0c7082-564-27862" + image: "kubelink:0a3d5e84-564-28948" imagePullPolicy: IfNotPresent configs: ENABLE_HELM_RELEASE_CACHE: "true" @@ -71,7 +71,7 @@ components: keyName: postgresql-password kubewatch: registry: "" - image: "kubewatch:33965457-419-27887" + image: "kubewatch:0a3d5e84-419-28949" imagePullPolicy: IfNotPresent configs: devtroncd_NAMESPACE: "devtron-ci" @@ -91,7 +91,7 @@ components: armImage: postgres_exporter:v0.10.1 gitsensor: registry: "" - image: "git-sensor:6c0c7082-200-27863" + image: "git-sensor:0a3d5e84-200-28960" imagePullPolicy: IfNotPresent serviceMonitor: enabled: false @@ -109,7 +109,7 @@ components: # Values for lens lens: registry: "" - image: "lens:6c0c7082-333-27872" + image: "lens:0a3d5e84-333-28951" imagePullPolicy: IfNotPresent configs: GIT_SENSOR_PROTOCOL: GRPC @@ -154,7 +154,7 @@ components: DB_NAME: "lens" chartSync: registry: "" - image: chart-sync:6c0c7082-836-27893 + image: chart-sync:0a3d5e84-836-28979 schedule: "0 19 * * *" extraConfigs: {} # values for argocd integration @@ -176,14 +176,17 @@ workflowController: IMDSv1ExecutorImage: "argoexec:v3.0.7" security: imageScanner: - image: "image-scanner:33965457-141-27892" + image: "image-scanner:0a3d5e84-141-28953" + configs: + TRIVY_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-db + TRIVY_JAVA_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-java-db clair: image: repository: clair tag: 4.3.6 # Values for notifier integration notifier: - image: "notifier:2f9166d1-372-27880" + image: "notifier:9aa5e510-372-28961" minio: image: "minio:RELEASE.2021-02-14T04-01-33Z" mbImage: "minio-mc:RELEASE.2021-02-14T04-28-06Z" diff --git a/charts/devtron/values.yaml b/charts/devtron/values.yaml index 45176b6640..5e6581d0d1 100644 --- a/charts/devtron/values.yaml +++ b/charts/devtron/values.yaml @@ -24,7 +24,7 @@ global: extraManifests: [] installer: repo: "devtron-labs/devtron" - release: "v1.1.0" + release: "v1.2.1" registry: "" image: inception tag: 473deaa4-185-21582 @@ -77,12 +77,12 @@ components: FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE: "true" ENABLE_RESOURCE_SCAN: "true" registry: "" - image: "dashboard:a88790b2-690-27891" + image: "dashboard:4eb1a17a-690-28956" imagePullPolicy: IfNotPresent devtron: registry: "" - image: "hyperion:a109b8be-280-27896" - cicdImage: "devtron:a109b8be-434-27906" + image: "hyperion:69603019-280-29389" + cicdImage: "devtron:69603019-434-29388" imagePullPolicy: IfNotPresent customOverrides: {} serviceMonitor: @@ -108,7 +108,7 @@ components: # - devtron.example.com ciRunner: registry: "" - image: "ci-runner:54595cec-138-27894" + image: "ci-runner:343b24f5-138-29387" argocdDexServer: registry: "" image: "dex:v2.30.2" @@ -117,7 +117,7 @@ components: authenticator: "authenticator:e414faff-393-13273" kubelink: registry: "" - image: "kubelink:6c0c7082-564-27862" + image: "kubelink:0a3d5e84-564-28948" imagePullPolicy: IfNotPresent configs: ENABLE_HELM_RELEASE_CACHE: "true" @@ -135,7 +135,7 @@ components: keyName: postgresql-password kubewatch: registry: "" - image: "kubewatch:33965457-419-27887" + image: "kubewatch:0a3d5e84-419-28949" imagePullPolicy: IfNotPresent configs: devtroncd_NAMESPACE: "devtron-ci" @@ -157,7 +157,7 @@ components: volumeSize: "20Gi" gitsensor: registry: "" - image: "git-sensor:6c0c7082-200-27863" + image: "git-sensor:0a3d5e84-200-28960" imagePullPolicy: IfNotPresent serviceMonitor: enabled: false @@ -175,7 +175,7 @@ components: # Values for lens lens: registry: "" - image: "lens:6c0c7082-333-27872" + image: "lens:0a3d5e84-333-28951" imagePullPolicy: IfNotPresent secrets: {} resources: {} @@ -222,7 +222,7 @@ components: DB_NAME: "lens" chartSync: registry: "" - image: chart-sync:6c0c7082-836-27893 + image: chart-sync:0a3d5e84-836-28979 schedule: "0 19 * * *" extraConfigs: {} # values for argocd integration @@ -368,7 +368,10 @@ argo-cd: security: enabled: false imageScanner: - image: "image-scanner:33965457-141-27892" + image: "image-scanner:0a3d5e84-141-28953" + configs: + TRIVY_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-db + TRIVY_JAVA_DB_REPOSITORY: mirror.gcr.io/aquasec/trivy-java-db # Values for trivy trivy: enabled: false @@ -383,7 +386,7 @@ security: notifier: enabled: false imagePullPolicy: IfNotPresent - image: "notifier:2f9166d1-372-27880" + image: "notifier:9aa5e510-372-28961" configs: CD_ENVIRONMENT: PROD DB: orchestrator diff --git a/client/argocdServer/repoCredsK8sClient/repoCreds.go b/client/argocdServer/repoCredsK8sClient/repoCreds.go index 8ffd141397..ce08dda2e2 100644 --- a/client/argocdServer/repoCredsK8sClient/repoCreds.go +++ b/client/argocdServer/repoCredsK8sClient/repoCreds.go @@ -573,7 +573,7 @@ func (impl *RepositoryCredsK8sClientImpl) DeleteChartRepository(argoK8sConfig *a retryCount = retryCount + 1 var isFoundInArgoCdCm bool - cm, err := impl.K8sService.GetConfigMap(argoK8sConfig.AcdConfigMapName, argoK8sConfig.AcdConfigMapName, k8sClient) + cm, err := impl.K8sService.GetConfigMap(argoK8sConfig.AcdNamespace, argoK8sConfig.AcdConfigMapName, k8sClient) if err != nil { return err } diff --git a/go.mod b/go.mod index a5b1939cba..86d9506f99 100644 --- a/go.mod +++ b/go.mod @@ -288,8 +288,8 @@ require gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect replace ( github.com/argoproj/argo-workflows/v3 v3.5.10 => github.com/devtron-labs/argo-workflows/v3 v3.5.13 - github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250127104410-85d6bfe0b45f - github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f + github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250130075053-69cdda98e3e2 + github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250130075053-69cdda98e3e2 github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127 github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5 k8s.io/api => k8s.io/api v0.29.7 diff --git a/go.sum b/go.sum index 150815b113..50156b584f 100644 --- a/go.sum +++ b/go.sum @@ -792,10 +792,10 @@ github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc h1:VRRKCwnzq github.com/denisenkom/go-mssqldb v0.0.0-20200428022330-06a60b6afbbc/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/devtron-labs/argo-workflows/v3 v3.5.13 h1:3pINq0gXOSeTw2z/vYe+j80lRpSN5Rp/8mfQORh8SmU= github.com/devtron-labs/argo-workflows/v3 v3.5.13/go.mod h1:/vqxcovDPT4zqr4DjR5v7CF8ggpY1l3TSa2CIG3jmjA= -github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250127104410-85d6bfe0b45f h1:8nYP02cYX/9e3H8YfBV4b8hP4WwbGY/dUMNu+N9cH1Q= -github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250127104410-85d6bfe0b45f/go.mod h1:5lv4Wfj5ERhhvDGXe2IeES6qxjvUVCcohaRwKnWBMNo= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f h1:4wUbt+83DmpZFqYS69CJxNtBpSuCb58UwqOrWsZG82s= -github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f/go.mod h1:1QJJLpgJSkb5Jm9xPeKAk+kXb0QgBOOOgJj0cgYhAVA= +github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250130075053-69cdda98e3e2 h1:8QjRav7pCDb32Pz8HwbS1P8QQJ1QSDb3wJgAmNYkNeU= +github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250130075053-69cdda98e3e2/go.mod h1:5lv4Wfj5ERhhvDGXe2IeES6qxjvUVCcohaRwKnWBMNo= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250130075053-69cdda98e3e2 h1:8VByFEk14t2z2DDaD/7pTgwSM7zFYEMqfthLWpt2M3w= +github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250130075053-69cdda98e3e2/go.mod h1:1QJJLpgJSkb5Jm9xPeKAk+kXb0QgBOOOgJj0cgYhAVA= github.com/devtron-labs/go-bitbucket v0.9.60-beta h1:VEx1jvDgdtDPS6A1uUFoaEi0l1/oLhbr+90xOwr6sDU= github.com/devtron-labs/go-bitbucket v0.9.60-beta/go.mod h1:GnuiCesvh8xyHeMCb+twm8lBR/kQzJYSKL28ZfObp1Y= github.com/devtron-labs/protos v0.0.3-0.20240802105333-92ee9bb85d80 h1:xwbTeijNTf4/j1v+tSfwVqwLVnReas/NqEKeQHvSTys= diff --git a/internal/util/ValidateUtil.go b/internal/util/ValidateUtil.go index 00339c051f..c5a40f73e4 100644 --- a/internal/util/ValidateUtil.go +++ b/internal/util/ValidateUtil.go @@ -95,6 +95,10 @@ func IntValidator() (*validator.Validate, error) { if err != nil { return v, err } + err = v.RegisterValidation("global-entity-name", validateGlobalEntityName) + if err != nil { + return v, err + } err = v.RegisterValidation("not-system-admin-user", validateForSystemOrAdminUser) if err != nil { return v, err @@ -129,3 +133,10 @@ func validateDockerImage(fl validator.FieldLevel) bool { } return false } + +func validateGlobalEntityName(fl validator.FieldLevel) bool { + // ^[a-z0-9]+(?:[-._]+[a-z0-9]+)*$ + hostnameRegexString := `^[a-z0-9]+(?:[-._]+[a-z0-9]+)*$` + hostnameRegexRFC952 := regexp.MustCompile(hostnameRegexString) + return hostnameRegexRFC952.MatchString(fl.Field().String()) +} diff --git a/manifests/install/devtron-installer.yaml b/manifests/install/devtron-installer.yaml index 7964d6175b..2b2721abe1 100644 --- a/manifests/install/devtron-installer.yaml +++ b/manifests/install/devtron-installer.yaml @@ -4,4 +4,4 @@ metadata: name: installer-devtron namespace: devtroncd spec: - url: https://raw.githubusercontent.com/devtron-labs/devtron/v1.1.0/manifests/installation-script + url: https://raw.githubusercontent.com/devtron-labs/devtron/v1.2.1/manifests/installation-script diff --git a/manifests/installation-script b/manifests/installation-script index 8dfd8d52ac..ff3988c051 100644 --- a/manifests/installation-script +++ b/manifests/installation-script @@ -1,4 +1,4 @@ -LTAG="v1.1.0"; +LTAG="v1.2.1"; REPO_RAW_URL="https://raw.githubusercontent.com/devtron-labs/devtron/"; log("executed devtron setup installation"); diff --git a/manifests/release.txt b/manifests/release.txt index 9d8db87198..f6ea0f2d65 100644 --- a/manifests/release.txt +++ b/manifests/release.txt @@ -1 +1 @@ -stable -1 v1.1.0 +stable -1 v1.2.1 diff --git a/manifests/version.txt b/manifests/version.txt index 795460fcec..79127d85a4 100644 --- a/manifests/version.txt +++ b/manifests/version.txt @@ -1 +1 @@ -v1.1.0 +v1.2.0 diff --git a/manifests/yamls/dashboard.yaml b/manifests/yamls/dashboard.yaml index 6900e2842d..ab2f5cd98e 100644 --- a/manifests/yamls/dashboard.yaml +++ b/manifests/yamls/dashboard.yaml @@ -235,7 +235,7 @@ spec: - name: envoy-config-volume mountPath: /etc/envoy-config/ - name: dashboard - image: "quay.io/devtron/dashboard:a88790b2-690-27891" + image: "quay.io/devtron/dashboard:4eb1a17a-690-28956" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifests/yamls/devtron.yaml b/manifests/yamls/devtron.yaml index a2fd589313..66d5930c61 100644 --- a/manifests/yamls/devtron.yaml +++ b/manifests/yamls/devtron.yaml @@ -53,7 +53,7 @@ data: CD_NODE_TAINTS_VALUE: "ci" CD_ARTIFACT_LOCATION_FORMAT: "%d/%d.zip" DEFAULT_CD_NAMESPACE: "devtron-cd" - DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:54595cec-138-27894" + DEFAULT_CI_IMAGE: "quay.io/devtron/ci-runner:343b24f5-138-29387" DEFAULT_CD_TIMEOUT: "3600" WF_CONTROLLER_INSTANCE_ID: "devtron-runner" CI_LOGS_KEY_PREFIX: "ci-artifacts" @@ -89,7 +89,7 @@ data: ENFORCER_CACHE: "true" ENFORCER_CACHE_EXPIRATION_IN_SEC: "345600" ENFORCER_MAX_BATCH_SIZE: "1" - APP_SYNC_IMAGE: "quay.io/devtron/chart-sync:6c0c7082-836-27893" + APP_SYNC_IMAGE: "quay.io/devtron/chart-sync:0a3d5e84-836-28979" DEVTRON_SECRET_NAME: "devtron-secret" GIT_SENSOR_PROTOCOL: GRPC GIT_SENSOR_URL: git-sensor-service.devtroncd:90 @@ -169,7 +169,7 @@ spec: runAsUser: 1000 containers: - name: devtron - image: "quay.io/devtron/devtron:a109b8be-434-27906" + image: "quay.io/devtron/devtron:69603019-434-29388" securityContext: allowPrivilegeEscalation: false runAsUser: 1000 diff --git a/manifests/yamls/gitsensor.yaml b/manifests/yamls/gitsensor.yaml index 2c62af06bf..b7f421a068 100644 --- a/manifests/yamls/gitsensor.yaml +++ b/manifests/yamls/gitsensor.yaml @@ -67,7 +67,7 @@ spec: - /bin/sh - -c - mkdir -p /git-base/ssh-keys && chown -R devtron:devtron /git-base && chmod 777 /git-base/ssh-keys - image: "quay.io/devtron/git-sensor:6c0c7082-200-27863" + image: "quay.io/devtron/git-sensor:0a3d5e84-200-28960" imagePullPolicy: IfNotPresent name: chown-git-base resources: {} @@ -80,7 +80,7 @@ spec: name: git-volume containers: - name: git-sensor - image: "quay.io/devtron/git-sensor:6c0c7082-200-27863" + image: "quay.io/devtron/git-sensor:0a3d5e84-200-28960" securityContext: allowPrivilegeEscalation: false runAsUser: 1000 diff --git a/manifests/yamls/image-scanner.yaml b/manifests/yamls/image-scanner.yaml index 5dc19cc499..812a9ce7b4 100644 --- a/manifests/yamls/image-scanner.yaml +++ b/manifests/yamls/image-scanner.yaml @@ -73,7 +73,7 @@ spec: runAsUser: 1000 containers: - name: image-scanner - image: "quay.io/devtron/image-scanner:33965457-141-27892" + image: "quay.io/devtron/image-scanner:0a3d5e84-141-28953" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifests/yamls/kubelink.yaml b/manifests/yamls/kubelink.yaml index 8ab7388a67..2322ebd13e 100644 --- a/manifests/yamls/kubelink.yaml +++ b/manifests/yamls/kubelink.yaml @@ -25,7 +25,7 @@ spec: runAsUser: 1000 containers: - name: kubelink - image: "quay.io/devtron/kubelink:6c0c7082-564-27862" + image: "quay.io/devtron/kubelink:0a3d5e84-564-28948" securityContext: allowPrivilegeEscalation: false runAsUser: 1000 diff --git a/manifests/yamls/kubewatch.yaml b/manifests/yamls/kubewatch.yaml index f098728fa1..ba56d645ad 100644 --- a/manifests/yamls/kubewatch.yaml +++ b/manifests/yamls/kubewatch.yaml @@ -164,7 +164,7 @@ spec: runAsUser: 1000 containers: - name: kubewatch - image: "quay.io/devtron/kubewatch:33965457-419-27887" + image: "quay.io/devtron/kubewatch:0a3d5e84-419-28949" securityContext: allowPrivilegeEscalation: false runAsUser: 1000 diff --git a/manifests/yamls/lens.yaml b/manifests/yamls/lens.yaml index 937a245d2f..7c24573643 100644 --- a/manifests/yamls/lens.yaml +++ b/manifests/yamls/lens.yaml @@ -71,7 +71,7 @@ spec: runAsUser: 1000 containers: - name: lens - image: "quay.io/devtron/lens:6c0c7082-333-27872" + image: "quay.io/devtron/lens:0a3d5e84-333-28951" imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false diff --git a/manifests/yamls/notifier.yaml b/manifests/yamls/notifier.yaml index ee7a2e5718..51f28d882c 100644 --- a/manifests/yamls/notifier.yaml +++ b/manifests/yamls/notifier.yaml @@ -66,7 +66,7 @@ spec: restartPolicy: Always containers: - name: notifier - image: quay.io/devtron/notifier:2f9166d1-372-27880" + image: quay.io/devtron/notifier:9aa5e510-372-28961" imagePullPolicy: IfNotPresent ports: - name: app diff --git a/pkg/auth/user/UserCommonService.go b/pkg/auth/user/UserCommonService.go index 0ebd4f8f88..6b370708b8 100644 --- a/pkg/auth/user/UserCommonService.go +++ b/pkg/auth/user/UserCommonService.go @@ -412,22 +412,13 @@ func (impl UserCommonServiceImpl) RemoveRolesAndReturnEliminatedPoliciesForGroup impl.logger.Errorw("Error in fetching roles by filter", "user", request) return nil, nil, err } - oldRoleModel, err := impl.userAuthRepository.GetRoleByFilterForAllTypes(entity, "", "", "", "", accessType, roleFilter.Cluster, namespace, group, kind, resource, actionType, true, "") - if err != nil { - impl.logger.Errorw("Error in fetching roles by filter", "user", request) - return nil, nil, err - } - if roleModel.Id == 0 && oldRoleModel.Id == 0 { + if roleModel.Id == 0 { impl.logger.Warnw("no role found for given filter", "filter", roleFilter) continue } if _, ok := existingRoles[roleModel.Id]; ok { delete(eliminatedRoles, roleModel.Id) } - if _, ok := existingRoles[oldRoleModel.Id]; ok { - //delete old role mapping from existing but not from eliminated roles (so that it gets deleted) - delete(existingRoles, oldRoleModel.Id) - } } } } diff --git a/pkg/eventProcessor/bean/workflowEventBean.go b/pkg/eventProcessor/bean/workflowEventBean.go index 8bcd4f200c..4b33b8cba4 100644 --- a/pkg/eventProcessor/bean/workflowEventBean.go +++ b/pkg/eventProcessor/bean/workflowEventBean.go @@ -40,6 +40,7 @@ type CdStageCompleteEvent struct { PluginRegistryArtifactDetails map[string][]string `json:"PluginRegistryArtifactDetails"` PluginArtifacts *PluginArtifacts `json:"pluginArtifacts"` IsArtifactUploaded bool `json:"isArtifactUploaded"` + IsFailed bool `json:"isFailed"` } type UserDeploymentRequest struct { diff --git a/pkg/eventProcessor/in/WorkflowEventProcessorService.go b/pkg/eventProcessor/in/WorkflowEventProcessorService.go index 631c68c597..7328c13825 100644 --- a/pkg/eventProcessor/in/WorkflowEventProcessorService.go +++ b/pkg/eventProcessor/in/WorkflowEventProcessorService.go @@ -170,14 +170,23 @@ func (impl *WorkflowEventProcessorImpl) SubscribeCDStageCompleteEvent() error { return } wfr.IsArtifactUploaded = cdStageCompleteEvent.IsArtifactUploaded - if wfr.Status != string(v1alpha1.NodeSucceeded) { + if !slices.Contains(cdWorkflowModelBean.WfrTerminalStatusList, wfr.Status) { impl.logger.Debugw("event received from ci runner, updating workflow runner status as succeeded", "savedWorkflowRunnerId", wfr.Id, "oldStatus", wfr.Status, "podStatus", wfr.PodStatus) - wfr.Status = string(v1alpha1.NodeSucceeded) + if cdStageCompleteEvent.IsFailed { + wfr.Status = string(v1alpha1.NodeFailed) + } else { + wfr.Status = string(v1alpha1.NodeSucceeded) + } err = impl.cdWorkflowRunnerService.UpdateWfr(wfr, 1) if err != nil { impl.logger.Errorw("update cd-wf-runner failed for id ", "cdWfrId", wfr.Id, "err", err) return } + + triggerContext := triggerBean.TriggerContext{ + ReferenceId: pointer.String(msg.MsgId), + } + impl.handleCDStageCompleteEvent(triggerContext, cdStageCompleteEvent, wfr) } else { err = impl.cdWorkflowRunnerService.UpdateIsArtifactUploaded(wfr.Id, cdStageCompleteEvent.IsArtifactUploaded) if err != nil { @@ -185,32 +194,6 @@ func (impl *WorkflowEventProcessorImpl) SubscribeCDStageCompleteEvent() error { return } } - - triggerContext := triggerBean.TriggerContext{ - ReferenceId: pointer.String(msg.MsgId), - } - if wfr.WorkflowType == apiBean.CD_WORKFLOW_TYPE_PRE { - impl.logger.Debugw("received pre stage success event for workflow runner ", "wfId", strconv.Itoa(wfr.Id)) - err = impl.workflowDagExecutor.HandlePreStageSuccessEvent(triggerContext, cdStageCompleteEvent) - if err != nil { - impl.logger.Errorw("deployment success event error", "err", err) - return - } - } else if wfr.WorkflowType == apiBean.CD_WORKFLOW_TYPE_POST { - - pluginArtifacts := make(map[string][]string) - if cdStageCompleteEvent.PluginArtifacts != nil { - pluginArtifacts = cdStageCompleteEvent.PluginArtifacts.GetRegistryToUniqueContainerArtifactDataMapping() - } - globalUtil.MergeMaps(pluginArtifacts, cdStageCompleteEvent.PluginRegistryArtifactDetails) - - impl.logger.Debugw("received post stage success event for workflow runner ", "wfId", strconv.Itoa(wfr.Id)) - err = impl.workflowDagExecutor.HandlePostStageSuccessEvent(triggerContext, wfr, wfr.CdWorkflowId, cdStageCompleteEvent.CdPipelineId, cdStageCompleteEvent.TriggeredBy, pluginArtifacts) - if err != nil { - impl.logger.Errorw("deployment success event error", "err", err) - return - } - } } // add required logging here @@ -233,6 +216,37 @@ func (impl *WorkflowEventProcessorImpl) SubscribeCDStageCompleteEvent() error { return nil } +func (impl *WorkflowEventProcessorImpl) handleCDStageCompleteEvent(triggerContext triggerBean.TriggerContext, cdStageCompleteEvent bean.CdStageCompleteEvent, wfr *cdWorkflowBean.CdWorkflowRunnerDto) { + if cdStageCompleteEvent.IsFailed { + impl.logger.Debugw("event received from ci runner, updating workflow runner status as failed, not taking any action", "savedWorkflowRunnerId", wfr.Id, "oldStatus", wfr.Status, "podStatus", wfr.PodStatus) + return + } + + var err error + if wfr.WorkflowType == apiBean.CD_WORKFLOW_TYPE_PRE { + impl.logger.Debugw("received pre stage success event for workflow runner ", "wfId", strconv.Itoa(wfr.Id)) + err = impl.workflowDagExecutor.HandlePreStageSuccessEvent(triggerContext, cdStageCompleteEvent) + if err != nil { + impl.logger.Errorw("deployment success event error", "err", err) + return + } + } else if wfr.WorkflowType == apiBean.CD_WORKFLOW_TYPE_POST { + impl.logger.Debugw("received post stage success event for workflow runner ", "wfId", strconv.Itoa(wfr.Id)) + + pluginArtifacts := make(map[string][]string) + if cdStageCompleteEvent.PluginArtifacts != nil { + pluginArtifacts = cdStageCompleteEvent.PluginArtifacts.GetRegistryToUniqueContainerArtifactDataMapping() + } + globalUtil.MergeMaps(pluginArtifacts, cdStageCompleteEvent.PluginRegistryArtifactDetails) + + err = impl.workflowDagExecutor.HandlePostStageSuccessEvent(triggerContext, wfr, wfr.CdWorkflowId, cdStageCompleteEvent.CdPipelineId, cdStageCompleteEvent.TriggeredBy, pluginArtifacts) + if err != nil { + impl.logger.Errorw("deployment success event error", "err", err) + return + } + } +} + func (impl *WorkflowEventProcessorImpl) SubscribeTriggerBulkAction() error { callback := func(msg *model.PubSubMsg) { cdWorkflow := new(pipelineConfig.CdWorkflow) diff --git a/pkg/infraConfig/service/infraConfigService.go b/pkg/infraConfig/service/infraConfigService.go index 4b2e1e5e88..0988f9be7b 100644 --- a/pkg/infraConfig/service/infraConfigService.go +++ b/pkg/infraConfig/service/infraConfigService.go @@ -730,6 +730,9 @@ func (impl *InfraConfigServiceImpl) sanitizeUpdatableConfigurations(updatableInf func (impl *InfraConfigServiceImpl) getAppliedInfraConfigForProfile(appliedProfileConfig, defaultProfileConfig *v1.ProfileBeanDto, variableSnapshots map[string]map[string]string, targetPlatformsList []string) (map[string]*v1.InfraConfig, error) { resp := make(map[string]*v1.InfraConfig) for _, targetPlatform := range targetPlatformsList { + if !appliedProfileConfig.GetBuildxDriverType().IsPlatformSupported(targetPlatform) { + continue + } appliedConfiguration := impl.getAppliedConfigurationForTargetPlatform(appliedProfileConfig, defaultProfileConfig, targetPlatform) infraConfigForTrigger, err := impl.getInfraConfigurationForTrigger(appliedConfiguration) if err != nil { diff --git a/pkg/infraConfig/units/bean/memory_unit_type.go b/pkg/infraConfig/units/bean/memory_unit_type.go index 93d7a33f57..1516c979a4 100644 --- a/pkg/infraConfig/units/bean/memory_unit_type.go +++ b/pkg/infraConfig/units/bean/memory_unit_type.go @@ -41,6 +41,8 @@ const ( func (memoryUnitStr MemoryUnitStr) GetUnitSuffix() UnitType { switch memoryUnitStr { + case MILLIBYTE: + return MilliByte case BYTE: return Byte case KIBYTE: diff --git a/pkg/pipeline/WorkflowService.go b/pkg/pipeline/WorkflowService.go index 937ca49482..3cc2215867 100644 --- a/pkg/pipeline/WorkflowService.go +++ b/pkg/pipeline/WorkflowService.go @@ -175,18 +175,18 @@ func (impl *WorkflowServiceImpl) createWorkflowTemplate(workflowRequest *types.W } } else { if shouldAddExistingCmCsInWorkflow { - workflowConfigMaps, workflowSecrets, err = impl.addExistingCmCsInWorkflowForCDStage(workflowRequest, workflowConfigMaps, workflowSecrets) + cdStageConfigMaps, cdStageSecrets, err := impl.addExistingCmCsInWorkflowForCDStage(workflowRequest) if err != nil { impl.Logger.Errorw("error occurred while adding existing cm/ cs", "err", err) return bean3.WorkflowTemplate{}, err } - cdStageConfigMaps, cdStageSecrets, err := impl.prepareCmCsForWorkflowTemplate(workflowRequest, workflowConfigMaps, workflowSecrets) + cdStageModifiedConfigMaps, cdStageModifiedSecrets, err := impl.prepareCmCsForWorkflowTemplate(workflowRequest, cdStageConfigMaps, cdStageSecrets) if err != nil { impl.Logger.Errorw("error occurred while preparing cd stage cm/ cs for workflow template", "err", err) return bean3.WorkflowTemplate{}, err } - workflowConfigMaps = append(workflowConfigMaps, cdStageConfigMaps...) - workflowSecrets = append(workflowSecrets, cdStageSecrets...) + workflowConfigMaps = append(workflowConfigMaps, cdStageModifiedConfigMaps...) + workflowSecrets = append(workflowSecrets, cdStageModifiedSecrets...) } } // internally inducing BlobStorageCmName and BlobStorageSecretName for getting logs, caches and artifacts from @@ -273,7 +273,9 @@ func (impl *WorkflowServiceImpl) appendGlobalCMCS(workflowRequest *types.Workflo return workflowConfigMaps, workflowSecrets, nil } -func (impl *WorkflowServiceImpl) addExistingCmCsInWorkflowForCDStage(workflowRequest *types.WorkflowRequest, workflowConfigMaps []bean.ConfigSecretMap, workflowSecrets []bean.ConfigSecretMap) ([]bean.ConfigSecretMap, []bean.ConfigSecretMap, error) { +func (impl *WorkflowServiceImpl) addExistingCmCsInWorkflowForCDStage(workflowRequest *types.WorkflowRequest) ([]bean.ConfigSecretMap, []bean.ConfigSecretMap, error) { + workflowConfigMaps := make([]bean.ConfigSecretMap, 0) + workflowSecrets := make([]bean.ConfigSecretMap, 0) existingConfigMap, existingSecrets, err := impl.configMapService.GetCmCsForPrePostStageTrigger(workflowRequest.Scope, workflowRequest.AppId, workflowRequest.EnvironmentId, false) if err != nil { impl.Logger.Errorw("failed to get configmap data", "err", err) diff --git a/pkg/plugin/GlobalPluginService.go b/pkg/plugin/GlobalPluginService.go index 125e2e594a..d6d663d6a5 100644 --- a/pkg/plugin/GlobalPluginService.go +++ b/pkg/plugin/GlobalPluginService.go @@ -1941,7 +1941,7 @@ func (impl *GlobalPluginServiceImpl) MigratePluginDataToParentPluginMetadata(plu continue } parentMetadata := repository.NewPluginParentMetadata() - parentMetadata.SetParentPluginMetadata(pluginMetadata).CreateAuditLog(bean.SystemUserId) + parentMetadata.SetParentPluginMetadata(pluginMetadata).CreateAuditLog(bean.SystemUserId).WithIsExposed(true) parentMetadata.Identifier = identifier parentMetadata, err = impl.globalPluginRepository.SavePluginParentMetadata(tx, parentMetadata) if err != nil { diff --git a/pkg/plugin/adaptor/adaptor.go b/pkg/plugin/adaptor/adaptor.go index d005d62304..e145f766d0 100644 --- a/pkg/plugin/adaptor/adaptor.go +++ b/pkg/plugin/adaptor/adaptor.go @@ -8,12 +8,12 @@ import ( func GetPluginParentMetadataDbObject(pluginDto *pluginBean.PluginParentMetadataDto, userId int32) *repository.PluginParentMetadata { return repository.NewPluginParentMetadata().CreateAuditLog(userId). - WithBasicMetadata(pluginDto.Name, pluginDto.PluginIdentifier, pluginDto.Description, pluginDto.Icon, repository.PLUGIN_TYPE_SHARED) + WithBasicMetadata(pluginDto.Name, pluginDto.PluginIdentifier, pluginDto.Description, pluginDto.Icon, repository.PLUGIN_TYPE_SHARED, pluginDto.IsExposed) } func GetPluginVersionMetadataDbObject(pluginDto *pluginBean.PluginParentMetadataDto, userId int32) *repository.PluginMetadata { versionDto := pluginDto.Versions.DetailedPluginVersionData[0] - return repository.NewPluginVersionMetadata().CreateAuditLog(userId).WithBasicMetadata(pluginDto.Name, versionDto.Description, versionDto.Version, versionDto.DocLink) + return repository.NewPluginVersionMetadata().CreateAuditLog(userId).WithBasicMetadata(pluginDto.Name, versionDto.Description, versionDto.Version, versionDto.DocLink, versionDto.IsExposed) } func GetPluginStepDbObject(pluginStepDto *pluginBean.PluginStepsDto, pluginVersionMetadataId int, userId int32) *repository.PluginStep { diff --git a/pkg/plugin/bean/bean.go b/pkg/plugin/bean/bean.go index 7d41ea252c..2434d375ce 100644 --- a/pkg/plugin/bean/bean.go +++ b/pkg/plugin/bean/bean.go @@ -54,6 +54,7 @@ type PluginMetadataDto struct { PluginStage string `json:"pluginStage,omitempty"` PluginSteps []*PluginStepsDto `json:"pluginSteps,omitempty"` AreNewTagsPresent bool `json:"areNewTagsPresent,omitempty"` + IsExposed *bool `json:"-"` } type PluginMinDto struct { @@ -127,6 +128,7 @@ type PluginParentMetadataDto struct { Icon string `json:"icon,omitempty"` PluginStageType string `json:"pluginStageType,omitempty"` Versions *PluginVersions `json:"pluginVersions"` + IsExposed *bool `json:"-"` } func NewPluginParentMetadataDto() *PluginParentMetadataDto { diff --git a/pkg/plugin/repository/GlobalPluginRepository.go b/pkg/plugin/repository/GlobalPluginRepository.go index 059af5a8b3..715b74fcc0 100644 --- a/pkg/plugin/repository/GlobalPluginRepository.go +++ b/pkg/plugin/repository/GlobalPluginRepository.go @@ -129,14 +129,24 @@ func (r *PluginParentMetadata) CreateAuditLog(userId int32) *PluginParentMetadat r.UpdatedOn = time.Now() return r } +func (r *PluginParentMetadata) WithIsExposed(isExposed bool) *PluginParentMetadata { + r.IsExposed = isExposed + return r +} -func (r *PluginParentMetadata) WithBasicMetadata(name, identifier, description, icon string, pluginType PluginType) *PluginParentMetadata { +func (r *PluginParentMetadata) WithBasicMetadata(name, identifier, description, icon string, pluginType PluginType, isExposed *bool) *PluginParentMetadata { r.Name = name r.Identifier = identifier r.Description = description r.Icon = icon r.Type = pluginType r.Deleted = false + if isExposed != nil { + r.IsExposed = *isExposed + } else { + //default set true + r.IsExposed = true + } return r } @@ -189,13 +199,19 @@ func (r *PluginMetadata) CreateAuditLog(userId int32) *PluginMetadata { return r } -func (r *PluginMetadata) WithBasicMetadata(name, description, pluginVersion, docLink string) *PluginMetadata { +func (r *PluginMetadata) WithBasicMetadata(name, description, pluginVersion, docLink string, isExposed *bool) *PluginMetadata { r.Name = name r.PluginVersion = pluginVersion r.Description = description r.DocLink = docLink r.Deleted = false r.IsDeprecated = false + if isExposed != nil { + r.IsExposed = *isExposed + } else { + //default value is true + r.IsExposed = true + } return r } diff --git a/releasenotes.md b/releasenotes.md index dbce39d55d..d6273a0ca9 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -1,53 +1,6 @@ -## v1.1.0 +## v1.2.1 ## Bugs -- fix: Changes in labels of ref chart 4.20 (#6178) -- fix: Fix cd-trigger-plugin (#6203) -- fix: Bulk edit fix for global override (#6193) -- fix: Panic handling for get workflow logs (#6168) -- fix: User permissions not merging on same environments (#6167) -- fix: Secret masking fix (#6136) -- fix: Delete git repo without pipeline config (#6148) -- fix: All modules installation fix (#6140) -- fix: Update sql fix buildx (#6096) -## Enhancements -- feat: Support to trigger with same hash in CD trigger plugin (#6205) -- feat: Patch merge strategy for cm cs and dt (#6115) -- feat: Adds Github actions to add the label using slash command (#6126) -- feat: Fetch all non deprecated plugins in list (#6135) -- feat: Node k8s permissions (#6123) -- feat: App details refactoring (#6104) -## Others -- misc: Main sync develop 20dec (#6210) -- misc: migration for mandatory tag (#6208) -- chore: Read service for team (#6201) -- chore: Oss ent triggerService changes (#6189) -- misc: Release candidate v0.25.0 (#6194) -- chore: Panic fix (#6188) -- chore: Panic fix installed app read service (#6185) -- chore: Runtime params variable refactorings (#6183) -- misc: Asset for plugin (#6184) -- chore: Updating deployment status start and end time (#6171) -- misc: Main sync develop 16dec (#6182) -- chore: Adding logs in deployment trigger flow (#6180) -- misc: Added cd workflow runner read service (#6175) -- misc: Added the token that contains the permissions to read the org members (#6164) -- misc: Refactor-plugin-images migrations (#6108) -- misc: Addign new plugins images (#6145) -- misc: Updated authenticator to c3254b79e386 (#6144) -- misc: Adding pr validator for fork prs as gh command will not work (#6143) -- misc: Adding validation for public repo (#6137) -- misc: Update pull_request_template.md (#6134) -- misc: Authenticator panic fix (#6131) -- misc: Bulk update cm/cs name reference update fix (#6130) -- misc: Cluster, project, environment read and beans (#6067) -- chore: Use certificates data when InsecureSkipTLSVerify is false for a cluster in case of external run CI (#6100) -- misc: main sync develop nov18 (#6107) -- chore: Implemented Rbac enforcer in batch (#6103) -- misc: Update pr-issue-validator.yaml (#6086) -- misc: Sql query fixes (#6097) -- misc: Kubecon 2024 oss sync (#6094) -- chore: Depandabot fixes (#6070) -- misc: Handler error while while helm deployment (#6082) +- fix: Auto cd trigger even if pre-cd fails (#6338) diff --git a/scripts/devtron-reference-helm-charts/cronjob-chart_1-3-0/schema.json b/scripts/devtron-reference-helm-charts/cronjob-chart_1-3-0/schema.json index 3219f3ea31..5f6a66b16d 100644 --- a/scripts/devtron-reference-helm-charts/cronjob-chart_1-3-0/schema.json +++ b/scripts/devtron-reference-helm-charts/cronjob-chart_1-3-0/schema.json @@ -372,7 +372,7 @@ "description": "Kind is a string value representing the object type.", "enum": [ "Job", - "Cronjob", + "CronJob", "ScaledJob" ], "title": "Kind" diff --git a/scripts/devtron-reference-helm-charts/cronjob-chart_1-4-0/schema.json b/scripts/devtron-reference-helm-charts/cronjob-chart_1-4-0/schema.json index 3219f3ea31..5f6a66b16d 100644 --- a/scripts/devtron-reference-helm-charts/cronjob-chart_1-4-0/schema.json +++ b/scripts/devtron-reference-helm-charts/cronjob-chart_1-4-0/schema.json @@ -372,7 +372,7 @@ "description": "Kind is a string value representing the object type.", "enum": [ "Job", - "Cronjob", + "CronJob", "ScaledJob" ], "title": "Kind" diff --git a/scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/schema.json b/scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/schema.json index 3219f3ea31..5f6a66b16d 100644 --- a/scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/schema.json +++ b/scripts/devtron-reference-helm-charts/cronjob-chart_1-5-0/schema.json @@ -372,7 +372,7 @@ "description": "Kind is a string value representing the object type.", "enum": [ "Job", - "Cronjob", + "CronJob", "ScaledJob" ], "title": "Kind" diff --git a/scripts/sql/31602800_build_infra_cm_cs.down.sql b/scripts/sql/31602800_build_infra_cm_cs.down.sql index 60524b1e70..e543a08da3 100644 --- a/scripts/sql/31602800_build_infra_cm_cs.down.sql +++ b/scripts/sql/31602800_build_infra_cm_cs.down.sql @@ -6,4 +6,8 @@ DROP TABLE IF EXISTS "public"."infra_config_trigger_history"; -- Drop Sequence for infra_config_trigger_history DROP SEQUENCE IF EXISTS "public"."id_seq_infra_config_trigger_history"; +--hard deleting the entries +DELETE FROM "public"."infra_profile_configuration" +WHERE key = 8 or key =9; + END; \ No newline at end of file diff --git a/vendor/modules.txt b/vendor/modules.txt index f07ff09ba8..aa07298980 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -336,7 +336,7 @@ github.com/davecgh/go-spew/spew # github.com/deckarep/golang-set v1.8.0 ## explicit; go 1.17 github.com/deckarep/golang-set -# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250127104410-85d6bfe0b45f +# github.com/devtron-labs/authenticator v0.4.35-0.20240809073103-6e11da8083f8 => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250130075053-69cdda98e3e2 ## explicit; go 1.21 github.com/devtron-labs/authenticator/apiToken github.com/devtron-labs/authenticator/client @@ -344,7 +344,7 @@ github.com/devtron-labs/authenticator/jwt github.com/devtron-labs/authenticator/middleware github.com/devtron-labs/authenticator/oidc github.com/devtron-labs/authenticator/password -# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f +# github.com/devtron-labs/common-lib v0.18.1-0.20241001061923-eda545dc839e => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250130075053-69cdda98e3e2 ## explicit; go 1.21 github.com/devtron-labs/common-lib/async github.com/devtron-labs/common-lib/blob-storage @@ -2215,8 +2215,8 @@ xorm.io/xorm/log xorm.io/xorm/names xorm.io/xorm/schemas xorm.io/xorm/tags -# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250127104410-85d6bfe0b45f -# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250127104410-85d6bfe0b45f +# github.com/devtron-labs/authenticator => github.com/devtron-labs/devtron-services/authenticator v0.0.0-20250130075053-69cdda98e3e2 +# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20250130075053-69cdda98e3e2 # github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127 # github.com/googleapis/gnostic => github.com/googleapis/gnostic v0.5.5 # k8s.io/api => k8s.io/api v0.29.7