Skip to content

Conversation

@kartik-579
Copy link
Member

…or type

Description

In Image pull secret service, type assertion was not handled which resulted into causing nil pointer panic,

Fixes #

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@kartik-579 kartik-579 merged commit 5006d4a into main Mar 29, 2023
@kartik-579 kartik-579 deleted the ips-config-fix branch March 29, 2023 10:16
@kartik-579
Copy link
Member Author

RCA: Code was type asserting k8s type error when getting image pull secret but was not handling the case where assertion is invalid which resulted into nil pointer panic.

gireesh-naidu pushed a commit that referenced this pull request Jun 16, 2023
* handled nil pointer in imagePullSecret service when asserting k8s error type (#3208)

* fix: rbac optimisation for creation of policies for devtron app, helm app and cluster (#2948)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* updated sql script no.

---------

Co-authored-by: kartik-579 <[email protected]>

* deleted redundant sql scripts

---------

Co-authored-by: Shivam-nagar23 <[email protected]>
gireesh-naidu pushed a commit that referenced this pull request Jun 16, 2023
* handled nil pointer in imagePullSecret service when asserting k8s error type (#3208)

* fix: rbac optimisation for creation of policies for devtron app, helm app and cluster (#2948)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* updated sql script no.

---------

Co-authored-by: kartik-579 <[email protected]>

* fix: user/role group sql lock fix (#3206)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* fix deadlock condition for user/role group update

* updated sql script no.

---------

Co-authored-by: shivam-nagar23 <[email protected]>

* removed redundant sql scripts

---------

Co-authored-by: Shivam-nagar23 <[email protected]>
Co-authored-by: shivam-nagar23 <[email protected]>
gireesh-naidu pushed a commit that referenced this pull request Jun 16, 2023
* handled nil pointer in imagePullSecret service when asserting k8s error type (#3208)

* fix: rbac optimisation for creation of policies for devtron app, helm app and cluster (#2948)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* updated sql script no.

---------

Co-authored-by: kartik-579 <[email protected]>

* fix: user/role group sql lock fix (#3206)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* fix deadlock condition for user/role group update

* updated sql script no.

---------

Co-authored-by: shivam-nagar23 <[email protected]>

* fix: label key can be saved without value if saved without propagation (#3190)

* fix: length of key increased in global tag

* fix: not validating label value required tag as tags can be supplied without value if saved without propagation

* sql file renamed

* deleted sql scripts

---------

Co-authored-by: Shivam-nagar23 <[email protected]>
Co-authored-by: shivam-nagar23 <[email protected]>
Co-authored-by: Manish Agrawal <[email protected]>
gireesh-naidu pushed a commit that referenced this pull request Jun 16, 2023
* handled nil pointer in imagePullSecret service when asserting k8s error type (#3208)

* fix: rbac optimisation for creation of policies for devtron app, helm app and cluster (#2948)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* updated sql script no.

---------

Co-authored-by: kartik-579 <[email protected]>

* fix: user/role group sql lock fix (#3206)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* fix deadlock condition for user/role group update

* updated sql script no.

---------

Co-authored-by: shivam-nagar23 <[email protected]>

* fix: label key can be saved without value if saved without propagation (#3190)

* fix: length of key increased in global tag

* fix: not validating label value required tag as tags can be supplied without value if saved without propagation

* sql file renamed

* Fix: App grouping optimisation on ci pipelines (#3219)

* optimize ci pipeline grouping

* fix

* fix

* optimized ci pipelines fetch for app grouping - removed scripts and parent app id

* added observability for ci pipeline in app grouping

* fixed query for getting workflow runner by appId and envId, re-added ci trigger metrics (#3222)

* removed sql files

---------

Co-authored-by: Shivam-nagar23 <[email protected]>
Co-authored-by: shivam-nagar23 <[email protected]>
Co-authored-by: Manish Agrawal <[email protected]>
Co-authored-by: Vikram <[email protected]>
gireesh-naidu pushed a commit that referenced this pull request Jun 16, 2023
* handled nil pointer in imagePullSecret service when asserting k8s error type (#3208)

* fix: rbac optimisation for creation of policies for devtron app, helm app and cluster (#2948)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* updated sql script no.

---------

Co-authored-by: kartik-579 <[email protected]>

* fix: user/role group sql lock fix (#3206)

* change1

* "RBAC Refactoring and Policy Creation Optimisation"

* "Removing ClusterType"

* "ReFactoring the changes"

* removed redundant method

* "Changes After Reviews"

* "Changes After Reviews 2"

* "Changes After Reviews 3"

* "Changes After Reviews 4"

* "Changes After Reviews 5"

* "Changes After Reviews 6"

* "Changes After Reviews 6"

* "Changes based on entity"

* Code Cleaning

* Code change 8

* Code change 9

* Code change 9

* Code change 10

* Code change 11

* Code change 12

* Code change 13

* fixed transaction error for creating roles

* refactoring - 1

* refactoring

* Changes after Resolving conflicts

* Changes after Resolving conflicts 2

* Changes after Resolving conflicts 3

* Changes after Resolving access_type to accessType and queries

* Final changes

* Rbac-Optimimisation Change

* Rbac-Optimimisation Final Change

* refactoring

* Fixing Legacy Bug

* Fixing Visiblity issues all pods

* Merge with main

* Intialisation with capacity and adding logs

* Intialisation with capacity and adding logs

* Refactoring the changes

* Adding logs

* Adding logs 1

* Updating the audit logs for create Role

* Handling from code instead of script

* Merge Main

* Deleting Commented Code and adding role group view

* Fixing issues caught in Dev-Testing

* Removing script queries

* Fixing Issues of entity empty

* Dev-Testing Changes

* Final Changes

* Reducing duplication

* Reducing duplication

* Adding audit logs for superAdmin for user role mappings

* Visibility of permissions

* Visibility of permissions for devtron-apps

* Fixing Legacy issue for deleting roleGroup permissions

* deleting group and role mapping from casbin

* fix deadlock condition for user/role group update

* updated sql script no.

---------

Co-authored-by: shivam-nagar23 <[email protected]>

* fix: label key can be saved without value if saved without propagation (#3190)

* fix: length of key increased in global tag

* fix: not validating label value required tag as tags can be supplied without value if saved without propagation

* sql file renamed

* Fix: App grouping optimisation on ci pipelines (#3219)

* optimize ci pipeline grouping

* fix

* fix

* optimized ci pipelines fetch for app grouping - removed scripts and parent app id

* added observability for ci pipeline in app grouping

* fixed query for getting workflow runner by appId and envId, re-added ci trigger metrics (#3222)

* fix: updated rbac for devtron apps/helm pipeline (#3227)

* commented wrong rbac for devtron apps - helm pipeline

* updated comments:

* remove redundant files

---------

Co-authored-by: Shivam-nagar23 <[email protected]>
Co-authored-by: shivam-nagar23 <[email protected]>
Co-authored-by: Manish Agrawal <[email protected]>
Co-authored-by: Vikram <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants